Learn to fly

Do you wanna fly with us?

Mental overload

Aug 16, 2019

Pedro Santos

In this article we will have a look at some examples of connascence and why we relate it to mntal overloading of programmers. We will only use a few examples. For more information on connascence have a look here (connascence.io)[https://connascence.io/].

Connascence of meaning

Imagine you have a method that returns an amount of money represented as a decimal. Or that a method returns a credit card number represented as a string.

Where is the information that the decimal represents an amount of money or that the string represents a credit card number?

It’s not in the code right? If not in the code where?

Where else than in the programers mind.

Connascence of position

Imagine you have a method that takes or returns an array but position in the array has a meaning, you need to put specific information in specific positions.

Where is the information that the position is meaningfull?

It’s not in the code right? If not in the code where?

Where else than in the programers mind.

Connascence of algorithm

Imagine you have a method that returns a string but the string is encoded in Base64. In order to read the string the programmer needs to know that it must first use a specific algorith to decode the string.

Where is the information that a specific algorithm needs to be executed?

It’s not in the code right? If not in the code where?

Conclusion

When code has hidden meanings it forces programmers to load all those hidden meanings in the mind in order to work with that code.

Frequently I work with teams that are unable to recruit less experience developers, most of the time is not about less experienced developers lacking knowlege or skill. It’s often related to more experienced developers being more used to the pain of mental overloading. Programmers over time develop a capacity to keep information that should be in the code in their minds. This is a sad state of our industry and we as programmers are responsible for this, we got so used to have this mental overload that its considered “normal”.

Copyright 2019, CoKaiDō