Re:Death by design patterns, or On the cognitive load of abs...
by peterashford on Tuesday May 30, 2023 @12:08AM
(#36121025)
Yep. 100% on board with this. The more code and the more complexity, the harder the system is to understand, maintain and extend.
Re:Death by design patterns, or On the cognitive load of abs...
by Groxx on Wednesday May 31, 2023 @02:49AM
(#36135271)
Yeah. I summarize 1+2 as "optimize for reading" personally - none of us is as dumb as we are in the past/future, explain yourself and don't be clever without an explicit need and a way to recover from it later, etc.
My coding heuristics now pretty much boil down to:
1) Less code is better code. The only code with no bugs is no code. After you get something working, remove as much code as you can.
2) Simple code is better code. Don't waste time making your code complex for the sake of being efficient until you've used it and proven that it's a bottleneck with a profiler. Otherwise, just do the simplest thing you can think of that will work.
3) Don't think too far ahead unless you specifically have been tasked with it. Otherwise, do what will work now. Refactor when necessary.