Profile

outlier_lynn: (Default)
outlier_lynn

January 2015

S M T W T F S
    123
45678910
11121314151617
181920 21222324
25262728293031

Most Popular Tags

Expand Cut Tags

No cut tags
Monday, November 20th, 2006 08:20 am
The more programming I do and the more old code I try to maintain, the more convinced I am that the general trend is to write code that is too minimalist.

Yes. I understand the notion of software bloat. Plenty of examples of bloated software around this workplace. But most of the code looks like the code I use to write when I was just learning. Until one has some level of experience and some lengthy time practicing and studying, it is more than likely that any code written will have twice the lines of code needed to perform some task. It is compounded by the use of weak languages.

But I have become a firm believer is debugging code, error traps and other sanity checking. Even in places where it errors are "not possible." Check the sanity of data going into and out of functions/procedures. Maybe check going in for the smallest utility functions, but check anyway.

Provide a graceful failure that allows a second chance.

And if crashing is unavoidable, provide a decent error messages and, if at all possible, log everything.

I have written a bunch of "get it up and running" code over tha last two years that doesn't always follow this philosophy, but the code does extensive logging. And that ahs been a real treal when bug fixes are needed.
Tuesday, November 21st, 2006 09:48 am (UTC)
What you're saying parallels what I've been going through. Every time I try to hurry and take shortcuts I seem to get bit. I had to write a logging system for Postgres extensions (because all regular debug messages disappear if a transaction fails) and I am continually extending and refining my assertions, etc.

And I keep saying: This is the last project where I'm using such a low level language with such poor tools!

_G