Time and time again I am surprised at how difficult Javascript is to maintain or
ID: 646983 • Letter: T
Question
Time and time again I am surprised at how difficult Javascript is to maintain or write proper programs in, mostly because it is so weakly typed. I truly find it akin to writing programs in assembly. Sure, there is some intellisense for it and you can get some tools to make it easier. You can even use things like jQuery to make it more platform independent.
But does there exist some sort of language (strongly-typed) that I could write in, syntax similar to Java or C#, that could "compile" into Javascript? Or perhaps there are tools that would make Javascript strongly-typed, and could detect bugs, that a C# compiler would detect?
I'm not trying to just hate on JS here, but I'm wondering if there is some sort of roadblock that prevents this. Or perhaps doing this would make JS difficult to use in the web.
Edit: While I may have been pointing directly at javascript, I guess my broader question, is there a reason why Javascript is the only game in town? And is there something inherent about client-side code that makes javascript that way it is?
Explanation / Answer
TL;DR
Not everyone agrees with the premise that JavaScript is terrible, but you certainly aren't the first person to espouse that view. However, your choices are somewhat limited unless you want to "roll your own." I've included a non-exhaustive tour of some better-known options below.
Client-Side Interpreters
You can write client-side scripts in any language that the browser supports. The reason most web applications use JavaScript is because it is (for practical purposes) the only interpreter you can rely on being present
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.