Re:Is Functional Abstraction Too Clever?
by swombat on Saturday October 17, 2009 @09:37AM
(#886913)
Functional abstraction in general is not too clever. This particular code example, though, absolutely is. As mechanical_fish pointed out, it's pretty much illegible.
DRY is only one of the principles of good code, and not the highest one. The highest one would be that the code must work. The second highest that the code must be clear to the reader.
I warmly recommend this excellent talk by Marcel Molina Jr at RubyConf 2007, about what makes code beautiful:
DRY is only one of the principles of good code, and not the highest one. The highest one would be that the code must work. The second highest that the code must be clear to the reader.
I warmly recommend this excellent talk by Marcel Molina Jr at RubyConf 2007, about what makes code beautiful:
http://rubyconf2007.confreaks.com/d1t1p1_what_makes_code_bea...
He gives a good example of a case where using too many abstractions results in unclear, and hence ugly code.