3 ms·
Like others, my experience was also complete opposite. The app I did was a financial related app so we do some good amount of number crunching. From calculatio
by westoque 9y ago
Like others, my experience was also complete opposite.
The app I did was a financial related app so we do some good amount of number crunching. From calculations, to transfers, and storage.
You won't believe how many type errors we had throughout the stack. It's definitely because of JavaScript's inability to do type checking.
One workaround people did was to do the type checking in the first few lines of the function call, which is how people that still do raw JavaScript, do it today.
function add(a,b) {
if (typeof a !== 'number') { ... }
if (typeof b !== 'number') { ... }
return a + b;
}
This eventually creeps throughout in the code and introduces this code smell.
This above can be solved by just using TypeScript.