1. 程式人生 > >Top 7 Node.js/TypeScript Tips for scalable back end development

Top 7 Node.js/TypeScript Tips for scalable back end development

1) Start with `strict: true` from the get-go. Looseness should be the exception, strong null checking is one of the great TS value.

2) Be function first, OO as needed. Don't try to mimic Java Class-for-everything coding style in TypeScript.

3) Take advantage of structural typing. Type with Interface & type over classes, avoid Class / Interface duos.

4) Export functions, types, and objects over classes and factories. Classes, when need, should often just be module implementation details.

5) Minimize Mock need (i.e. Kubernetes centric development), and favor module-alias over Class based DI.

6) Favor light and focused libraries / micro-frameworks, over all-in-one solve-it-all mega frameworks.

7) Keep it simple, SIMPLE SCALE BETTER