Categories
Uncategorized

Smelly Code, Smelly Code

I always appreciate when the subject matter I’m studying goes beyond the strict boundaries of whatever is most functional and immediate. Writing clean code is one of those things that is often overlooked and undervalued. We’ve discussed it at length in several of my classes at OSU, and I still find myself having to slow down and consciously consider ways that I can improve the readability and cohesion of my code.

I am the first to admit that I’m not great at commenting my code, and that I tend to do most of my commenting as an afterthought. I think that comes from underestimating my ability (or overestimating everyone else’s). There’s a part of me that struggles to define what might be considered complex or not intuitive, and I think a lot of that comes from assuming that I struggle more (as a baby developer) than any potential readers. I’m working on being more intentional about comments, which is advice I’ve come across through a multitude of sources.

That being said, I do make a concentrated effort to be concise when I code. I am generally good at consistency and clarity in variable naming, and I’m mindful of redundancy in code and strive to separate things into more modular sub-functions.

One thing I’m actively working on phasing out is a tendency to hold on to outdated code that I’ve commented out. I have a silly fear about deleting a block of code and then finding out hours or days later that my previous solution was more effective. I’m not egregious about this, and usually I remember to delete the section once I’m done actively working on that part of the project. But sometimes things get left behind, and I’m striving to be more mindful of this tendency.

Section from Lara Letaw’s Handbook of Software Engineering Methods regarding comments and code smells

Leave a Reply

Your email address will not be published. Required fields are marked *