Monday, November 24, 2008

Path to l33thood

Again, just a random post, I think it's funny considering the examples at GNU/Fun
Here are 3 code snippets, all of them doing almost the same thing (parsing an argument string):

One year ago: http://ubuntu.pastebin.com/f29b96634
A week ago: http://ubuntu.pastebin.com/f2192e38b
and
Yesterday: http://ubuntu.pastebin.com/f1c3c0556

Also, in the first two examples, I use a function, evaluator_info(), that outputs help and version messages. So the code was a little longer because of the help information. In the third example, no such string is needed since 'optparse' automatically creates help messages based on the added options. Great!

No comments: