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:
A week ago:

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: