3 ms·
That would be part of it, but since was talking about inability to think in types I suspect they were taking aim more at things like excessively stringly-typed[
by dodobirdlord 7y ago
That would be part of it, but since was talking about inability to think in types I suspect they were taking aim more at things like excessively stringly-typed[0] code.
[0] https://devcards.io/stringly-typed https://devcards.io/stringly-typed
- JMTQp8lwXL 7y agoI do a lot of TypeScript these days. It's possible to define a type which equates to one or more literal string values. The TypeScript compiler will complain if you try and supply an invalid string parameter. So --at least for TypeScript-- I think this is less of a concern than in the past (and TypeScript is growing in popularity within the JS community). In a more general sense, I agree with the author that the 2nd code sample offers additional clarity.
- nemetroid 7y agoThat sounds like a type that holds a string, which is just what the article suggested to use.
- JMTQp8lwXL 7y agoWhich, prior to TypeScript, wouldn't have been an option. The ever-evolving front end ecosystem!