Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Ten rules that Java developers need to know

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article focuses on "Ten rules that Java developers need to know". Friends who are interested may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "Ten rules that Java developers need to know".

1. Annotate your code

Everyone knows this, but there will always be people who forget to abide by it. How many times have you forgotten to add comments? Without text comments, it helps to make the program functional. But again and again you go back to the code you wrote two weeks ago, and you can't remember what it is! You are lucky if you did write this unannotated code. Because it can jog your memory in that code. Unfortunately, most of the time the code is written by someone else, and he is about to leave the company! There is a proverb that goes, "do your own things." So for the sake of others or ourselves, add comments to your code.

two。 Don't complicate things.

Developers like to solve simple problems in very complex ways. We introduce EJBs to an application with five users. We complete a framework that is not needed by the application. We add the properties file, the target source scheme to applications that don't need these things. Why are we doing this? Some people don't know how to do it, while others do it deliberately because they want to learn something new and make us interested. For those who don't know how to do it, I suggest asking experienced programmers. For those who like to complicate application design, my advice is to deal with problems more professionally.

3. Remember-"less is more" is not necessarily a good thing.

Code efficiency is a very good thing, but in many cases writing a few fewer lines of code does not improve the efficiency of the code. Take a simple example:

If (newStatusCode.equals ("SD") & & (sellOffDate = = null | | todayDate.compareTo (sellOffDate) 0)) | (newStatusCode.equals ("OBS") & & (OBSDate = = null | | todayDate.compareTo (OBSDate))

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report