miércoles, 24 de septiembre de 2008

libro para comprar: Clean Code

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

1 comentario:

pbustos dijo...

Se puede comprar en PDF en:
http://www.ereadable.com/scripts/browse.asp?ref=0136083226