Most math programming students never pay attention to the problem, must see!

Hello everyone, I am Yu PI. Recently, when I was helping some students to review their development projects, I found a very serious problem, that is, their code is very rough.

What is rough?

On the surface the project worked and the interface looked good, but when I looked at the code they had written, the quality of the code was low. Some people obviously write code and never read it themselves!

A few examples:

  • It’s tiring to write 10 or 20 lines of what one line of code can do.

  • The same code has to be copied and pasted several times, and some variable names have been pasted and forgotten to change.

  • Variable names are not standard, and even have Chinese names!

In fact, these are programming learners “common”.

Let me ask you three more questions:

  1. Do you read the code after you write it?

  2. Have you ever wondered what’s wrong with working code?

  3. Have you ever thought about improving your code?

I’m sure most of you don’t even think about that. You’re free to work on your own projects, and you just write code that works, regardless of the quality of the code, because no one else is looking at it.

Why write high-quality code?

It’s fine to write code on your own, but sooner or later you’re going to have to work, and if you continue to do this in team development, writing long, smelly, hard to understand and maintain will not only affect your productivity, but also drag down the entire team! Over time, your co-workers may never play games again.

Why? On the one hand, you need to fix your crappy code so you don’t have time to play games. On the other hand, I stopped playing games and hit you instead.

So why do more and more students who learn programming not pay attention to the quality of their code?

There are two main reasons: it’s not just that you write less code, it’s more that you read less code.

Most of you, like me, watched video tutorials or books to get started, and never looked at any other code. Most tutorials, however, just teach you how to write code that runs and makes you think, “Oh, my code works, I’m so happy, I’m so impressed!” . Therefore, many students think that writing code is learning to program, lower the requirements for their own, thus missing the awareness of “to write high-quality code”, and even feel that writing code seems not difficult.

You don’t even want to write good code, you can’t write good code!

Therefore, if you want to improve your programming ability and become an excellent programmer, you should always keep the awareness of improving the quality of your code, examine the possible problems in your code, and not be confused by the appearance of “all the good stuff on the outside”. Especially if someone thinks your code is bad, don’t jump in and take a good look at your code first.

So how can you intentionally improve your code? I can’t see the problem in my code. I think I’ve written it well. What do I do?

In the next article, Fishskin will share his habit of writing code that he has always insisted on, kneeling for a praise, let us see each other ❤️


Recently, I am still developing my programming navigation (www.code-nav.cn), a project to help you find programming resources, welcome to use!

How did I get the offer from Tencent, Byte and other big companies through self-study in college? You can read this article and no longer feel confused!

I learn computer four years, mutual encouragement! Co/q0mS) (t. 1 yb.