You cannot build a perfect system

January 13th, 2016

How many of you expect to write the perfect system on your next project? If you're practical, you'll realize it's not going to happen.

With the rise in demand for software developers continuing to grow, it's becoming harder and harder to find the qualified individuals for these positions.

If you're a student in college and an IT specialist/developer (and you graduate), you enter the workplace and start at ground-zero.

Just like everyone else before you.

You start down the career path of a professional developer.

However, as I've mentioned the difference between knowledge and experience, you will be asked to write some code by an employer or a boss of some kind.

I don't want to to sound harsh, but prepare yourself for this next statement (you may want to grab a tissue):

In every system built from scratch, your first piece of code will be the worst piece of code you will ever write. 

Still with me? Good.

Why did I say this?

I can't remember when I wrote my absolutely first line of code, but it was in BASIC on a Commodore VIC-20...and it was horrible.

Hacking a PRINT statement with GOTO's peppered throughout the code with IF statements branching everywhere.

It even sounds bad. Eeek! (Younger readers are probably wondering..."GOTO statements? What are those?")

The good news is everyone goes through it.

Let me explain.

Write Code like a Novelist!

I ran across one particular developer in my career who would sit there and look at the screen and try to come up with the best design possible.

There is a term for that and it's called "analysis paralysis."

This is considered an anti-pattern in development (or any industry for that matter) and shows the ability to over-analyze a project where no work is accomplished except for analyzing the heck out of the project and determining the best course of action. The problem is no movement is made on the "action" part.

I mentioned to this person to start building small pieces of the system. Break the project into smaller chunks that are digestible and manageable. "Don't eat the whole pie. Attack it using slices."

Another way to look at this is to just start writing code (I can hear some project managers cursing me under their breath).

Again, let me explain.

In college, did you write the perfect thesis in one pass and immediately hand it in? No (If you did, shame on you).

When a writer writes a novel, do they finish it in one sitting? No, it takes time to flush out the characters and prepare the drama.

I feel that coding is the exact same process (sometimes even with the drama!). There is no reason why you couldn't make a "first draft" with your code.

As you continue to write code, you'll start to notice patterns in your code. When you see those patterns, you need to refactor your code to make it more readable and understandable, just like a novelist would. They rewrite the section that doesn't make sense and make it clear to the reader.

This is the same process with writing code.

Conclusion

It's difficult to create something from nothing (which is why I like coding). However, if you create 80-95% of the code, even if it is crappy, you can go back and go into maintenance or refactor mode to make it a better, more readable system. Initially, writing the code is the hardest part.

You can't make a perfect system right out the gate. Mark Zuckerberg didn't create the ultimate Facebook immediately. It was an evolutionary process.

Refactoring is a way of life for developers writing code. Once you realize that the first line of code you write is imperfect, you'll be on your way to becoming a better coder.

Do you believe this? Post your comments below or Share this post!