Coding - Nice Code Cheat-Sheet – Our 22 Commandments

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.

  1. STR + ALT + L (Code → Reformat Code) is your friend
  2. A method without annotations is a lonely one
  3. A (public) method without an unit test is a jump into the deep end
  4. Your colleagues thank you for meaningful class, method and parameter names
  5. With more complex methods, comments are more welcome
  6. Any code inspection problem more severe than “typo” is to be avoided in newly written code
  7. Unit tests should only test the code affected in the test case and be as independent as possible from other code (mock again)
  8. If a mock in a test case has grandchildren (mock of mock of mock) this cries out for refactoring of the tested code
  9. Before changing tasks, having a delicious lunch or a cool after-work beer, always push a commit with a running development state!
  10. Git doesn’t like unversioned code-commit, commit, commit (and push)!
  11. Each partial solution to a task is a commit.
  12. If your working device dies, you should not lose more than one screen of code. Otherwise, this calls for a commit (and push).
  13. A week without pair programming is acceptable only on vacation or during curfews.
  14. There are no stupid questions, only stupid answers!
  15. Static methods can only be unit tested to a limited extent!
  16. A class has no public properties; only getters and setters!
  17. 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.
  18. 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!
  19. A bug, problem, feature, task – or whatever – doesn’t exist without a ticket!
  20. Have you posted the time spent on the last commit in the ticket yet?
  21. Four eyes see more than two
  22. 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.