And then new transpiler language appears, with "real" type system, not java-grade. And everyone stops using typescript, treating it as outdated technology.
JavaScript libraries should be written in TypeScript
61–70 of 285 posts
Re: JavaScript libraries should be written in TypeScript
#62I stop find perfect language because there is none.
Re: JavaScript libraries should be written in TypeScript
#63Absolutely not. This is the opposite of what you should do in my opinion. If you're writing an API to be consumed in language X then you need to write the API itself in language X. This will help you capture and handle edge cases, language idiosyncrasies and other similar issues the way you want. Using a different language that gets transpiled into a target language also increases your surface area for bugs because n…
Re: JavaScript libraries should be written in TypeScript
#64Re: JavaScript libraries should be written in TypeScript
#65https://developers.google.com/closure/compiler/docs/js-for-c...
Re: JavaScript libraries should be written in TypeScript
#66And then new transpiler language appears, with "real" type system, not java-grade. And everyone stops using typescript, treating it as outdated technology.
Re: JavaScript libraries should be written in TypeScript
#67Absolutely not. This is the opposite of what you should do in my opinion. If you're writing an API to be consumed in language X then you need to write the API itself in language X. This will help you capture and handle edge cases, language idiosyncrasies and other similar issues the way you want. Using a different language that gets transpiled into a target language also increases your surface area for bugs because n…
But TypeScript is basically "Javascript + types + ES6". They call it an "erasing compiler" because it's not meant to do much but remove types/make ES6 code work with ES5.
There is one gotcha in name resolution when you're working in modules (if you are in a module a.b, and a.c exists, then c will automatically refer to a.c, even if a global c exists). But that usually gets caught by the type system. Lot less issues than coffeescript IMO
Re: JavaScript libraries should be written in TypeScript
#68I still run into libraries written in Coffeescript, and hate it when I do, because I don't use it and have a hard time following it. Javascript libraries should be written in Javascript. Worship the one true God!
Re: JavaScript libraries should be written in TypeScript
#69With WebAssembly making its rounds it would be cool if Javascript libraries are able to be written in C/C++ or other lower-level languages then exposed via an API. That way a lot of algorithms can be shared with native code-bases too.
Re: JavaScript libraries should be written in TypeScript
#70Absolutely not. This is the opposite of what you should do in my opinion. If you're writing an API to be consumed in language X then you need to write the API itself in language X. This will help you capture and handle edge cases, language idiosyncrasies and other similar issues the way you want. Using a different language that gets transpiled into a target language also increases your surface area for bugs because n…