Coding style.

First rule in coding is to make it work. Once you’ve done that, clean up your code
and make it neat, understandable and simpler if you can.

Cleaning up code is a good habit, but so is aiming for clean code in the first place.
You’ll still need to clean things up even if you plan ahead, but you won’t have quite
as much of a mess to start with.

The best coders and average coders usually have similar code, the difference is
how long it takes them to do it. If you take the time to plan ahead and solve the
problem before you start coding it will help you become one of the best coders.
Obviously you won’t be able to foresee every problem so you will have to make
the little things work and that can get pretty messy so what you are doing is called
refactoring the code (and this is a good practice). The best thing to do is first solve
the algorithm on paper and figure out how you are going to accomplish the task.
Then code it and get it to work, then refactor to clean up, make more readable
and optimize. Look at how long it is taking you to solve/code/debug and of those
three the debugging should take the least time, then coding a little more and solving
the problem the most time. Hope that helps out.

3 comments on “Coding style.

  1. I like that you stressed the importance of clean code. I see too many developers who will just make their code work and not care at all about leaving an understandable code base for the next developer who has to support their code. Great post!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s