News for hackers. Stuff that matters.
Re:Modern Javascript: Everything you missed over the last 10... by Jarwain on Saturday May 15, 2021 @03:52PM (#27168395)
The gp made this comment (https://news.ycombinator.com/item?id=27168048).

> This biggest "aha" benefit I get from TypeScript is that it is structurally typed, while Java is nominally typed. In my experience it has proven much easier to refactor in TS because I just need to ensure my objects have all the right properties. With Java if I have a Thing1, but a library is updated to add just a single new property so now there is a Thing2 type, well now then all the places I need a Thing2 I have to completely copy over from Thing1 - I can't just add the property and be on my merry way. This happened to me many times in my Java career - I still think I have PTSD having to do a Jersey 1.x upgrade to a Jersey 2.x version across a large codebase. It was a nightmare I've never had anything come close to with Typescript.

Not so much refactoring as upgrading, but tis an example of why duck typing is kinda nice

There are no comments on this comment yet.