
Computer programmers are being challenged to write the world鈥檚 sneakiest and most confusing code in a competition that opens next week. To win, entrants must find ways to write programs in the C language that baffle judges on first reading, then perform unusual, unexpected or catastrophic tasks when run.
The (IOCCC) began in 1984 and its co-founder, , says it is the longest-running online competition of any kind. Noll and co-founder conceived of the competition while employed to fix bugs in the Genix operating system.
鈥淲e both came out of our offices at the same time, sort of saying: 鈥榊ou wouldn鈥檛 believe the code I鈥檓 trying to fix鈥,鈥 says Noll. The pair wondered at the ugly and fragile code that people wrote while trying to create good software and decided to see how bad things could get if people actively aimed for bad code.
Advertisement
鈥淸The competition] has a lot of fun in terms of odd things that people do, but it also is really stressing the importance of writing quality code,鈥 says Noll. 鈥淭hese programs that win are almost unmaintainable. They are sometimes written in such a twisted, interlocking way that just to fix something would break them.鈥
Winners are announced in various categories that change from year to year, including 鈥渕ost enigmatic鈥, 鈥渕ost irrational鈥 and 鈥渂est abuse of the rules鈥.
The competition has been on hiatus since 2020, but will reopen for entries on 19 February, running until May. Programs mustn鈥檛 exceed 4993 bytes and former winners have managed to squeeze chess-playing engines, entire operating systems and simulations of real computer chips into that tiny amount of memory.
One entry deliberately crashed itself when run, spilling its internal state into memory and then using that dump of zeroes and ones as a starting point for its next iteration. Entries are often visually interesting, such as a flight simulator whose code was in the shape of an aircraft.
鈥淥ccasionally we get an entry that鈥檒l just stop us in our tracks, saying 鈥榟ow is this doing what it鈥檚 doing?鈥, and we have to struggle [to understand it],鈥 says Noll.
, a software engineer at Walt Disney Animation Studios in California, won the 鈥渂est calculated risk鈥 category in 2004 with a poker game written in a single statement. Usually, all but the simplest programs would contain dozens or hundreds of statements.
鈥淚 had a colleague congratulate me. I was surprised anyone noticed, to be honest,鈥 says Burley. 鈥淚鈥檓 quite proud of my win and feature it on my LinkedIn profile. If I saw an IOCCC win on a r茅sum茅, I would be impressed.鈥
Another former winner, who asked to remain anonymous, says: 鈥淚n the industry where I work, obfuscated code raises immediate suspicion.鈥 But they were drawn to enter because of the conciseness, and even elegance, of the code on show.
鈥淭he competition is undoubtedly fun, but what impresses me most is the expressiveness of C. While there may not be much left to learn about the C language itself, the strict size constraints push participants to distil complex ideas into remarkably compact implementations,鈥 they say.