What's your opinion on type checking a language designed not to be type checked?

(Yes, JavaScript)

@celia A language not to be type checked should not exist. This is why javascript disgusts me so.

@celia I think it's generally a band-aid solution to allow one to more easily use a language for a purpose for which it was not designed (in the case of JavaScript/TypeScript, it's a band-aid solution to allow people to more easily build large applications even though JavaScript itself was not designed with this in mind).

I think it's a case of people trying to make a tool they like conform to every need they have instead of picking the correct tool for the job.

Granted, if I were building a large application and it had to be in a JavaScript-family language, I'd take type checking over no type checking any time.

@celia it's an awkward half-step since WASM will eventually be able to be compiled from any language

@celia I find the middle ground both useful and fun. Starting out as a C# developer and then learning TypeScript has been extremely enlightening, and I find I enjoy TypeScript more because you can use whatever style of programming makes sense for whatever situation you're in.

Need some dynamic behavior? Sure, go for it. Think you might have trouble maintaining a tricky portion of code due to dynamic typing? Fine, throw some type annotations in there.

@celia TypeScript's been a major boon for me.

That said, JavaScript was not designed to be type checked, which is different from being designed not to be type checked.

As a comparison: it wasn't designed to be linted either, but a linter is still a very useful addition too. (I often argue that TypeScript is just an advanced linter.)

Sign in to participate in the conversation

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.