R41D3NN
New Member
It has become more prevalent through Terasology's development that people are using some of their own conventions wherever they want. As such, code isn't consistent! There are even two different spellings for a handful of methods. It is not easy keeping up with that especially when there is no Javadoc attached to the code... I have started this topic in order to get a feel for what the general consensus is on conventions so please respond and I will attempt to draft some documented conventions that better suit the project at this point in time.
What is everyone's opinion of supporting 1.7?
More on this later!
- Field names should never begin with underscore. IE. no _instance or _name fields! If you haven't heard of the this identifier it might be acceptable, but that shouldn't be the case, especially when it isn't even used in that manner.
- The commonplace initialize method should be named either initialize or initialise, not both!
- A comment that extends beyond a single line should use the multiline comment feature. (Its nice for people with IDEs that fold elements and it makes code more readable.)
- Chaining methods can be better read if each scope is aligned at its . character. Its okay if there is more than one method call per line but just don't be excessive. If there are arguments in a method call then keep that on its own line.
I know this is a bunch of crap but it shows what I'm talking about:
Code:getSomething().getParent().getContainer() .setPosition(child.getX(), sibling.getPosition().getY()) .getNormal();
What is everyone's opinion of supporting 1.7?