Ten rules that Java developers need to know
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))