3 ms·
I completely agree with you. I once use JSdoc instead of Typescript for a small project. Typing works as good as Typescript on VS Code.
by Madeindjs 6y ago
I completely agree with you. I once use JSdoc instead of Typescript for a small project. Typing works as good as Typescript on VS Code.
- keyle 6y agoThis! I found it far more productive that going through rabbit hole of TS and its compiler. I write my `definitions.d.ts` for my objects, and use them simply /** @type {ns.MyType} identifier */ const identifier... and voila, my IDE gives me auto-completes and warns me when I'm doing silly stuff. It works for functions as well using /** @param {type} parameter name */ and is generally a good idea to use. It gets you 80% of the way there with no compiler/transpiler (although one might argue that the IDE is compiling non-stop on file saves, with its language server). I embraced Typescript when it was new and the Javascript standard was a total mess. It was leaps and bounds ahead and closer to something like AS3. At the time TS was godsend. Today, JS + webpack gets you really far using the latest ECMAscript standards. Same with IDE. The amount of stuff my IDE can deduct based on my few typings and my use of modern strict javascript has strongly reduced the need for another transpiler (on top of webpack). I found jsDoc to be a perfect 80-20 solution. Because at the end of the day, TS isn't a compiler, it's a transpiler. You're not compiling to bytecode in a vm, you're still in javascript. This saves my bacon in the front-end. For the back-end, I most definitely choose a strongly typed language like Go.