Developer Training
All engineers,
When writing code just follow this basic guidelines:
- Give logical and easy to understand function, variables and class names (if they become long names it’s fine)
- any function should not be more than one screen in height.
- division of responsibility: do not overload any function or class with too many responsibilities. Always keep refactoring code to divide the responsibilities in classes and function, every class and function should have only one CLEAR and limited responsibility
- never eat errors – means don’t write empty catch statements. If there is error throw it or log it but don’t silently ignore it in code
- always check inputs are exactly what is expected. Instead of just assuming the input or parameter is correct json. Validate it first and throw errors. Just because it is called by our code doesn’t mean we will always have valid inputs to any api/functions
If you follow this basic rules, it’s enough for now. Advanced class design etc can be learned and incorporated later.
Topics to read for UI developers:
- OOP – SOLID principle
- “This” in Javascript
- call (bind)
- Callback hell – Javascript
- Event Loop – Javascript
- Data Binding – Angular
SOLID OOP – for all devs
Separation of Concerns – another topic to read for everyone
0 Comments