――Now, the tenth article that you can just write as a letter that you are using it as a matter of course. ――The adult behavior that stretched beyond the limit, saying, "I never conceit the tenth bullet, which is a very happy number, and just work hard every day." ――I can't see the concept of age anymore in the self-satisfaction paranoia of "I mean, did you do so much fantasy clinging work, which is called jumping this time?" ――OK. This time, let's write what I should have known after joining the company.
―― "Convention" ... I was careful only about the basic naming of classes, methods, variables, etc. ―― “Method” ・ ・ ・ From the learning stage, I didn't consciously describe it, and I thought it would be good if I could understand the meaning.
→ In team development, etc., the description lacks uniformity and readability, causing a great deal of inconvenience.
――Re-learn from the basics about rules and practices in books and online. --Check the human code while looking at sample programs and open source projects.
「OK」
String firstMessage = "Hello";
String secondMessage = "I'm Bob";
String thirdMessage = "Bye";
「NG」
String message = "Hello";
String MESSAGE = "I'm Bob";
String Message = "Bye";
--The name is an easy-to-understand name. --Names should be singular.
「OK」
package lang.java.hello;
package lang.java.name;
「NG」
package lang.java.Hello;
package lang.java.names;
「OK」
package lang.java.infomation;
「NG」
package lang.java.info;
--The order of description is as follows. --Java standard class API --Global (famous or commercially available libraries) --Local (in-house or project library) --In many cases, alphabetical order
「OK」
class SubmitAction {
}
「NG」
class Test1 {
}
--Capitalizing the beginning of each word is called "capitaliza". --The capitalized character string format is called "Pascal format". → Also known as "Upper Camel format".
「OK」
class TwitterApiClient {
}
「NG」
class twitterapiclient {
}
「OK」
class TwitterApiClient {
}
「NG」
class TwApiCli {
}
「OK」
abstaract class AbstractShowController{
}
class ShowController extends AbstractShowController{
}
「NG」
abstaract class MainShowController{
}
class showController extends MainShowController {
}
「OK」
class TestObjectException extends Exception{
}
「NG」
class TestObjectError extends Exception {
}
「OK」
public String toString(){
}
「NG」
public String test2(){
}
--The first word starts with a lowercase letter. --For multiple words, capitalize the beginning of each subsequent word.
「OK」
public String showInfo(){
}
「NG」
public String showinfo(){
}
「OK」
boolean canRemove()
boolean checkChange()
「NG」
boolean setName()
boolean isRemove()
「OK」
startDate
endDate
maxPrice
minPrice
「NG」
a
num
str
「OK」
boolean canRemove;
boolean checkChange;
「NG」
boolean isRemove;
boolean name;
--In the example below, if there is a component called "Button".
「OK」
Button cancelButton = new Button():
「NG」
Button cancel = new Button():
「OK」
static final int MODE = 7;
static final string COUNTRY = "JAPAN";
「NG」
static final string country = "JAPAN"
「OK」
static final int EDIT_MODE = 1;
static final string MY_COUNTRY = "JAPAN";
「NG」
static final string myCountry = "JAPAN"
――This time, I will write an article while remembering the time when there was no concept of "unity / readability" in group development that also served as learning by grasping Java coding standards. ―― “It's important that there are some restrictions and ethics in everything,” says a man who writes articles that do not feel unified or readable at all. ――When I made an artificial statement of determination, "Let's continue to write with unity and compassion," I started preparing for the second writing.
Recommended Posts