Skip to content
janimattiellonen edited this page Nov 22, 2012 · 2 revisions

Tests

If possible, write tests and then some more. Unit test powered code is so much easier to work with, change, refactor - without the fear of breaking something somewhere not knowing about it.

Documentation

Document your code using doc blocks. Don't over-comment. For example, if method name is getUsername() then there is no need to add a comment like "Gets the username".

Commented code

Don't. Ever. Leave. Commented. Code. Behind! It confuses people.

Keep your code DRY

Don't Repeat Yourself. If you see yourself copy pasting code, refactor it somewhere, where it can be re-used.