3 ms·
Because js is old and not well designed in the beginning. Its goal includes compatibilities so it's like old windows api that won't change any time soon, or eve
by gloryjulio 3y ago
Because js is old and not well designed in the beginning. Its goal includes compatibilities so it's like old windows api that won't change any time soon, or ever. Either use a strict subset or use typescript.
- kerkeslager 3y agoSure, except... How does one enforce a strict subset with an easy setup? Why are people writing non-browser code in this horrible language, often without strict subsets or typescript? Obviously there are solutions, but the solutions clearly aren't pervasive enough because the problem is still here (and growing, as more JS code is written), so we as an industry still need to keep talking about how problematic and poorly-designed JS is.
- gloryjulio 3y ago> How does one enforce a strict subset with an easy setup? The old solution are the good books like the good part. The new solution would be typescript. It's unlikely the API will get deprecated no matter how you talk about it. It's the windows of internet. Any sane shops would use typescript. U don't even need to write ts, and could just let the compiler do the hinting for you.
- kerkeslager 3y ago> It's unlikely the API will get deprecated no matter how you talk about it. Deprecation isn't what I want. Equivalent alternatives are what I want. I still can't do <script type='text/typescript'>. Why? And look, Typescript is also hampered by some of JavaScripts bad choices. Actor-model concurrency would be a really good way to handle events and parallelism to boot, but we won't get that in any language that compiles to JS. WASM isn't an alternative, because you can't use WASM without JS.
- gloryjulio 3y ago> I still can't do <script type='text/typescript'>. Why? Because typescript is not javascript. Google already tried with dart, they failed. Typescript is still nice-to-have, it's not replacing javascript. MS is not trying to replace javascript anyway. If your goal is to having javascript replaced, that looks fine but I don't see how it succeed. If you u want to work on TS codebase in backend, there is deno
- mdwalters 3y ago>> I still can't do <script type='text/typescript'>. Why? > Because typescript is not javascript. [...] Typescript is still nice-to-have, it's not replacing javascript. +1. TypeScript compiles to JavaScript, so it can't replace something it compiles to. Besides, text/typescript isn't even a valid MIME type. The text type is meant for plain-text documents (.txt, .md, etc.), so TypeScript would have been in the application type, following JavaScript (application/javascript). Getting TypeScript in a web browser would be too much work. For starters, they would need to take the TypeScript compiler, slap it into a web browser, where it would compile the TypeScript code, pass the result onto the JavaScript compiler, which would finally pass the result to the browser. Whats wrong with this? The code has to undergo two compilation layers, and, most importantly, the TypeScript compiler in the web browser can be out-of-date with mainline TypeScript releases. Your best bet right now is using a web framework with TypeScript support.