Re:Why bad scientific code beats code following "best practi...
by whstl on Saturday January 06, 2024 @10:57AM
(#38892448)
Yep. Long functions can be easier to read and simpler to follow than multiple methods, if they're well documented.
Carmack has a good essay about it.
http://number-none.com/blow/john_carmack_on_inlined_code.htm...
Re:Why bad scientific code beats code following "best practi...
by __loam on Saturday January 06, 2024 @06:42PM
(#38896783)
My heuristic is that if logic is repeated at least 3 times, it's good to pull out into its own function, and even then you still need to consider liskov substitution principle.
20 files with 20 functions each does not cause high cognitive load, if the scope of each file and each function makes sense. You easily find the file+function you need, whenever you need to look something up and the rest of the time it is as if the rest didn't exist.
Good code can come in any shape. It is not shape itself that is important, it is the "goodness" that is important.