I hope this is my final essay on JavaScript (and so do you!). In summary, a
few weeks ago I volunteered to write an in-browser script driven demo app
which is simply a navigation stack of 4 screens. Angular is so currently so
trendy I spent several hours attempting to learn and use it, but due to
lack of an IDE, no debugging, no guidance, the custom terse syntax and
complex dependencies I gave up (then I learn it's being rewritten in
TypeScript anyway). I've expressed my anger at the 'zoo' of uncoordinated
and competing JS libraries.

I spent all of yesterday optimistically studying and trying TypeScript, as
the familiar IDE and structure seemed ideal for someone from a C++/Java/C#
background. Given my belief that the JS world is really chaotic, my overall
conclusion is:

*TypeScript is organised chaos.*

I was reminded of moving from C to C++ 20 years ago. C was so freeform you
could write spaghetti. C++ helped you write object oriented modular
spaghetti. Just like that, TS is trying to tame the JS spaghetti and make
it feel OOPish and respectable to people with my background, but it's still
just putting a wedding gown on a pig.

The good news is though, that once I eventually found guidance on how to
organise multiple TS source files, how to use module { } like namespaces,
when to use the <reference>, and why you use --out to concat files, then TS
is probably the least worst option I've seen so far for writing large JS
apps. At least you will finish up with organised modular chaos.

So you might be able to tame JS with TS, but we are still stuck with the
cumbersome DOM and jQuery. While trying to give my web page app behaviour I
had to have jQuery reference web pages continuously open so I could
remember the arcane and inconsistent syntax to do the simplest things like
toggling visibility or setting text or class attributes. This isn't really
a JS related problem, but I find manipulating the DOM from JS and jQuery
tedious beyond endurance.
In fact my endurance is exhausted. I will not write the demo and have
commissioned someone else to do it. They write this sort of thing for a
living, so I look forward to learning how they do it. I've learnt a lot in
recent weeks anyway and have decided that for future work like this I will
use TS and jQuery because they're the least worst (for now), and the rest
of the JS ecosystem can go to hell.

*Greg K*

Reply via email to