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 analyzes "what are the good habits in Java programming?" The content is detailed and easy to understand. Friends who are interested in "what are the good habits in Java programming" can follow the editor's train of thought to read it in depth. I hope it will be helpful to everyone after reading. Let's learn more about "what are the good habits in Java programming" with the editor.
In the process of Java development and learning, the formation of some good habits is very critical. Today, we have sorted out some good habits that we should adhere to from the beginning of Java programming shared by our predecessors, hoping to give you some inspiration:
1. Standardize your code, have less personal style, more general rules, and learn to use CheckStyle tools.
In fact, everything we want it to be "automated". With the improvement of programming experience, you already know most of the programming specifications, but in practice, you always forget this and that. We want a tool to help us automatically detect whether our program conforms to the specification and is well structured.
In fact, any language has its own programming specification, which is very conducive to code reading and potential Bug risk reduction. For example, in Java, there are strict naming conventions:
For Class naming, there is a specification like this:
The class name should be a noun, mixed in uppercase and lowercase, with the first letter of each internal word capitalized.
Try to keep your class name simple and descriptive.
Use complete words-avoid acronyms and abbreviations (unless abbreviations are used much more widely than longer forms, such as URL or HTML).
The name of the class must be a noun and the first letter of each word should be capitalized. Make your class name as concise and clear as possible. Try to spell all words and avoid synonyms or abbreviations (unless abbreviations are more widely used, such as URL, HTML, etc.).
two。 It is better to have a long variable name than to make it too short to guess what it means.
3. Install two sets of input methods in the computer, turn off the Chinese input method completely when programming, and ensure that any shortcut keys will not convert it into a Chinese input method, so as to prevent confusion caused by similar Chinese symbols, such as:
English: () English: ()
A little mistake may make you spend an extra hour or two on meaningless things. Life is too short. Try to avoid low-level mistakes.
4. Avoid duplicating code as much as possible. if you need to use code at least twice, give it a separate class or function.
5. To avoid internal calls between classes (Cycle Reference) is to reduce the coupling of function modules. Calls between classes are only allowed through the interface, ensuring that when one class is changed, the others still work.
6. Read other people's excellent code more, compare other people's excellent code with your own code, learn from other people's strengths, and absorb experience.
7. Try to be a producer of content, try to write tutorials or notes and share them with the community, not just as absorbers of community content, but also to constantly produce content and give back to the community for help, such as answering other people's questions on StackOverFlow.
8. Keep your feet on the ground, but also look at what news has happened in the community, what new technologies and software releases, how these technologies and software will affect your development work, whether there are better alternatives to the IDE or Editor you are using, and so on.
9. When you don't have a task, don't be idle, develop something you like, challenge yourself and gain experience.
10. Don't rely too much on tutorials, learn to read the official documentation. Everything that can be made into a tutorial is often out of date, the latest technology, the latest released standards, often there are no ready-made tutorials, you need to read the official documents carefully, where the things are the most authoritative.
11. Don't take part in the debate about whether the language is good or bad. People tend to like the language they use proficiently and use more, just like whose girlfriend is beautiful. I certainly think my girlfriend (although null) is the most beautiful, but others don't think so.
twelve。 When you have a need, often others also have this need, and often have corresponding tools to solve your need, for example, you want to visualize the function call relationship and make it into a tree diagram, such tools already exist, such as SourceInsight (paid), Source Navigator (free) and so on.
13. Less in the domestic XX software park to download a variety of cracking software, pirated software, etc., these software parks in order to make a profit, you will quietly install a bunch of other rogue software, 360 bear the brunt of these junk software, delete the cleaner the better.
14. For your development computer, the CPU can be worse, but the memory had better be larger. At least 8 GB is recommended, or even 10 GB is recommended to go up. You often need to open a bunch of browser pages and an IDE or even a bunch of other tools at the same time. If you have done Android development, AndroidStudio can easily call your computer's 2-3G memory. The average 4G computer must be unbearable, seriously reducing the development experience, but it does not allow you to change computers. Find out about the memory slip.
15. Maintain a healthy, clean computer state, the file storage in the hard disk should be adjusted, it is easy to find specified files, reduce the probability of file loss, and speed up the search for files.
16. If disk C is almost full, you can send the space of other disks to disk C through Disk Manager.
About the good habits of Java programming which are shared here, I hope the above content can make you improve. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!
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.