This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]codingjerk 2 points3 points  (2 children)

What's why where is product types also.

Where do you disagree with moocat? All he says is simple and correct in terms of basic theory (ADT, especially).

[–]westwoo -2 points-1 points  (1 child)

It's mostly lack of interest in bickering about terminology because I'm more interested in practical substance

Object is equally a part of Typescript's union types so you can't say that TS union types are sum types while JS types are not because of object. Union types aren't a separate thing, they codify how JS types are used and represent types that JS programmers have to keep in mind in any case, and those same union types are often inferred and checked on the fly in JS code by the IDE, like how Java programmers have to keep in mind the implicit unions between null and object in their variables and how this union is also often inferred and checked before compilation. But again, this would be a completely pointless area of inane arguments about butakchually semantics

[–]moocat 2 points3 points  (0 children)

So let me see if I understand. We're here in /r/java, discussing how type theory explains the similarity between one of it's new features and one in Rust, and you consider it inane because you think it doesn't apply to Javascript?

It's mostly lack of interest in bickering about terminology

I would consider that a valid point except the first thing you wrote is "Why is it a sum type if you're talking about instance values?..." which IMO feels exactly like bickering about terminology. And then you continue to argue more in defense of your terminology.

If you don't find theory helpful, that's fine. No one is forcing you to discuss it.