The nicest Code Cheat-Sheet for the nicest of Developers
In Nice Code Valley there are not many rules. BUT: The “22 Commandments” must be mastered in our sleep.
- STR + ALT + L (Code → Reformat Code) is your friend
- A method without annotations is a lonely one
- A (public) method without an unit test is a jump into the deep end
- Your colleagues thank you for meaningful class, method and parameter names
- With more complex methods, comments are more welcome
- Any code inspection problem more severe than “typo” is to be avoided in newly written code
- Unit tests should only test the code affected in the test case and be as independent as possible from other code (mock again)
- If a mock in a test case has grandchildren (mock of mock of mock) this cries out for refactoring of the tested code
- Before changing tasks, having a delicious lunch or a cool after-work beer, always push a commit with a running development state!
- Git doesn’t like unversioned code-commit, commit, commit (and push)!
- Each partial solution to a task is a commit.
- If your working device dies, you should not lose more than one screen of code. Otherwise, this calls for a commit (and push).
- A week without pair programming is acceptable only on vacation or during curfews.
- There are no stupid questions, only stupid answers!
- Static methods can only be unit tested to a limited extent!
- A class has no public properties; only getters and setters!
- The same functionalities in different classes cry out for a common interface. A suitable trait is happy to help with the implementation in a class.
- Each faulty application of a method is an exception and should not be suppressed or concealed. Such errors are then very sly and hard to catch – exceptions are loud and easy to catch!
- A bug, problem, feature, task – or whatever – doesn’t exist without a ticket!
- Have you posted the time spent on the last commit in the ticket yet?
- Four eyes see more than two
- No pushing into the main branch at the following times: Friday before weekend, last day before vacation or similar.
If you think you master our 22 commandments, want to become part of a highly motivated team and be surrounded by the best possible working environment, you can start packing your bags to become a part of Nice Code Valley.