logoalt Hacker News

ZiiSyesterday at 9:52 AM3 repliesview on HN

Why would I want to strip my types?


Replies

wildpeaksyesterday at 10:17 AM

Because it's a waste of bandwidth if they're not enforced at runtime, the same reason why minification exists.

show 1 reply
dminikyesterday at 11:07 AM

Maybe because TypeScript is not valid JavaScript (yet)? If you don't strip types, your code doesn't work.

1domyesterday at 10:08 AM

This feels like a ridiculous thread that captures everything wrong with modern Javascript ecosystem.

It's grown into a product of cults and attempted zingers rather than pragmatic or sensible technical discussions about what we should and shouldn't expect to be able to do with an individual programming language.

edit: to clarify, I assume there needs to be a basical level of comprehension of programming languages to debate the nuance of one, and if you can't think of a single reason as to why someone would want types removed, that's a possible indicator you don't have that necessary level yet, and I think the most effective way for you to learn that is to Google it. Sorry for coming across as rude if you genuinely don't know this stuff.

If you already know many reasons as to why types would be removed, then it seems disingenuous to ask that question, other than to make the point that you feel types shouldn't be stripped. If you think that, say it, and explain why you think they shouldn't be stripped.

show 2 replies