On 22/05/13 23:37, boB Stepp wrote:
On Wed, May 22, 2013 at 8:07 AM, Steven D'Aprano <st...@pearwood.info> wrote:
On 22/05/13 16:20, Jim Mooney wrote:
[...}
A very important quote from Chris Smith:
"I find it amusing when novice programmers believe their main job is
preventing programs from crashing. ... More experienced programmers realize
that correct code is great, code that crashes could use improvement, but
incorrect code that doesn't crash is a horrible nightmare."
Being a novice programmer, I am interpreting this to mean that a) I
complete a program. b) I believe it to be correct and bug-free. c) I
should make sure I do NOT try to catch errors just to keep the program
running from things I failed to anticipate (Probably from being a
novice programmer!). So the conclusion I am drawing is that I WANT my
program to crash if something I did not anticipate/plan for happens.
Am I understanding this correctly?
Yes!
Well, within reason. If you are programming in C, a crash can be a nasty thing
to deal with. It could cause memory corruption, leading to a Blue Screen of
Death or equivalent. In the absolute worst case, low-level C or assembly bugs
can actually cause hardware damage! So you don't want to be writing low-level
code like that if you can avoid it.
But in a high-level language like Python, exceptions are not to be feared. They
are perfectly safe, and should be welcomed, since they show you where your code
needs to be improved.
--
Steven
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor