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.
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.
no subject
And I keep saying: This is the last project where I'm using such a low level language with such poor tools!
_G