Re:Why bad scientific code beats code following “best practi...
by qwertyuiop924 on Sunday August 28, 2016 @04:59PM
(#12378506)
It depends on how small, and how swarm-y. If the function is hilariously simple, and improves readability (like a premade getter for an alist or cons based structure in lisp), just do it. If it's pretty big, and you'll never reuse it... No. If you must, keep it local.
[ Parent
| on HN ]
Re:Why bad scientific code beats code following “best practi...
by optforfon on Sunday August 28, 2016 @11:34PM
(#12379845)
Even if you don't reuse a function it still encapsulates certain things. By looking at the name you know what it does (self-documenting-code). The interface tells you what variables it depends on. And finally it logically segregates your code.
I think the real reason people don't like small function is simply code navigations - which honestly is a poor excuse. That's an editor/IDE problem
Re:Why bad scientific code beats code following “best practi...
by qwertyuiop924 on Monday August 29, 2016 @06:50AM
(#12381091)
Yes, but encapsulation isn't always a good thing: it lessens your awareness of what's happening within the encapsulated environment. This can lead to bugs.