Minimalism
planted on in: Programming and Methodology.
~382 words, about a 2 min read.
In the early days of computing the resources available where slim and minimalism in programming was a part of the job. Nowadays with the explosion of Moore's Law and with it the prevalence of high speed thinking sand; outside specialist fields such as embedded applications, programmers can almost consider computing resource limitless.
This has however resulted in considerable software bloat over the years, for example the Microsoft Calculator program: the version of calc.exe
shipped with Windows XP weighed 112.0KB
[1] whereas the version shipped with Windows 10 is many times bigger!
I am a big advocate of pragmatic minimalism in programming. What I mean by that is not to take it to the extremes of code-golf, instead its more about keeping a programs surface area small enough that the average developer can keep enough of it in working memory to be highly efficient.
There are many differing principles that aim to help, I have found both KISS and DRY principles help but as with all things there are grey areas, and sometimes you need a worse is better approach at least in the beginning.
With ever-increasing vendor folders (node_modules
I am looking at you,) the time of a programmer knowing all areas of a code base are quickly becoming a thing of the past. When was the last time you delved deep into the inner workings of Eloquent, or the Symfony Console Component? Increasingly I am seeing people treat these as black boxes, rarely delving deeper than what the documentation surfaces and hardly ever using a debugger like xDebug to peer up the call stack.
This "bloating" of third party code increases the surface area for both bugs and attack. Yes, we now have tools such as npm's audit command, GitHubs Advisory Database and the automatic warnings when installing/updating packages with composer. These help, but they dont outperform not having so much extra code in the first place.
Strive for the most functionality from the least amount of code while maintaining readability. Remember, the best code is no code at all.
As listed at Classic Calculator Extracted From Windows XP at the Internet Archive ā©ļø