当前位置:网站首页>99% of the students can't write good code because of this problem!

99% of the students can't write good code because of this problem!

2022-06-24 12:33:00 Programmer fish skin

Most students of mathematical programming never pay attention to the problem , Must see !

Hello everyone , I'm fish skin , Recently, I helped some students to see their projects , Found a very serious problem , That is, their code is very Rough .

What is rough ?

Is refers to : Although on the surface, the project can run , The interface effect is also pretty good , But when I looked at the code they wrote , Found that the quality of the code was very low . Some people obviously write code after I haven't read it once

Take a few examples :

  • 1 Lines of code can complete the function to write 10 That's ok 、20 That's ok , I'm tired .
  • Copy and paste the same code several times , Some variable names have been pasted and forgotten to change .
  • Variable names are not standardized , There are even Chinese names !

Actually , These are all for programming learners “ Common failing ”.

Let me ask you three more questions :

  1. Will you read the code yourself after you write it ?
  2. Have you ever wondered what might go wrong with the code that works ?
  3. Have you ever thought about improving the quality of your code ?

I believe most of the students haven't considered these at all , When you do the project by yourself, feel free , The code you write will run and be done , I don't care about the quality of the code , No one's watching anyway .

Why write high-quality code ?

It's OK to write code by yourself , But sooner or later you have to work , If you keep this bad habit in team development , The code is smelly and long 、 Difficult to understand and maintain , It will not only affect their own development efficiency , And bring down the whole team ! in the course of time , Maybe your colleagues will never play games again .

Why? ? One is to change your bad code , There is no time to play games ; On the other hand, instead of playing the game, I beat you .

So why do more and more students who study programming not pay attention to their own code quality ?

There are two main reasons : It's not just because there's less code , More of it is due to less code .

Most of my classmates must be the same as before , First watch the video tutorial 、 Or books to get started with programming , I haven't seen any other code . however , Most tutorials will only teach you how to write code , Make your code run , It makes you feel “ Oh dear , My code is working , How happy , How wonderful !”. therefore , Many students think that writing code means learning to program , Lower your demands on yourself , Thus missing “ Try to write high-quality code ” The consciousness of , What's more, it seems that writing code is not difficult .

Never thought about writing good code , Only when you can write high-quality code can you see the ghost !

therefore , Want to improve their programming ability , Become a good programmer , It is necessary to maintain the awareness of improving code quality at all times , Look at possible problems in your code , Can not be “ Gold and jade are among them ” Confused by the appearance of . Especially when others question your poor code , Don't hurry up with a hammer , Take a good look at your code first , Rational treatment .

So how to improve your code quality intentionally ? I can't find any problems in my code , I thought I had written very well , What do I do ?

below In the next article , Fishskin will share the habit of writing code that he has always adhered to , Kneel down and beg for one Fabulous , Let's see each other ️


I'm still developing my Programming navigation https://www.code-nav.cn ), A project to help you find programming resources , Welcome to use !

Various programming resources

How did I teach myself in college , Get Tencent 、 Byte and other big factories offer Of , You can read this article , No more confusion !

I studied computer for four years , Mutual encouragement !https://t.1yb.co/q0mS

原网站

版权声明
本文为[Programmer fish skin]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/05/20210531214549575n.html