The most important thing when writing code

I have 7 years experience in writing code. It's not the thing I knew about it in an early time, I gradually found that what's the most important thing when writing code.

Just want to share with you:

  • Keep your mind clear, the best thing to do is to write an article about your code before you write the code.

What are you going to do? Just like an article, I'll get up in the morning first, wash my face, brush my teeth, have my breakfast, blah blah blah...

  • Keep your mind clear about the big picture, and then dig into details about "how to get my breakfast? Maybe cook it my self, or buy it in a store, etc."
  • Sometimes, if you don't get your mind clear, you'll get lost in the details, and found yourself in chaos switching between the high-level and details.
  • Translate your article to a bunch of high-level functions or classes. And it's easier to do the test-driven development in this way.

That's what I found from my experience. Get your mind clear, much faster and fewer bugs.

你可能感兴趣的:(The most important thing when writing code)