News for hackers. Stuff that matters.
Re:Overtaxed Working Memory Knocks the Brain Out of Sync: Study by taneq on Monday June 11, 2018 @08:52PM (#17289909)
Locality of reference isn't just important for CPUs!

I worked with a guy once who loved to split everything into tiny classes made of tiny functions, each in its own tiny source file. You'd hop through four or five different files to do the simplest thing, and it was mindbending to try and debug.

Also with regards to code duplication, it's important to distinguish duplication of statements from duplication of intent. If the code's actually doing the same thing then sure, collapse it down into a function. But if the intent of each piece is different and they just happen to involve the same operations, then removing the duplication is adding a dependency to both places, and may very well not be a net win.

There are no comments on this comment yet.