I was tinkering around with my linux installation and trying to decide on a new terminal to use, and I ended up compiling st (suckless terminal). On a whim, I decided to look through the source code and see how much of it I would understand.

There was a C header file called arg.h that uses the preprocessor and macros to parse argument flags and songs by setting up a switch statement in a loop, all in under 50 LoC. To use it, just wrap the switch body between ARGBEGIN and ARGEND, and that's it. The comment at the top simply read "copy me if you can", a challenge to future programmers such as myself.

It was the most beautiful, elegant solution I have ever seen. I tried to tell my girlfriend about it, but she just didn't get it. Maybe some of you will appreciate it more:


Your Job Suck?
Get a Better Job
Add Comment