Importance of Clean Code

February 28, 2017

I’ve recently updated the “Moroccan Survival Guide” app on the iOS app store. Although it felt great going back and working on the app to give it an update, I noticed some things that were off when reading the code. Well honestly… a lot of things were wrong.

After reading more than halfway through Robert C. Martin’s, “Clean Code”, it dawned on me that my code wasn’t exactly clean. Honestly, I was having a just a little trouble trying to read the swift version for iOS and the Java version for Android. It seems that back then (even though it was only a couple of months before) I was more concerned with getting the app to work, and less on trying make my code look nice and neat.

Some of the things that bothered me were the way I named a lot of my variables and functions. In “Clean Code”, Robert described how reading code should be like reading a storybook, which the code itself should explain what it does. In my app, I had given several variables similar names, which made me go back and forth trying to connect my variables in where they came from and where they went. Even the names of some of my functions were lame to the point I asked myself “What the heck was I thinking”.

There are a couple of more things that bother me, but seeing that it was my first app, I’m still fairly proud of it. Even though I’ve been programming for a couple of years, there are still many concepts that I need to learn and understand so that I can improve myself. I definitely intend on cleaning my code for the “Moroccan Survival App”, and I’m certainly going to write out cleaner code in future projects in order to deliver that storybook feeling when reading my code.