mirror of
https://github.com/RustyRaptor/decisions.git
synced 2026-12-03 15:25:15 -07:00
1.3 KiB
1.3 KiB
Style Guide
-
No lines longer than 120 columns. Try to keep it at 80 columns if you can.
-
Every method should be described in a Javadoc string.
-
Explain your code in comments with clarity.
- Someone who has never seen it before should know how it works.
-
variables, and method/function names should be lowerCamelCased likeThis pleaseAndThankYou
-
Class names should be UpperCamelCased LikeThis PleaseAndThankYou
-
When printing to the screen for the player please avoid using straight up
System.out.printlines.
- Create an intelligent method that takes the text you want to print and displays it elegantly.
- This method of course can use
System.out.print - When constructing multi-line and complex strings to display use the
StringBuilderclass.
- Do not litter our nice code with unnecessary trash comments at the end of every block like
//end if//end for//end while- I don't know why some classes teach this garbage.
- It is an arcane practice and has no place in modern code. Drop the habit today.
- Make use of the many intelligent Java data types when appropriate to simplify our code.
- One common example is to use
ArrayListinstead of regular arrays when having a fixed size and position array isn't the goal.