4 ms·
I often question the wisdom of breaking things down into micro functions. Usually when I'm delving into a Ruby code base where they have taken DRY to the extre
by Rapzid 12y ago
I often question the wisdom of breaking things down into micro functions. Usually when I'm delving into a Ruby code base where they have taken DRY to the extreme(I'm looking at you Chef). There is so much indirection occurring in the most basic of operations that it becomes a huge PITA trying to get your head around what's happening. An IDE that could interpose the source in the method call could be handy in such situations... I also feel that people conflate duplicating code with duplicating behaviour, which is what DRY is really about.
- danieldisu 12y agoYou could have the best of both worlds with IDE support, once it is there people may stop putting so many innecesary layers if they aren't needed only so that function gets "inlined by the IDE"
- glitchdout 12y ago> I also feel that people conflate duplicating code with duplicating behaviour, which is what DRY is really about. Indeed. The definition of the DRY principle [1] is: Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. and not: Don't type the same characters into the keyboard multiple times. People often forget that. [1]: http://c2.com/cgi/wiki?DontRepeatYourself http://c2.com/cgi/wiki?DontRepeatYourself
- acdha 12y agoLook at the Java or .Net worlds as a cautionary example: powerful IDEs are useful for the code you have now but they also enable people to write even more labyrinthine code and the complexity fiends are usually more aggressive at pushing those limits.