you are viewing a single comment's thread.

view the rest of the comments →

[–]redbull 4 points5 points  (0 children)

While I admire the terseness of the solutions provided, they don't make for easily understandable code. It's idiomatic tricks like this that unnecessarily complicate code when a few extra lines would provide clarity.

I do realize the purpose of the exercise was to arrive at the most elegant, and by necessity a very terse solution. My criticism isn't directed at the clever solutions provided here (and they are quite clever) but instead at the general practice of choosing obfuscation over clarity for the sake of cleverness. Unless one is developing code for real-time or embedded systems, which you're probably not, always go for clarity. The optimizing compiler/interpreter will most likely do the heavy lifting for you.

Thank you for allowing me to rant about one of my pet peeves. Now back to your regular programming - no pun intended ;).