3 ms·
> May I recommend adding a static type checker to your tooling. I fully understand that the JS community has a thing for dependencies, and views Amazon as its
by bachmeier 6y ago
> May I recommend adding a static type checker to your tooling.
I fully understand that the JS community has a thing for dependencies, and views Amazon as its representative use case, but I was hoping to add a few small Javascript functions to a static html page. JS loses its appeal quickly when you start adding things like that - if I can't open an html file in a text editor and add the functions I need, I might as well use a different language.
- madeofpalk 6y agoI'm not really sure what Amazon has to do with this, but the problem you described - "I changed the API and forgot to update a part of the application" - is exactly what type checking is for. This is not a "JS community has a thing for..." bit, this applies to any programming language.
- jakelazaroff 6y agoI'm not sure what other language you could use to add client-side functionality to a static webpage? But anyway, if you want to avoid a compilation step, the link GP mentioned shows how TypeScript can check JS files annotated with normal comments. You can run it through the a compiler to remove the annotations if you want, but it's absolutely not required.