Features from https://www.monkeyuser.com/

Bad Code is Better than No Code

hudbeard

--

Follow Me and clap for this article, It really helps.

Comment your opinion. What do you think?

Imagine this … you are starting on a brand new project and you are ecstatic about it. You have 1000 ideas running through your head a minute. You finally nail down which idea you are going to go with. It seems perfect and has no chance to turn out like your other projects, right? Excited, you sit down to write your perfect code and… and… you just sit there for hours, pondering the best way to write out this golden project.

How many times has this happened to you? How many times have you been so worried about writing the right code that you didn’t write any code? Personally, I have done this more times than I can count. This scenario comes from a programmer’s tendency to see bad code as something to be avoided at all costs. Oddly enough, this makes bad code even more prevalent.

For example… let’s say you have a deadline to meet with a company relying on you. Bad code isn’t an option. You need every second to meet the deadline, but instead you waste hours trying to think of the perfect code. This dramatically decreases your productivity. And now you are in a time crunch and have to write something down, which leads to, you guessed it, bad code.

How can we avoid this cycle?

The answer is to write bad code. This is both super obvious and counterintuitive.

Writing bad code and revisiting it is the key to great code.

No other time in life are you expected to write anything perfect on the first try. Why should code be any different? Authors create first drafts that go through many phases of editing. Graphic designers tweak their designs continually.

So, how would you fix the example above? When you sit down to write code, actually write code. Treat it like a rough draft. Just get something down. It doesn’t matter how terrible it is. Just write something. Then when you have finished a chunk, go back and refactor and revise it. This method will help you prototype faster and have a working project faster. In my experience, it is way easier to make your code as clean as possible after something is already written.

Bad Code is Good, but it is not Good Code

There is an important distinction here. I am not saying bad code is good code, I am saying that you should not be afraid of writing it.

“Better to do something imperfectly than to do nothing perfectly. “— Robert H. Schuller

Never be afraid to try things, even if it’s not the cleanest way. Everything can be fixed.

Conclusion

I hope you now see the benefit of trying and failing. Personally it has taken me a long time to fully understand this concept. This mentality has been a total game changer for me and I hope it helps you as well. See you next time. Happy coding!

Follow Me and clap for this article, It really helps.

Comment your opinion. What do you think?

--

--

hudbeard

Programming enthusiast interested in AI, 3d Modeling, and 3d Printing.