4 ms·
Why do you think protective equipment is required in some professions? Is it because workers don't know their job? Anyway, explicit static typing 1. detects e
by augustk 6y ago
Why do you think protective equipment is required in some professions? Is it because workers don't know their job?
Anyway, explicit static typing
1. detects errors at compile time
2. provides documentation
3. makes programs run faster.
- cryptica 6y agoProtective equipment is typically used to protect people, not products. 1. Tests detect errors at runtime. Typing is completely redundant when you have even half-decent tests. 2. Comments, good variable and function names provides documentation too. 3. Not really. TypeScript is not faster than JavaScript for example. Even in certain cases where they are faster (e.g. comparing C/C++ with JavaScript), the max speedup is typically less than 40% in the absolute best use cases.. For the average case (typical program) the speedup is typically insignificant (like 5%, 10%...). Also, static types don't stop people from writing inefficient algorithms. On the other hand, statically typed languages with a build step slow down the develop/test iteration speed. In the case of TypeScript, transpilers add complexity to the project in many ways including compatibility issues (since now you have to worry about not just Node.js or Browser version but also TypeScript version and the different permutations)... Source mapping doesn't work right in certain environments. The output often looks mangled and is hard to debug in a constrained remote environment. Takes more time to setup. Adds many unnecessary dependencies to your project. Makes your software harder to integrate by third-parties since your schema is more rigid and might not correspond with their own type system. They encourage developers to define complex function signatures with complex interfaces and encourage passing instance references instead of simple copy-by-value primitives.. The drawbacks are significant and I could keep listing them all day.
- deleted 6y ago[deleted]