15th IOCCC Results Posted
leob writes: "FWIW, the 15th International Obfuscated C Code Contest finally came to a conclusion. Read the main page, or, get one big tarball." The contest took a little longer than expected, but the results are fine example of their craft.
What use is this? Surely winning this competition is a sign you should never work again? Obfuscated code (aka elegant) is no faster, even if it is shorter, and may even compile into worse code.
Well, (IMO) you're completely wrong. IOCC code isn't just "bad code getting awards". the winners of the IOCC show an understanding of the subtleties of the way the C language work far beyond that of your average C programmer, or even your pretty good C programmer. Or, to quote Peter Van Der Linden, "..[The IOCC] is a lot of fun and can extend your knowledge in surprising ways".
Spend a few hours or looking through the archives at things like "best one liners" and try and figure out what they do without reading the description - or maybe look through gems like the 1500 character BASIC interpreter. Deobfuscate some entries to figure out how they work and you might find you learn something about what the language can do and it might improve your day to day programming.
For me this shows the problm with open source - people are more interested in playing silly games than actually getting something constructive done.
Yuk, Trollish.
I wonder if they'll make a translation of The Bible in c code syntax? ...
while(1)
hangOnCross(); ..
Or The Iceman Cometh: ...
while(!ANY_HOPE) {
if(have_coin || bartender_will_put_on_tab) {
getDrink();
}
if(HUGO)
say("DON'T BE A FOOL! BUY ME A TRINK!");
else
ignoreHugo();
have_coin = begPatronsForADollar();
bartender_will_put_on_tab = begHarryForADrink();
} ...
I really enjoy the IOCCC, and every year I download the results and play with them. Some are startlingly clever, like the flight simulator a couple of years ago. Writing these obfuscated programs is a special skill, and, yes, it is a form of craftsmanship within the context of the competition. And, of course, the people who can write these little gems have to be brilliant programmers first.
But in all normal circumstances, obfuscated code in any language is bad code . The whole purpose of highlevel languages is to communicate with human beings, not to communicate with the machine: to communicate with the programmer who is to come after you, who has to debug your code, or port it, or update it because some library it uses is obsolete and some of the API has been deprecated or dropped. That programmer may of course be you.
Code that can't be picked up by someone else in six months time - someone possibly less skilled than yourself, and read, and understood, and modified, is poorly crafted. Bad workmanship. If you can't understand this, you aren't going to be a successful member of any development team, either commercial or open source.
Enjoy the IOCCC as a cort of cross between puzzle games, satire, and poetry. A very special kind of programming - a very skilled kind of programming - but one which has virtually no carry-over into the real world.
I'm old enough to remember when discussions on Slashdot were well informed.
but obfuscated code still doesn't seem as impressive to me as a good ol' 4k intro.
Maybe it's the pretty pictures. . .
Comments? Questions?
Thad
Thad
Oops. Forgot to answer the question. The thing uses the Spigot Algorithm, by Stanley Rabinowitz and Stan Wagon.
See (for instance) <http://www.physik.tu-muenchen.de/lehrstuehle/T 32/matpack/html/Mathematics/Pi.html> to get a description. Remove slashdot added spaces from the URL.
So, definitively, no. You won't be a contender with an extremly common stolen program.
Cheers,
--fred
1 reply beneath your current threshold.
I would have to agree that simply rendering a program into ascii art is not itself obfuscation, and therefore, does not properly belong in this contest. On the other hand, I would tip my hat (if I had one handy) to anyone who can write a workable C program that doubles as ASCII art. This probably deserves a contest all of its own.
Remember, you saw it on Slashdot first.
Hopefully I didn't put any [] around my words.
I know you just wanted a cheap shot, and hey, this is the audience for it, but I would suggest you read either Writing Solid Code or Code Complete, both published by Microsoft Press, and both supposedly based on internal MS coding practice. They are very good examples of the ways in which you can write easy-to-read, easy-to-debug, easy-to-maintain code.
Regardless of what the front office does and decides as a direction, there are some pretty clever people at Microsoft (not to mention Microsoft Research - Blinn, Kajiya, Gray, and many others).
(of course, feel free to add a more illuminating comment if it wasn't just the usual MS==BAD)
"don't fall into the fallacy of believing that Perl can solve social problems. Maybe Perl 6 can, but that's a ways off"
And only later did a good answer occur to me--a high tech twist on an old proverb. "There is one beautiful program, and every programmer has written it."
The original of course is, "There is one perfect child, and every mother has it."
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
Hey, try actually having a boss who won the IOCCC...three times, even...
"But remember, most lynch mobs aren't this nice." (H.Simpson)
-- Joe
..people were asking for elegant code yesterday!
Very cool but...
What use is this? Surely winning this competition is a sign you should never work again? Obfuscated code (aka elegant) is no faster, even if it is shorter, and may even compile into worse code.
For me this shows the problm with open source - people are more interested in playing silly games than actually getting something constructive done.
Microsoft didn't get to be as successful as it did by creating obfuscated code you know.
It calculates PI and the AC poster ripped it off from post #3, by crovax, in the IOCC delayed" story.
I think we let a couple of void main()'s through, but I don't know that we will next time; we may even just point it out in the rules.
My blog: http://www.seebs.net/log/ --- My iPhone/iPad app: http://www.seebs.net/seebsfrac/
I'm a Pascal (and Pascal derivatives) lover, personally. I don't like C even slightly, I'm afraid. Might be fine for what other people want to do but definitely isn't for what I want to do.
So. My first instinct when I saw this was Ha! More examples of just why C is horrible! You couldn't do this if in Pascal if you tried!
I then thought about the ingenuity of these authors...
So, does any such resource exist for Pascal code? Beyond simply putting the thing as ASCII art and giving it meaningless variable names, neither of which seem truly worthy to me.
Greg
(Inside a nuclear plant)
Aaaarrrggh! Run! The canary has mutated!
A few entries that I saw were mostly c programs converted to ascii art, which I believe is a pity as if reindented correctly this would not look as obfuscated as in previous contests. ;-).
I however enjoyed some entries, like PrimeNum which is an example of clean obfuscated code, despite its heavy use of preprocessing directives (BTW, even its own name is obfuscating as it has not much to do with prime numbers, even though its apparent algorithm is
Tomx is also interesting as it is a Makefile and a source file at the same time.
--
Trolling using another account since 2005.
What is the point of this? Most of the code I've seen in the past uses some pre-processor tricks to un-obfusticate the source.
I once saw some obfusticated Perl which appeared to be no more than a standard perl program with all whitespace removed, no comments (naturally), and over-use of $_.
Then again I was attempting to revise one of the sound drivers in the current Linux kernel recently, and that was pretty well obfusticated!
> Think I could have be a contender?
Nope. Even in obfuscated C, main cannot be declared void.
Btw, you should give credit to the original author of this program, Dick T Winter. (Which btw, did not put the 'void' before main())
Cheers,
--fred
1 reply beneath your current threshold.