Blinking Code

In his book “Blink: The Power of Thinking Without Thinking“, Malcom Gladwell describes a subject called “thin-slicing”. Thin Slicing is our ability to gauge what is really important from a very narrow period of experience. The idea is that spontaneous decisions are often as good as carefully planned and considered ones. In his book he expands on this idea and others that are worth reading about.
One of the characteristics of the “thin-slicing” ability is that it is done by the unconscious mind and its conclusions are sometimes delivered to our conscious mind is via “hunches” or “feelings” that are very difficult to explain.
A few days ago, I found myself looking at a piece of code and suddenly realized that “something felt wrong”. I started to go through the code line by line, piece by piece but I was not able to find what was bothering me. Even after some time looking at the code, the reason for my “bad feeling” was eluding me. I called on some of my colleagues for their opinion. Some of them, regardless of the years of experience they had with coding in the same language that the snippet of code that I was looking at, thought I was losing my mind and tried to convince me that everything was OK. Another colleague, with some experience in a different language, agreed with me that something “felt” wrong but he could not tell me what or why.
This got me thinking, why some programmers with lots of experience programming in the snippet’s language did not get the “feeling” and why another one, with less experience did.
I got to the conclusion that it had nothing to do with the programming language.
Suddenly it hit me. The problem was a race condition on a multi-threaded system. In some scenarios, the algorithm could yield the wrong result as a result of the order the threads were run. It had nothing to do with the language it was written. The algorithm was wrong.
After further analysis, I got to the conclusion that in some cases, the experience on a specific language is not relevant. With some time, you can be proficient in any programming language. In this case, the two elements that were really important are how well you understand a concept and the experience you have facing a diverse domain of problems.
Maybe we need to reconsider what we think about when we talk about a senior developer or architect.