Sunday, 27 April 2008

Trust the documentation

As most folk are no doubt sick of hearing, I'm a very keen computer programmer.
What can I say? I love code.

Now then, writing something totally from scratch is pretty unusual. Generally you make use of libraries that contain code and functions pre-written by others.
You don't tend to actually edit or even touch said code, you just use it.
You're supplied with documentation written by the original author, which explains how to use the code. What it doesn't do is go into every last detail about how it all works: it says what you need to know. Now, sometimes the documentation can be unclear. Sometimes you need to work it out for yourself. This is where problems arise. You can get things wrong if you're not careful. You can assume things that aren't stated, and that can lead to trouble.
If you try to make it do something it's not designed to, you can find yourself with more errors and glitches than Windows. If you make it work the wrong way, you can find yourself with something totally unexpected. Sometimes the errors can be subtle: you can make a mistake, and nine times out of ten it won't even be a problem. It helps to learn as quickly as possible that you don't want to go doing this. You have to learn to just follow what the documentation says, not what you think it says. Keep it simple.

I'm a bit sadistic, so I'm not going to go any further with this one. It's already a bit convoluted. Think about it, see if you can follow it on to a useful surmising about reading the bible. Have fun!
I have some code to get back to...

No comments: