About Complexity
We often attribute difficulties in reading and understanding someone’s code to “complexity” and perceive this “complexity” as a result of an advanced skill of the author who wrote this program.
In reality, the complexity of the code has nothing to do with the skill of the author.
Let’s take the following code for example:
Looks quite complex: we see ClassLoader
here (probably some low-level stuff is going on here), BufferedReader
, exception handling… What does this code do?
Well, it reads the file greetings.properties
that is located in the “resources” directory and prints it on a screen.
The equivalent program could look like this:
This is definitely less “serious” program — just a few lines of code and you can understand what’s going on even if you are seeing…