I recently stumbled across the post “Does Visual Studio Rot The Mind?” and I was reminded of a blog post that I read a very long time ago and could not find on the Internet. I thought I would write down the gist of that article here such that I can share links to it later.
There is this theory that the best and most beautiful code was written before the nineties, before the introduction of modern
As programmers, it is our duty to keep complexity to a minimum. As I wrote in my simplicity series, complexity means “something that has been braided together”. In short, it is coupled. Most programmers know that good code has “loose coupling, high cohesion”. But why?
Contrary to common beliefs, programmers spend the majority of their time reading code. For example, we debug why something is not working the way we expect, or we are trying to figure out where to implement our new feature. The fewer things we need to keep in our head at one point in time, the easier it is to understand the code we are looking at. The same applies to modifying code. This is why we try to avoid patterns like Action at a Distance, work with abstractions to not have to know the details, or organise our source code in modules.
Modern IDEs work against that. They allow you to treat your source code as a giant, unstructured list of files, classes, functions, and global variables. All these can be accessed “at your fingertips” at all times through what is know as “code completion”, “auto-complete”, “IntelliSense” etc. These are all problematic.
If I am working in one part of my source code, I should generally not have to care about other parts of the source code - keeping fewer things in my head. Code completion constantly nudges you to consider using classes and functions in a completely different part of the source code. It nudges you to couple difference modules in ways that they should not interact1.
There is value in having to cd
into a directory and only keep that code in your head. If you haven’t tried it, I encourage you to try to code something in a simple editor2 at some point. You need to approach coding in a completely different way – learning to keep the mental space small & lean. Learning that will also make you a better programmer in an IDE.
About 15 years ago, I worked with a colleague who told me there was this Swedish programmer at a large corporation who would write all of his Java code in Notepad. This programmer was surprisingly productive. We laughed about it, but in retrospect, I think that programmer might actually have been onto something.
Certain programming languages (C++, C#, …) do have support for namespacing which can help with this. That said, not all programming languages have this. There are also build systems such as Bazel that support access control lists for which modules are allowed to import other modules. Finally, there are also testing libraries that allow you to enforce your source code layout, but I consider that outside the scope of this blog post. ↩︎
For example, Vim or Emacs. ↩︎