Clean code
It is not enough for code to work. ~Robert C. Martin
Any engineer can write code. What separates a good and bad one is the ability to write clean code, include sensible comments, and pass down their knowledge to future engineers.
There are many videos that document how to write clean code. However, we find that CodeAesthetic on Youtube does an extremely good job on how to write clean, concise code.
Here are a few videos from CodeAesthetic that we draw inspiration from.
TL;DR
- Don't write code that explains the code - explain why the code was written a certain way
- Variable names should easily identify the data stored in the variable
- Excessing nesting of loops should be avoided whenever possible
- Functions should only do one thing - type a specific type of input, and consistently return a specific type of output (or error if necessary)
Strict type checking
JavaScript and Python are, by design, dynamic languages, meaning that the types of variables can be changed at runtime. While this makes for great flexibility, it can cause drastic issues in a codebase that is meant to be robust.
To combat this, we use TypeScript, a superset of JavaScript, to enforce the types of variables at runtime. For Python, we use mypy, a static type checker, to combine the benefits of both "duck" typing and static typing without being too invasive.