At 03:24 25.08.2006, Nick Holland wrote:
Yeah.
Use vi or emacs. :)
The OpenBSD developers spend a lot of time making code fit what they
call "KNF" -- Kernel Normal Form, documented in style(7)
They do it carefully by hand, not using automatic tools. Why? To
get EYES ON THE CODE. Go look at the commit logs, they often end up
catching errors doing this.
Run your "ugly" code through an automatic beautifier, you end up
with ugly code that now looks pretty...every bug remains, and your
knowledge of what is in there doesn't improve. Sure, you might be
able to read it better LATER, but the point is, you didn't read it
NOW. If you don't, the bad guys may...
Even though I'm not a coder, this technique helps me on the FAQ, as
well. Take a chunk, "normalize" it, and then go "Eww. We can do better". :)
Nick.
Man, I don't know how to thank you enough for showing me the normal form!
I had no idea a standard for this existed, or how to create one myself,
but now I surely do and it's all thanks to you!
All the best,
Kyrre