|
|
|
|
|
by z3t4
4035 days ago
|
|
I used to argue for type decorations, like in most C like languages, but then changed my mind. When programming in a high level language like JavaScript, you should not think about types. Thinking about types will only limit your creativity and problem solving. Instead, you should focus on the logic abstraction. Also you shouldn't lock yourself into classifications. Instead, just check the input and throw an error if it doesn't fit. |
|
I really don't see the gain here - instead of delegating the typechecks to a tool, the compiler you clutter your code with them. You still have to think about the types, functions/methods (public ones) start with at one, two or more ifs and you even have a hit on runtime perfomance.