About Alibaba Java Coding Guidelines

Introduction

I came here because I had the opportunity to write a blog on Qiita for the first time! Currently, I have two technical weapons, Java and Alibaba Cloud. And I wanted to combine these two and write something. There are various things, but this time I would like to introduce a little about Alibaba Java Coding Guidelines. why? I want to make my code more beautiful!

What are Alibaba Java Coding Guidelines?

Best programming practices within Alibaba's technical team over the years. Different Java programming teams program according to the same rules to improve code quality and promote mutual reuse and understanding of programs.

This Guideline has been published on GitHub for use by other programmers, and is currently marked with a little less than 20,000 ★. I am. It is also being updated. However, this document is currently available in English and Chinese. master /% E9% 98% BF% E9% 87% 8C% E5% B7% B4% E5% B7% B4Java% E5% BC% 80% E5% 8F% 91% E6% 89% 8B% E5% 86% 8C % EF% BC% 88% E5% 8D% 8E% E5% B1% B1% E7% 89% 88% EF% BC% 89.pdf) only exists. Make a note of the structure of the article below.

This Coding Guideline can be divided into the following 5 categories.

  1. Programming specifications
  2. Exceptions and logs
  3. MySQL specifications
  4. Project specifications
  5. Security specifications

Each specification is divided into three levels.

  1. Required
  2. Recommended
  3. Reference

Details are as follows. [Description]: Description [Correct example]: Coding and implementation are approaching, and explanation of recommendations [? ] [Counterexample]: Precautions and actual error cases


Concrete example


Programming specifications

Naming convention

[Required] Constant variable names must be capitalized and delimited by underscores. The name of each constant variable must be semantically complete and clear.

Normal example: MAX_STOCK_COUNT

Counterexample: MAX_COUNT


You can read the documentation and compare it with your own code, but you can also check the code with the plugin below. (I was pretty angry when I used it in my code) ● PMD implementations ● IntelliJ IDEA plugin ● Eclipse plugin

test

Alibaba Cloud Academy has an exam for Alibaba Java Coding Guidelines. You can read the documentation and test your knowledge. The exam is free and you will receive a badge if you pass.

The link for the exam is here

in conclusion

This best programming practice can be very helpful in improving the quality of your code. Avoid potential code errors and be able to write the best code!

** Especially me! ** **

Thank you for reading to the end.

Recommended Posts

About Alibaba Java Coding Guidelines
About Java interface
[Java] About Java 12 features
[Java] About arrays
[Creating] A memorandum about coding in Java
Something about java
Where about java
About Java features
About Java threads
[Java] About interface
About Java class
About Java arrays
About java inheritance
About interface, java interface
Java coding conventions
About List [Java]
About java var
About Java literals
About Java commands
About Java log output
About Java functional interface
Java, about 2D arrays
About class division (Java)
About [Java] [StreamAPI] allMatch ()
About Java StringBuilder class
[Java] About Singleton Class
About Java method binding
[Java] About anonymous classes
[Java Silver] About initialization
About Java Array List
About Java Polymorphism super ()
About inheritance (Java Silver)
About Java String class
About Java access modifiers
About Java lambda expressions
About Java entry points
About Java 10 Docker support
[Java] About enum type
All about Java programming
About java abstract class
What I researched about Java 8
About an instance of java
What I researched about Java 6
About Java variable declaration statements
What I researched about Java 9
[Java] About try-catch exception handling
About Java class loader types
[Java Silver] About equals method
[Java] About String and StringBuilder
What I researched about Java 7
About Java class variables class methods
About Java Packages and imports
About abstract classes in java
[Android / Java] Learned about DataBinding
What I researched about Java 5
About Java static and non-static methods
How about TECH ACADEMY ?? [Java course]
[Introduction to Java] About lambda expressions
About fastqc of Biocontainers and Java
About Lambda, Stream, LocalDate of Java8
[Introduction to Java] About Stream API