posts - 4237, comments - 3946, trackbacks - 370

Disclaimer

This was my personal weblog originally hosted by UgiDotNet, written mostly in Italian.

This blog is now part of my new site:
These postings are provided 'AS IS' with no warranties, and confer no rights. The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employers.

Licenza Creative Commons

Tag Cloud

Archives

Post Categories

Quando usare le eccezioni...

Sono senza parole... è una frase geniale!

I can't remember where I initially saw it, but the best advice I've seen for when to use exceptions is as follows:

"Don't pee your pants in order to see if your fly is unzipped."

You should always check to see that you are in a valid state before proceeding rather than throwing a likely exception.

Fonte: Exceptional rule of thumb

Print | posted on giovedì 23 febbraio 2006 17:27 |

Feedback

Gravatar

# re: Quando usare le eccezioni...

bell'analogia ma se la portiamo sul lato tecnico puo` non essere esatta. In Python l'approccio EFGP (easier to get forgiveness than permission) e` comune, anche perche` l'eccezioni non sono cosi onerose come in linguaggi come Java. Certo ci vuole oculatezza come in tutto ma in linguaggi come Python a volte pisciarsi sui pantaloni e` la soluzione migliore per vedere se la zip e` aperta 😛

saluti!
23/02/2006 18:37 | Lawrence Oluyede
Gravatar

# re: Quando usare le eccezioni...

:-D
23/02/2006 18:46 | Lorenzo Barbieri
Gravatar

# re: Quando usare le eccezioni...

frase bellissima la farà mia 😊

24/02/2006 17:19 | nostromo
Gravatar

# Quando usare le Interfaces...

25/02/2006 06:43 | PuntoRete
Comments have been closed on this topic.