How to Deal With Bad Coding Habits—And Write Cleaner Code?

Do you know the following problem: you know you should write cleaner code—but you don’t actually do it.

My biggest struggle with Python so far is building good habits. Examples: To build an object model when it is warranted instead of trying to run functional code. Start with comments. Learn to use automatic testing.

Niklas — Finxter Email Course Member

Most likely, you simply need to study more, improve your skills to a level where you cannot help to write better code, and seek interaction with professional developers. They will never accept bad coding habits without telling you about them. By interacting with others, your bad habits will vanish quickly.

Watch the video to learn a few simple techniques that will solve this problem:

Let’s summarize the ideas discussed in the video. How to develop better habits and write better code?

  • Read more code (for example, solve Python puzzles daily).
  • Write more code yourself (for example, start with those 10 practical projects).
  • Make your code public (for example, publish all your code at Github).
  • Be active on coder forums (for example, ask and answer questions on StackOverflow).

By completing these four steps, you’ll be able to overcome your bad habits.

Where to go from here?

Want to learn more about habits? Read the following blog article about the #1 coding habit you should implement today.

Also, check out the article 5 habits of highly effective coders.

If you use to procrastinate in coding, feel free to skim over this article.

Leave a Comment

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