4 ms·
> Should examples--even beginner examples--include the error-handling code? > Brian: I'm torn on this. Error-handling code tends to be bulky and very uninteres
by ggchappell 18y ago
> Should examples--even beginner examples--include the error-handling code?
> Brian: I'm torn on this. Error-handling code tends to be bulky and very uninteresting and uninstructive, so it often gets in the way of learning and understanding the basic language constructs. At the same time, it's important to remind programmers that errors do happen and that their code has to be able to cope with errors.
The lesson we learn from this is that we should design languages so that error-handling code does not have to be "bulky".
- ced 18y agoDo you know any language where it's not bulky?
- ggchappell 18y ago> Do you know any language where it's not bulky? Good question. Off the top of my head, I'd say, "no". OTOH, one can look at relative bulkiness. E.g., I've found that dealing with exceptions in Python is significantly less work than in C++.
- snprbob86 18y agoOr, leave error-handling code just as bulky as it is, but design languages in which errors need to be handled less frequently.