3 ms·
This you will need to explain. :o What kind of griefs static typing is giving you?
by rq1 7y ago
This you will need to explain. :o
What kind of griefs static typing is giving you?
- benatkin 7y agoIt changes the order in which I think about solving problems, to something I'm less comfortable with.
- Koshkin 7y agoThat's understandable - being pestered with error messages early on is not to everyone's taste and can indeed interfere with one's creative process. But can't one always start with JS and switch to TS later?
- rq1 7y agoIsn’t it preferable to start with data modeling? You can disagree but: > Rule of Representation: Fold knowledge into data, so program logic can be stupid and robust. http://www.faqs.org/docs/artu/ch01s06.html#id2878263 http://www.faqs.org/docs/artu/ch01s06.html#id2878263 Statically and strongly typed languages excel exactly at this.
- ajxs 7y agoIs that really true though? To me this sounds more like making the validation of the program an afterthought, at best. Even in very academic mathematical models, introducing types early usually doesn't introduce much of a cognitive burden. I maintain that even when developers don't think that they're reasoning in terms of types, in many cases they are: "This is function 'x'. It takes two items of type 'T', which have to have a member 'a', which is a number. Function 'x' multiples the two 't.a' values together and returns a new 'T' with the result in its 'a' field." If you opted to forego static typing, every step of the above function would require you to validate that you're dealing with the types you think you are. This kind of example isn't even at all uncommon.