Ionrock Dot Org

by Eric Larson

My Weblog

If a one liner is long...

Today I came across a rather large line of Ruby code and it made me think. The line was primarily a long string, but I have seen many lines that are really long doing a set of chained operations. So, the question is, if a one liner is exceptionally long, is it still considered a one liner? The term "one liner" refers to one line of code doing an extreme amount of work. Things like Golf are good examples of writing one liners.

Personally, I don't think it can still be considered a one liner. But I'm also pretty rigorous at keeping my lines in the 80 column category, so I'm rather biased. With that said, I would also argue that placing everything on one line doesn't really make it clever, which a one liner should generally be. The idea is that you've expressed an operation in an extremely concise way, that in most cases, uses the features of the language. So, my answer is no. What about you?

Posted Tue Apr 22 18:43:52 2008 by Eric Larson

Twitter

Links

Reading

Created using Python, jQuery and Emacs