news.volyx.in

Xmas.c (1988) (udel.edu)

559 points by evah · 972 days ago · 95 comments on HN

Article summary

The article presents a 1988 C program that prints the lyrics to the Christmas carol 'The Twelve Days of Christmas' in a highly obfuscated manner. The program uses a substitution cipher to encode the lyrics and employs recursive functions to print the decoded text. Despite being written in an older version of C, the program still compiles and runs today. The program's compression of the lyrics is noted, although its efficiency is disputed in the comments.

Main themes

  • obfuscated coding
  • text compression
  • C programming language
  • code portability
  • compatibility
  • compression algorithms
  • code readability
  • K&R C style
  • IOCCC
  • programming challenges
  • compression efficiency
  • algorithm advancements

What commenters say

  • The IOCCC entry is an example of creative and compact coding, pushing the boundaries of text compression standards at the time.
  • Some argue that the program's compression is not as efficient as claimed, citing later compression algorithms like gzip and 7z.
  • The program's ability to compile and run on modern systems is a testament to the portability and compatibility of C.
  • Others note that the program's obfuscation makes it difficult to understand and maintain, highlighting the trade-offs between code brevity and readability.
  • The use of K&R-style function parameters in modern code is still present, although it is generally discouraged in favor of more modern standards.
  • The comparison between the program's compression and later algorithms like zstd is unfair due to the significant advancements in compression technology over time.