News for hackers. Stuff that matters.
Re:JSDoc is TypeScript by TheRealPomax on Tuesday December 16, 2025 @06:46PM (#46296351)
Welcome to the "a cat [1] has four legs [2], and therefore everything with four legs [3] is a cat [1]" fallacy. That's not how that works.

JSDoc is its own spec, and is not typescript, and is absolutely not at type annotation parity with typescript. Plenty of things that are hard to type in TS that are impossible to annotate use JSDoc.

So: just because tsc, the tool, can read in typing information that was written in JSDoc, does not make JSDoc typescript. tsc simply supports JSDOc. Very handy! Not the same thing in the slightest.

1. "typescript"

2. "can be read by tsc"

3. "anything that tsc can read"

Re:JSDoc is TypeScript by Sammi on Wednesday December 17, 2025 @02:47AM (#46299287)
You are mixing theory with practice. In theory felines can be both cats and tigers. In practice the felines walking around your neighborhood are all cats.
Re:JSDoc is TypeScript by TheRealPomax on Wednesday December 17, 2025 @11:58AM (#46302071)
...what?

No of course not, that's an absolutely ridiculous thing to say. Just because cats have four legs doesn't mean things with four legs can be "different kinds of cats", ∀A -> B does not imply ∀B -> A, it only means ∃B -> A.

Thinking about "still cats, just different kinds of cat" means you completely missed the point: what else has four legs? Dogs, or deer, or bears, but wait, there's more! What about tables or depending on how they're built, ladders? All valid. None of them even remotely related to cats.

Re:JSDoc is TypeScript by Sammi on Wednesday December 17, 2025 @05:23PM (#46306415)
Sure. In theory people could be doing that. But for the third time: what is happening in practice?

What people _could_ be doing vs what they _are_ doing was explicitly my point, so please stop pretending it wasn't, less we have to repeat this merry go round.

Re:JSDoc is TypeScript by TheRealPomax on Thursday December 18, 2025 @11:38AM (#46314972)
If the question is about whether JSDoc is TypeScript, and you want to turn it into a different question, maybe your question belongs in a different thread.

JDoc, the spec and docs-in-practice, is not TypeScript, the language and tooling ecosystem in practice, and does not have type annotation parity with TypeScript (so it's not even "the choice is arbitrary in practice because they do the same thing").

JSDoc is simply a supported spec by the TypeScript tooling. Saying "JSDoc is TypeScript" when you're a programmer, especially one that uses one or the other, is idiotic: your job relies on precision in both code and terminology.