display | more...

Nothing embodies Hacking like Source code poetry.

It represents all that Hacking loves - creativity, cleverness, and using something for what it isn't intended.

Source code poetry is just poetry written in the source code of some programming language, such that the program reads like a poem. This is a fun way to add some extra constraints to poetry writing, or to show off prowess and knowledge of a particular programming language.

While there are no official rules, there are a couple of unofficial rules. The first rule is that the program must compile. This is a no-brainer. If non-compiling programs were allowed, anything at all could be considered source code poetry. The second rule is that dynamic programming languages are not allowed. In these languages invalid variable names, and other violations are often ignored till runtime. This means they are far more lenient in what they consider a program, allowing you again to write almost anything. This is particularly true in a language such as Forth - which will accept almost anything as input. The third rule is that the poem must rhyme. While writing free verse can be fun, source code poetry is about find ways around around obstacles, and placing more in the way only enhances that.

The main aspect of source code poetry is how it looks. With a monospaced font (like a typewriter), syntax highlighting, and an abundance of punctuation, source code poetry is in some ways more like a picture than prose. A skilled source code poet knows how to take advantage of those aspects to highlight and evoke the point of the poem.

The difficulty in source code poetry comes in trying to squeeze a poem around the natural constraints and structure of a programming language. A fairly inoffensive constraint might be that all statements need to end in a semicolon. Or a far more complex constraint might force you to put some type name such as int or char before all your words. Obviously something like that will quickly ruin the poem - so working around these is where the fun lies.

Probably the most famous source code poetry is black perl, by Larry Wall, the creator of perl itself. He famously posted it anonymously on the perl mailing list. For hackers such as Larry Wall, who have been programming for so long, each ASCII character, each command, and familiar noun, is known so well, and holds so much weight, that the poem is so much more than what it reads as. To the common person exit means so much. It means something totally different to someone who types it several times a day to control the machine that makes them a living.

Source code poetry is an example of what lifts programming from a mundane task to an art form. For anyone with even basic skill in programming you must try it. All it requires is the same things required normal programming - a love for the craft, a will for self expression, and rhyming dictionary.

Source Code Poetry 2014
code {poems} project
Stanford code poetry slam

Log in or register to write something here or to contact authors.