I was checking my RSS feeds while waiting for a system build and I saw a post about OJ Simpson. I almost clicked on it, but then common sense prevailed and I decided I would rather watch messages like
17>Compiling...
17>SQEdit.cpp
17>ShelfModel.cpp
17>querent_app_main.cpp
17>querent.cpp
17>MacroModel.cpp
scroll by in my build output window than read anything more about OJ Simpson.
| Annoying Old Guy Friday, 16 November 2007 at 14:06 |
No, the “17” means that it’s the 17th project to be compiled in the system build. Although 17 screen windows isn’t that uncommon for me, so go ahead and call me “Tangential Boy”.
Haven’t changed too much from the “Entropy House” days, hmmm?
| Annoying Old Guy Friday, 16 November 2007 at 19:42 |
Not much.
since this thread is sort of programming oriented, i guess i will use it to get your views on “design by contract”. i have been using a simplified version of it on a personal project, and have gotten really good results. using assertion statments, i check all method parameters (even public methods) and all critical intermediate results (mostly checking for non-null).
before i was doing if-then-exception type checking which cluttered the code and was awkward to handle from the caller side of things. there is no attempt to “handle” undefined or illegal conditions, and once the assertions are turned off, any errors will have free reign :) anyway, i would value your thoughts on this area, and especially am interested in ay techniques/conventions you use personally.
| Annoying Old Guy Saturday, 17 November 2007 at 07:28 |
I tend to the flavor of design by contract, but tend not to use a lot of assertions. I prefer to use other techniques to enforce the contracts automatically.
In the end, I still do a lot of if-then checks for parameters because I have found that assertion failures just don’t give enough information to debug in general. Instead I use a home brew error reporting mechanism that lets me stack error messages for the final output. E.g., if library A calls B and B fails, A can stack its own message on B’s error and return that. This lets me see what the failure locus was and its larger context. “Unexpected nil pointer” is fine, but who passed in the nil pointer and why?