Quedé muy interesado en este libro, tiene muchas papitas para hacer mejores códigos.
Ej:
The Error Handling chapter is important because of the application of earlier chapters — the Do One Thing rule. Your functions should do one thing — either handle business logic, or exception handling, but not both. It's the difference between this:
try { s = new Socket(4000); s.OpenSocket(); string data = s.ReadFromSocket(); if(data == "32") data = "42"; printer.print(data); } catch(Exception ex) { if(ex == NetworkInterruptException) { //do something } if(ex == PrinterOnFireException) { //do something } logException(ex); }
And this
try { tryToPrintDataFromSocket(); } catch(Exception ex) { logException(ex); }
http://books.slashdot.org/books/08/09/23/2243216.shtml
Suscribirse a:
Enviar comentarios (Atom)
1 comentario:
Se puede comprar en PDF en:
http://www.ereadable.com/scripts/browse.asp?ref=0136083226
Publicar un comentario