Being that I work in the software development industry and also work on open source projects, it’s needless to say I’ve seen my fair share of ugly code. I’m not just talking about ‘poorly engineered’ code either. Poor indentation practices, inconsistent variable naming conventions, mixed white space, and comment-less code are all things I identify as ugly code. Some of my own work included. We’ve all got code we’re not proud of. That’s the nature of software development. The key is being able to identify these issues and correct them as time goes on.

Over the past couple years I’ve started to focus on cleanly formatting my code (on top of properly engineered code of course). It ends with a much nicer product and when I have to troubleshoot later, it’s easier to navigate my previous work. At one point though, I realized that clean code shows craftsmanship.

Trade-skills are slowly becoming a thing of the past in the digital era. Working with your hands is taking a backseat to typing on a keyboard or pushing a mouse around (myself included), and with that, I think the idea of good craftsmanship can get lost. After all, it’s code, who’s going to see it? Let’s take woodworking for example.

When I was a kid, my dad spent a lot of time building things out of wood. It would take hours for him to complete a project, but the end result would be beautiful. When I’d work on something, it’d fall apart in a week (come on I was like 10 years old!), but I digress. Now, we could probably all build a table if given the proper materials. You’d first setup your requirements:

Requirements for a Table

  1. 4 Legs
  2. Table Top
  3. Level
  4. Supports weight
  5. Proper height

You need nothing more for that table to be considered a table than those 5 things. Would it be one somebody was proud to put on display? Use daily? Have someone else repair? Probably not, but it’s a table none-the-less.

So how would you make it something to be proud of?

  • You’d take the time to choose the right wood (maybe a nice dark oak, or walnut)
  • You’d sand the top to perfection so there were no bumps from the grain
  • You could do inlay patterns with different types of wood
  • Add in a removable leaf to expand for the company that comes once a year during a holiday
  • Use a more ascetically pleasing joint type, maybe a nice dove tail
  • Spend the time to put a few coats of stain on (instead of one) and finish it off with a clear coat

I think it’s pretty obvious to see what I’m getting at. Taking pride in your development work goes FAR beyond what is functionally necessary to meet requirements. Holding yourself to a higher standard in your practices produces something that you can be proud to show off to other developers and shows you take pride in what you do.

As a software developer, your skill is your ability to quickly adapt and write functional code, but showing a true passion for your skill means treating ever aspect of the job with utmost importance. Even the parts “no one will ever see”. Take the time to determine what you consider “clean code”. If you have tools that you use to achieve this, I’d love to see them in the comments.

Post image via designandtechnologydepartment @ Flickr

Posted by Chris Klosowski

Chris Klosowski is the Director of Technology at Sandhills Development, LLC, creators of fine WordPress plugins, and ecommerce solutions.

12 Comments

  1. I would have to say my biggest gripe is what character is used for indentation. In my opinion the only acceptable character is a ‘space’ not tabs. Tabs display differently on different editors and what looks great to you can be a horrible mess to other people; it has happened to me.

    Other than that, I feel as long as you have a defined coding standard for your project and all the code in the project adheres to those standards, you are well on your way to a ‘beautiful’ table. 🙂

    Reply

  2. Couldn’t agree more! The hardest part is when you’re learning and those details take a backseat to the actual mechanics of it all. I’m thinking it might be time to go clean up some old files 🙂

    Reply

    1. Yes, that can make it difficult, but always keep in mind that formatting it cleanly can lead to easier understanding. Also, as Al states, setting up a well defined code standard for your project is important to keep things in line, even during the ‘experimental’ part of the code.

      If you are doing WordPress work, you can always use these references:
      http://make.wordpress.org/core/handbook/coding-standards/

      Reply

  3. viagra arizona generic viagra usa yvaaako – viagra singapore

    Reply

  4. online doxycycline buy doxycycline – where to purchase doxycycline

    Reply

  5. stromectol drug ivermectin for humans – ivermectin 1

    Reply

  6. stromectol in canada stromectol tablets – stromectol over the counter

    Reply

  7. over the counter ed ed meds online without doctor prescription – best medication for ed

    Reply

  8. canadian pharmacy prescription drugs online without doctor – prescription drugs without doctor approval

    Reply

  9. hydroxychloroquine sulfate price hydroxychloroquine – plaquenil cost for generic

    Reply

  10. hydroxychloroquine 300 buy plaquenil – cost of plaquenil uk

    Reply

  11. new ed drugs buy cheap prescription drugs online – comfortis for dogs without vet prescription

    Reply

Leave a reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.