eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.27k stars 721 forks source link

Coding standards for OpenJ9? #3954

Open babsingh opened 5 years ago

babsingh commented 5 years ago

Is there a document with coding standards for OpenJ9? If not, do we plan to add one?

Similar to OMR coding standards: https://github.com/eclipse/omr/blob/master/doc/CodingStandard.md.

Or are we supposed to refer to OMR coding standards? If so, should we explicitly mention usage of OMR coding standards here: openj9/doc/README.md? The current comment in openj9/doc/README.md doesn't indicate the location of CodingStandards.

📝 Developer documentation about OpenJ9 technology or components is best considered in tandem with the documentation from Eclipse OMR, as OpenJ9 is built upon the foundational technologies provided by OMR.

babsingh commented 5 years ago

fyi - @DanHeidinga @pshipton @tajila

DanHeidinga commented 5 years ago

Unfortunately, we don't have a single coding standard for the project. There are really 3 (?) different sets of code and each has somewhat different coding standards:

The VM section of the code base and the non-compiler parts of OMR have been developed by the same team and most of the code, especially the newer code, follows the OMR standard.

There isn't a defined standard for the Java code (that I'm aware of) but it follows many of the same simplicity principles as the OMR standard.

I'm not aware of a documented standard for the compiler component, thought @mstoodle or @fjeremic may know.

Adding a reference to the OMR standard from the readme and indicating that it applies to VM section of the code base is fine.

I'm not in favour of a protracted coding standard discussion or a push to reformat the entire code base - there are better things we can do =)

fjeremic commented 5 years ago

I'm not aware of a documented standard for the compiler component, thought @mstoodle or @fjeremic may know.

I don't think there is a written one. There was an attempt in https://github.com/eclipse/omr/issues/350 to standardize on something tool-driven but it never got anywhere.