Personal Code Smells

This week I have been reading the final chapter of Clean Coder entitled “Smells and Heuristics”. This chapter really got me thinking about my habits as a developer and what I should do to overcome them. Based on the feedback from my mentor and my own refactoring I noticed certain patterns occurring in my Clojure code.

I think the best way to improve as a developer is to review your own code in depth and look at common approaches you tend to take often. The only way to improve is to track your designs and try to break your habits. One of my biggest code smells in Clojure is having to many arguments in my functions. Due to the lack of state in Clojure I find myself packing every detail I can into my functions. Its a huge smell for me.

Two other major smells is my use of magic numbers and strings. Though I know the solid principles, I tend to right my closed functions as if there dependent setting will never change. Looking at a higher level such designs screams that I should consider the long term effects of my code while I’m in development process.

My final smell would be around logical operations and conditionals. I often jump straight into if/else statements in such scenarios. This screams to me that I don’t have a strong command of the Clojure library and the available functions.

Reviewing your code from a constructive view can have immense return if you can see patterns you play over and over again. Our habits are what break us often, creatures of habit rarely grow. Becoming a developer who is serious about their craft requires reflection and eduction on design patterns.

I think moving forward with my apprenticeship I’m going to keep a running checklist of my common code smells. I’ll probably check each item off during the first stage of my refactoring. I think tracking my mistakes will make them more apparent and eventually lead to me moving to a strong command of my development skills.