Thursday 16 October 2003 — This is more than 21 years old. Be careful.
Well, ever since Joel took notice of my article about exceptions and status returns, the weblog joint has really been jumping. Joel asks me to give real examples rather than “DoSomething” for function names. It’s kind of a funny request, since his example used functions named “f” and “g”, but it makes sense to ground this in reality.
In response, I wrote another article laying out my view of how exceptions fit into real code: Exceptions in the rainforest.
A number of people rose to Joel’s challenge before I could:
- Len Holgate has a good example of how to handle the “failure during installation” scenario.
- Jesse Ezell tries his hand at it, though I don’t think I like his first try: checking the class of the exception seems a particularly awkward defense of exceptions.
- Steve Tibbett shows some other ways to slice it (though I don’t approve of “catch (...)”).
Comments
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."
He also had nasty things to say about FORTRAN, PL/I, AND API as well as COBOL and APL. I wouldn't be too sure that he would be any kinder to C++ or Java programmers ;-)
--bob
http://www.math.uwaterloo.ca/~shallit/Courses/134/dijkstra.html
--bob
Add a comment: