3 ms·
> This premise of many bugs being "type errors" is overblown and certainly very recent It really depends on whether your language is strongly typed or weakly t
by camus2 9y ago
> This premise of many bugs being "type errors" is overblown and certainly very recent
It really depends on whether your language is strongly typed or weakly typed. If it is strongly typed, then the runtime will catch type errors better, for instance if you try to add a string to a integer, it will yield an error. With Javascript it will yield nothing so bugs with accumulate and sometimes silently until the source of the bug becomes difficult to trace. Same for object properties. Let's say you expect foo.prop and you write foo.props . A strongly typed language would complain, JavaScript won't.
Some will argue :"Well duh, that's what testing is for". To an certain extent, and it might not catch type coercion bugs. Furthermore code bases with 100% code coverage are rare these days ...
> I speak from experience, having managed development teams for years. Junior coders need (and deserve) to be trained first doing stuff without hurry to allow for mistake, not used immediately or thrown into critical (or rushed) projects.
Juniors needs good tools in order to eliminate potential bugs. Static typing is one of that tool.
- flavio81 9y ago>Juniors needs good tools in order to eliminate potential bugs. Static typing is one of that tool. Yes, I agree fully with you, it is excellent for training. My only gripe is against that "15%" claim and its implications.