Thursday, January 28, 2016

Poetry and Programming

Most people do not associate poetry with computer programming. Yet on a fundamental level, poetry and programming actually have many similarities...

  1. Brevity. The best poems and computer codes are concise and use the fewest words or symbols. The best poems are those that have many interpretations contained within a short arrangement of words. Similarly, the best programs are the efficient ones that can complete a task with the fewest lines possible.

  1. Word choice. Every symbol and word has a purpose in both poems and computer code. Every word in a poem has a meaning, and the author chose every single word for an important reason. In the same way, every symbol in a computer program has a reason for being there. No programmer leaves extra words or characters cluttering up the code.

  1. Hard to understand by skimming. The meaning of both a poem and a computer code is not clear after just a quick glance. You cannot understand the full meaning and all the nuances of a poem by just skimming it in a few minutes. You have to sit down, analyze it, and think about each line's purpose. The same is true of a computer code. If one programmer tries reading someone else’s uncommented code, they would find it almost impossible to make sense of without careful reading and analysis.

  1. Repetition. In many poems, repetition is key. Whether it is repeating the same first line in a verse, repeating a word or phrase two or three times for emphasis, or just repeating the same theme throughout the poem. In computer programming, the fundamental basis of almost every code is loops, which allow programmers to repeat a section of the code as many times as the programmer wants. Both poems and code would lose meaning without constant repetition.

Below are some simple programs that can be read in haiku form. The first represents the basic syntax of a for loop in Java. The second is a basic program in c++ that outputs the text “Hello world.” The third is a similar basic text-output program in Java.

for( int x = 10; x > 2; x--)

For int x is 10
x strictly greater than 2
x decrease by 1

-------------------------------------------------------------------------------------------

#include <iostream>
int main()
{
      cout << "Hello World!";
}


Include iostream
Int main no parameters
C-out hello world
-------------------------------------------------------------------------------------------

public class program
{
public static void main(String[] args)
{
System.out.print(“Hi!”)
    }
}

Public class program
public static void main args
System out print Hi!

10 comments:

  1. Super cool way to make a connection between the two! I was super excited to see that you actually wrote a program for your blog post. I agree with almost all of your points about similarities, except I'm a firm believer that long poems can be good too. Good job summing up similarities of two seemingly polar opposite things!

    ReplyDelete
  2. Wow! This is so cool. I never really thought about the connection between programming and poetry. I like the similarities between code and poetry that you give. The programs you wrote are also really interesting. Nicely done!!

    ReplyDelete
  3. This is a really neat way to think about the connections between poetry and programming and it made me think deeper about the importance of every word in our poems. I like how your code can be read as a haiku poem.

    ReplyDelete
  4. This was really cool! The points you make really do make sense, I especially like number 3. After reading this I really see the almost now-obvious connections between poetry and programming. I think including the poetry-code haikus was very interesting because the codes actually work; it's not just poetry in code format. This was a really clear and interesting blog post.

    ReplyDelete
  5. Awesome! I love how you turned some code into poetry. I appreciated that you wrote out the actual coding format and then also how it read as a haiku. You make great connections between coding and poetry that I hadn't really thought of before.

    ReplyDelete
  6. Nice comparisons between poetry and programming. The way you fit a program into haiku format was super creative (though you did phrase some of the commands questionably :P)

    ReplyDelete
  7. This is a really cool concept. By similar logic, you could also say that longer codes, & poems tend to use repetition. Even though long poems or codes are not required to repeat themselves, it is a common occurrence.

    ReplyDelete
  8. You are very clear in making this connection. Never thought one can argue how poetry and programming can be alike, but this post definitely changed that. Also good example in the end.

    ReplyDelete
  9. I really enjoyed your post! The connections you made between poetry and programming are really thought-provoking! I hadn't ever thought the two could be so similar, but you explained your points really well. And I enjoyed the simple program haiku you added as well.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete