Tuesday, September 22, 2009

Some more thinking about the three concepts of programming

Consider the last of the three principles of programming:
Endurance recalls the fact that coding is not only "pressing a button to compile", but also making sure that thet code you have been writing works as it is supposed to.
Debugging is a tedious process. Basically, it consists in checking the functionality that has been added within the coding phase. The (stupid) machine is not able to go through it by itself AND at the same time evaluate the correctness of it. Sure enough, the activity can be automated through some testing code, but that again translates in (as the name says) more coding.
Now, without diving into the details of testing - how much of this process can we automate without writing any additional code?
Consider this situation : the perfect solution would be the machine itself knows what she has to test out of the box. That would mean the machine knows the behaviour of our software artifact already before it would had been written (possibly), which in turn would get you to think that hey, the machine could write that piece of functionality by itself! if it already knows the nature of the functionality, correct?
This already sounds hidious, doesn't it? You realize where it is heading, or? Exactly, it tastes alot like the good old "dog biting tail" paradox.

...and there came the day the Linux stood still.

Damn you Linux!
And it gets worser..
Damn you Ubuntu!
Half a day lost - for what? Don't know. I know what happened. A machine running Ubuntu 64 bit Server (that had worked fine for over 8 months) suddently stopped booting into gdm.
On login to any user, it woulds state "/dev/null no permissions". WTF?
See, this is exactly why linux (written with a lower case L on purpose, didn't deserve the capital one today!) sucks. When something goes wrong - it NEVER does, really, but when it happens - its almost a total disaster. Mainly for two reasons.
  1. The system usually is totally or partially unusable
  2. Finding out what happened takes half a time of your life
  3. 20 years of development and noone cared doing a proper, centralized log viewer interface - you know what, f*ck you.
Well the third reason came out of my hearth, just had to log it. Sorry dudes.
So what happened? Apparently, some "obscure" thing mixed up the /lib/lbs/init-functions file, which ended up being empty. This in turn caused the (all) services to exit with log_daemon_msg messages, causing services who invoked them to think they failed.
Which translates in a clean boot in the most proper way, as in no services started. Not even ifconfig for configuring the network interfaces for an example.

Well, luckily that "obscure" thing was kind enough to take a backup of the init-functions before erasing the contents. Which btw excludes Hard Disk crashes (and shuts the mouth to all of you I-know-better out there)who are not even as half as nice to make a backup before taking action.
Once restored, the system seems to work fine (so far).
But what caused that problem? No one knows, not even Google....

Monday, September 7, 2009

Three basic foundation principles of programming

Making software (aka "programming") comprises itself of three separate principles:

a) Writing
b) Logic
c) Endurance

Writing is specifically important from the understandability point of view. Complicated code written in a complicated way doesn't really help the reader to understand it better.

Logic is, well, the basics of informatics in general, your morning star. Whichever problem you want to solve, logic is the way to do it (and mathematics).

Endurance recalls the fact that coding is not only "pressing a button to compile", but also making sure that thet code you have been writing works as it is supposed to.
This last part is usually also called "debugging".