3 ms·
Javascript is a simple language. The weird syntax edge cases can be avoided using a well configured eslint. In my experience any complexity in application archi
by gbuk2013 5y ago
Javascript is a simple language. The weird syntax edge cases can be avoided using a well configured eslint. In my experience any complexity in application architecture is a liability (Java programmers writing Javascript is a painful memory, don’t get me started…).
Before async / await, exceptions were not used much because with asynchronous callbacks you can’t really use them (there was the domains thing but that was discouraged). With await you handle any exceptions locally. The global exception handler is really only for last resort - I would only use it for logging and some sort of graceful shutdown.
NodeJS is designed to be a black box unless you are writing native modules which is not common. There are some useful knobs for things like the thread pool and heap size limit but that’s pretty much it. Low level performance tuning was officially discouraged because behaviour can (and has) changed dramatically if the compiler changes (e.g. Crankshaft to TurboFan change several years ago). It is also typically not necessary: nodejs is usually used for network services where network latency trumps all. Electron apps are an interesting new use case where performance tuning might make a lot of difference (e.g. vscode vs atom).