— smells of code — 1 min read
Code is beautiful and you will fall in love with it several times. The feeling of power when it compiles, runs and outputs what you expected, the feeling of being able to build anything that you always thought to be impossible, this dopamine on our brains is what boosts our code to next level.
However, that's not always the case. A few times you will look at some code and think What the heck?! Those are code smells and I have been collecting it!
It happens for many reasons. For example once you become a more experienced developer, you look back at that piece of code you thought to be the best thing in the world and it's in fact, a poor version of what you can write today. Also senior developers can write smelling code, it happens for many reasons.. A quick-fix under pressure, a lazy workaround, lack of business knowledge or requirements, a solution that initially seemed to be good enough, or you could just be drunk while writing code.
Let's have a look at some code smells I've been collecting!