Writings > Tips For Programmers
18 Jun 2002
Yes, finally, a branch from his normal ranting!
After spending about five days coding in C, I figured this would be of help. Always consider the source when considering whether or not to believe this...
- Object-Oriented Programming does not work
This should have been obvious. C++ (the OO bastardisation of C) is a joke and adds much unneeded fluff to one's code. Stay as far from this as you can. (I only chose C++ because it was the first in mind, but Perl, Python, and others also count)
- Large structures...
...work, unless dynamically allocated, or modified.
- If the code works...
LEAVE IT ALONE! Even if it is not elegant, pretty, or innovative. Otherwise, the second-system effect will happen (see the manual page for ls(1)). That means, from here it's all downhill...
- Just forget about free()
It's too easy to screw up your data, and free() is very sensitive. Why are there no viable garbage collectors?
- The GNU Coding Standards...
...should be printed out, pissed on, and promptly burned. You will feel so much better when your are finished. The gnome's (RMS) thoughts and whims should be ignored. He is out to destroy all forms of readability and logic.
- The GNU GPL should be avoided like the plague
It is too restrictve and contradicts itself. It preaches openness and freedom for all, but then tries to force it via restrictions.
- CVS is a pain in the ass
Just stay away if you can.
- If your work serves a purpose for you...
...give up now. You will become a perfectionist and it will never be right.
- Keep the damn thing simple
Not every program must be able to read mail, contrary to what jwz and RMS want you to believe.
- You must read...
1. The Jargon File
2. Bastard Operator From Hell
3. Computer Stupidities
Not a choice, all are required. You could pick up a few interesting bits, and learn to keep your ass out of trouble.
- File extentions should not be relied upon
Relying on those is just stupid anyway.
- All night hacking runs...
..can do more harm than good.
Is a must-have when API progamming, a lost cause on your own work, and always horribly out of date.
- People are a nuisance
But seeing as your programmming, none are around anyway, right?
- gile's law is always in effect
(Short form: 'Inconvience always overpowers convience.') If it compiled the first time, it will break on the first run. Failing that, the system will randomly crash and dump a core in the middle of your working code.
- Read gile's journal regularly.
He gets lonely.
- Computers and the Internet suck
Best advice: just give up entirely. You can't win.