3 ms·
Obviously people are fairly opinionated about this. I agree with you 100% - code reuse is far too overvalued and copy and pasting has a bad name. If something
by fsloth 8y ago
Obviously people are fairly opinionated about this.
I agree with you 100% - code reuse is far too overvalued and copy and pasting has a bad name.
If something "fits" a function then yes, by all means lift it as a function. But not all long snippets of code make sense when lifted out of the scope - there's no reason to wrap those.
Most of all, forcing all code to fit "merely calling functions style" is an antipattern that can make the code less understandable.
- m0zg 8y agoGood code is like a good book, it's written to be read. A lot of people don't get that. Small single-use functions are like footnotes.
- quincunx 8y ago... and maximizing entropy makes for a terrible read. Good code, like child poetry, should be allowed to rhyme.
- pif 8y agoFully agree with you. The problem is many people don't know how to read code properly: they try to read all the details at once, instead of surfing at the top level(s) and going deeper only when they actually need. Such people are the bad developers who write bad code bacause they cannot read. My personal mantra with copy&past while programming is: if your mouse gave you a little electric shock on pasting, would you paste it anyway?