In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what are the harmful programming habits of web development projects". In daily operation, I believe that many people have doubts about the harmful programming habits of web development projects. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "what are the harmful programming habits of web development projects?" Next, please follow the editor to study!
1. Spelling mistakes
What surprises me is why people still let this habit run rampant in the code, so that there are often misspelled variable names and function names. What is even more tragic is that misspellings are often well hidden and difficult to find.
As for solutions, you can write code in a good integrated development environment (IDE), or simply use a programmer-specific text editor, which can significantly reduce spelling errors. You can also choose specific variable names and function names, which are easy to spell on the one hand and easy to find even if you make a mistake. Try to avoid using words that are easily misspelled, such as "receive". It is easy to spell "recieve".
two。 Did not write the code in the prescribed format
Indentation and formatting make our code clear and easy to understand at a glance, as well as any errors. But also convenient for others to understand and maintain.
If you are using IDE that does not automatically format the code, consider using code beautification software, such as Uncrustify, which allows users to customize formatting requirements, and then it will be meticulously executed.
3. Code is not written in accordance with the prescribed modularization
The habit of a function corresponding to an instruction is quite good, because it is short, so it is easy to understand and maintain. Long functions have too many possible paths to implement, so testing is particularly troublesome.
* * guidelines: a function can only occupy at most one display screen space. Second: if there are more than 10 if statements or loop statements, then you can consider rewriting.
4. Over-reliance on IDE
There is no doubt that IDE and other tools can make your code written quickly and well. To a certain extent, they can provide variables and many other things, giving you a variety of options for what you want to enter. But this type of tool also carries risks-if you can't make sure you have a good eye, it's easy to mistakenly choose similar variable names. In essence, such tools replace part of people's thinking, but in fact it is your own responsibility.
Tools are indeed good helpers for us, such as eliminating spelling mistakes and improving productivity, but if you are not careful, you will also have the problem of writing wrong code.
5. Use hard-coded passwords
Many people tend to hard-code a secret account and password so that they can freely access the system. But it's not right-yes, it's a great convenience for you, but it also makes it easier for others to access your source code.
The reason is that hard-coded code is more fragile than you think, which makes it a huge security hazard and a security hazard that is difficult to repair.
6. No good encryption measures are taken to protect data.
Sensitive data needs to be encrypted when transmitted over the Internet, because it is likely to be intercepted in the process. Don't complain about trouble, this is the most basic safety requirement.
This also means that it is not acceptable to send data in clear text, and it also excludes us from using our own encryption and confusing the target. It's hard to write a secure encryption system-- just look at wep-- so we might as well use a proven standard encryption library.
7. Optimize the code prematurely
Donald Knuth, a legendary programmer, once said, "programmers spend too much time thinking about and worrying about the progress of unimportant parts of the program, because these actions have a strong negative impact on efficiency, especially if debugging and maintenance are also taken into account."
Programmers who are good at writing code do make the code run faster and smoother, but later debugging and maintenance become more difficult. Provide a good strategy: after writing the code clearly, look for areas that really need to be optimized to improve performance.
8. No advanced thinking.
What is the goal of the project? How big is the expected scale? How many users will there be and how fast will it run? At first glance, these questions seem to have nothing to do with us programmers-but if we don't think about them, how can we correctly choose the framework for developing applications to meet these requirements?
Twitter has examples of failures in this respect because it underestimates future requirements, resulting in it having to abandon Ruby on Rails and rewrite a lot of code using Scala and other technologies, because the Ruby code originally used for the architecture simply cannot keep up with Twitter's fast-growing user base.
9. Thought that the increase of manpower would speed up the progress.
Almost all software projects are behind schedule. Some people will say, "there are many people and great strength, and if I fall behind, won't I be able to keep up with the progress if I add manpower?" It sounds beautiful, but the fact is that almost all projects have a "clotting reaction" after the addition of "fresh blood"-the overall efficiency is not up but down.
10. If you don't correct your mistakes, add to them.
Then point 9 above, some people will say, since I can't add more people, I can always catch up with the schedule. Let me give you a word of advice, don't have such illusions. If you are far behind schedule, your estimate of the project time is wrong. Instead of blindly insisting on making a mistake, make a new estimate of the project time as soon as possible.
At this point, the study on "what are the harmful programming habits of web development projects" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.