In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces what the coding rules of NASA have, which can be used for reference by interested friends. I hope you can learn a lot after reading this article.
# 1. Avoid complex process constructs, such as Goto and recursion
If recursion doesn't need to perform simple tasks that for can do, I won't use recursion. In places where you can't access the machine directly, such as on Mars, the moon or the bottom of the sea, recursion is very dangerous!
# 2. All loops must have fixed boundaries (this prevents code confusion)
Similar to the first rule, I will use a fixed range of loops to prevent infinite loops or code confusion.
# 4. Limit the function to a single printed page
Reducing the length of the function to one page makes it easier to master all the functions of a specific routine of the program.
If you exceed this length, you have added too much redundancy to your code.
Another problem may be that you don't split the function into smaller functions to prevent code duplication.
# 6. Limit the range of data to a minimum
If you are using JavaScript, never use var-always like to use let to prevent variable leakage or overwriting, or even ghosting.
Other languages should do the same, such as c #. Use the most protected and minimal scope for variables, such as private or protected.
Such rules should be followed for other languages, such as C #. Use maximum protection and minimum scope for variables, such as private or protected.
# 10. Compile all possible warning activities; all warnings should be resolved before the software is released
With JavaScript, you will not be able to compile the code, but you can easily use ESLint or similar tools to get warnings from the code.
Then, even if you think they are useless, you should delete them and fix them. Now we are ready to launch our code to Mars!
Thank you for reading this article carefully. I hope the article "what are the coding rules of NASA" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.