7 ms·
You consider typing to be an over head? Do you really reuse variables within a scope to refer to different types? I feel like that would produce confusing to re
by devsquid 11y ago
You consider typing to be an over head? Do you really reuse variables within a scope to refer to different types? I feel like that would produce confusing to read and use code.
IMO dynamic typing is hard to work with and slows things down. "Auto-typing" or type inference like in Swift, Kotlin, or Dart is the most amazing thing ever. It gives you the safety of static types and the "speed" of coding of dynamic types.
- dietrichepp 11y agoI think the overhead here is the programmer time spent specifying the types in a program, which is why everyone loves type inference. This is a common communication error: when you read "typing" you think "static type system", but when the parent wrote "typing" it almost certainly meant "explicit type annotations".
- devsquid 11y agoNo I understand, which is why I think type inference is a much better solution than dynamic typing. I use Python and JS often and I am constantly looking up types of arguments for functions and what their return types is. JSDoc helps, but its pretty tedious. I think dynamic typing is much slower to actually code in.
- yesimahuman 11y agoPersonally, I agree with you that, once you know the type system, you're more productive with it. However, TypeScript is new, and can be difficult to transition to for some people. One example is dealing with some gotcha's like adding new properties to things like window: http://stackoverflow.com/questions/12709074/how-do-you-explicitly-set-a-new-property-on-window-in-typescript http://stackoverflow.com/questions/12709074/how-do-you-expli...
- deleted 11y ago[deleted]
- devsquid 11y agoIs the type system that different from Javascript? I remember looking at it back around 1.0 days and it seemed like basically the same as Javascript, which was one of the reasons I decided not to pursue implementing it in my work.
- fsloth 11y ago"I think the overhead here is the programmer time spent specifying the types in a program" There are different overheads on program structure and verbosity which goes way beyond type annotations, depending on the language used and the style of the particular developer. For example, in dynamic languages, a single container such as a list can contain any entities and functions can accept any entity as a parameter. Java and C# can achieve this same using just object handles - but in other statically typed languges one either implements several containers and functions, or uses or creates an algebraic datatype using the language native typing (i.e. Scala, F#, etc) or invents ones own which is then utilizes in the container signature or function definition.