Bad taste in programming
Posted Mar 1, 2007 17:14 UTC (Thu) by
pr1268 (subscriber, #24648)
In reply to:
Some idle comments about Linus' e-mail response and Linux by ekj
Parent article:
Re: [GIT PATCH] HID and USB HID update for 2.6.21-rc2
Thanks to the above posters for your responses.... But I was thinking more low-level bad taste in kernel programming. ;-) As in:
- /* New kernel idle loop */
for(;;);
- if(something->uid = 0)
/* Hopefully no one will notice missing '=' */
- if(x != x)
/* How come this code never gets executed? */
- while(!((!x)&&(y->a!=3))||(y->b<=y->c->d->e())&&z->f())
/* Someone tell me this while condition is easy to read */
- ...
But I suppose bad taste can exist at all levels of programming.
Disclaimer: I am easily entertained by browsing code at the IOCCC Web site, but I whole-heartedly agree that it's absolutely no fun having to maintain sloppy code whose author exhibited bad taste.
As for coding style (indentation, proper use of curly braces, etc.), Robert Love's book has some style guidelines for kernel code in one of the appendices. Not that I'm trying to plug his book or anything (but it is a decent read).
(
Log in to post comments)