3 ms·
Do you have any good reading to learn about avoiding those pitfalls with node?
by jeromegv 12y ago
Do you have any good reading to learn about avoiding those pitfalls with node?
- notduncansmith 12y agoI wish I did. I can say that watching a lot of Rich Hickey's talks and Gary Bernhardt's Destroy All Software screencasts have made me a better programmer in general, and that has carried over into my Node development practices. Here's a few nuggets that will help you: - Use promises instead of callbacks, specifically Q. Don't let anyone tell you the performance will hurt you - I guarantee that promise execution time is not your bottleneck. - Use event listeners for things like kicking off email notifications. - Use Mandrill for sending those emails. - Use promises. - MySQL is still good tech. - Use Sequelize to make using MySQL/Postgres not hurt. - Abstract into middleware when you can. - Bogart > Express. - Use promises. - Use dependency injection (Omni-DI is a good library for this). - Route handlers are for orchestration, not core business operations. - Avoid for loops. Prefer Array methods like forEach, map, reduce, and filter. - Use promises. I plan on doing more writing about this sort of thing when I have time.