Re:Modern Javascript: Everything you missed over the last 10...
by layer8 on Saturday May 15, 2021 @05:07PM
(#27169030)
There is a reason for nominal typing though, because nominal types represent an interface contract that generally goes beyond just having the right type signature, but instead it is also about semantics. It's about the parts not covered by the type system, which the compiler therefore can't check. It depends on the kind of objects you are generally working with, but beyond pure data I find nominal typing preferable, because it makes it explicit that an implementation X conforming to interface contract Y is not just a matter of type signatures.
Re:Modern Javascript: Everything you missed over the last 10...
by eurasiantiger on Saturday May 15, 2021 @04:12PM
(#27168570)
Note that the upgrade pain with Java was not due to typing; rather, it was due to using a library directly instead of creating a class to interface with it. In other words, inadequate abstraction.
Re:Modern Javascript: Everything you missed over the last 10...
by hn_throwaway_99 on Saturday May 15, 2021 @09:28PM
(#27170448)
> Note that the upgrade pain with Java was not due to typing; rather, it was due to using a library directly instead of creating a class to interface with it. In other words, inadequate abstraction.
I'd look into what Jersey actually is before you say something like this, because what you've said really doesn't make sense.
Re:Modern Javascript: Everything you missed over the last 10...
by eurasiantiger on Sunday May 16, 2021 @09:02AM
(#27173426)
How so?
> I mean, this is a web-first language that has no concept of sending objects over the wire.. okay then.
I have no idea what you're talking about here. I use GraphQL with auto typegen of my TS types and I get typed data objects everywhere.
> TypeScript's generics system is cute, but I think it's mostly academic.
TBH this remark just makes me thing you really don't know much about TS. I use generics extensively, find them very helpful and are easy to use.
I'll give you the point on initial TS setup being non-trivial. Hopefully advances in tooling (things like Deno, which I'm not actually a huge fan of, or other projects like Rome) will make this easier, but even then I found this to be a "one and done" cost.