News for hackers. Stuff that matters.
Re:The worst possible Hello World program by singular on Sunday April 03, 2011 @03:14AM (#2402045)
I get the point, and it's important to point out to beginners the various subtleties of error checking, etc. - but to me the 'best possible' hello world is rather overengineered, I mean 4 includes to begin with... :-)

And dude, don't go using the word 'worst' as lightly as that. It's dangerous - I am sure we could make it ohhh really quite worse... how about relying on some known compiler/os bugs to flip some bits somewhere, obfuscating it right up then generate some code by repeating various pointless operations (but all slightly subtly randomly different so not obvious enough to remove) to get it to say ~ 5 million lines of code? :-D

Re:The worst possible Hello World program by boredzo on Sunday April 03, 2011 @04:01AM (#2402130)
If we tried to pour the collective total of human stupidity (artificial or otherwise) into a single program, it would exceed the capacities of all the storage devices ever made, past, present, and future. :-)

Honestly, if I were writing this today, I'd make the “worst” example less bad. What you see here is way too fantastic. 2011 Me would make it realistically bad—the sort of thing a new or just plain apathetic programmer might write. I wonder, though, how much it would differ from the canonical one-liner.

Re:The worst possible Hello World program by singular on Sunday April 03, 2011 @04:02AM (#2402133)
I think the best kind of example would be one where the problems weren't at all obvious, yet were rather fatal.
Re:The worst possible Hello World program by boredzo on Sunday April 03, 2011 @04:17AM (#2402151)
Maybe so. Perhaps one example fault would be testing the result of fputs against 0 rather than EOF…