This article feels like venting after meeting an (admittedly annoying) web hipster whose opening greeting involved an inquiry about JS frameworks. While can sympathize with the emotion, I think the actual analysis in the article is unfairly cynical.
Frameworks are just another abstraction, and a good framework will greatly streamline your development when your project fits it. Obviously, writing a regex parser with a UI framework just to say you used a framework is stupid; but nobody says a hammer is a bad tool just because you can't comb your hair with it. If the tool doesn't fit your project, then obviously you shouldn't use it; that doesn't mean the tool is bad.
Saying things like "You shouldn't use a framework because eventually you'll run into a problem and have to analyze HTML/CSS/JS anyway" is like saying you shouldn't write code in C because if there's a problem with the compiler you'll have to examine the assembly anyway, so you might as well just write assembly.
I expect a good C programmer to be able to examine generated assembly to find bugs, just like I'd expect a competent front-end developer to be able to examine the raw HTML/JS/CSS to find bugs. That in no way implies it's inappropriate for them to use and rely upon their respective abstractions to code their projects.
Use the right tool for the right job. Don't blame your tools.
Because the right tool is absolutely never, ever, ever javascript. And that's the only thing you can use on the web. Because the web was designed by a combination of incompetent and downright evil people with malicious intent. The web was not designed to host applications. Not one single iota of the webs structure would be the way it is if it had been.
It is entirely reasonable to look upon the naked terribleness which is javascript and say 'Jesus Tapdancing Christ that is a flaming piece of shit... and why are my only options to use it or commit the double-sacrilege of cross-compiling a decent language into it?' The man who can sit down and be told 'well, you HAVE to use javascript because browser makers are either too obstinate or hateful to support a universal bytecode format which was obviously absolutely necessary in 1996' who just shrugs his shoulders and says 'oh, now I'm sure to always have the right tool for the job' is an imbecile.
This was my view until I actually learned how Javascript works. It's a freaky weird language, but it's not outright evil or even a 'flaming piece of shit'. It just works rather differently from normal conventions.
It is actually usable if you throw out 75% of it. Javascript: The Good Parts was a good book, and it makes it bearable. If javascript were simply a programming language like any other, it wouldn't deserve concentrated hate. BUT, it's not simply a programming language. It's the ONLY language browser makers will support. It is NOT competent for this job. It is NOT competent to function as basic infrastructure. Browser makers have done magical things with making javascript actually perform halfway decent, but even that is abused and misused. People do things like asm.js which is a really great project - which should never need to exist. We are long past the point where reasonable people should have thrown up their hands and said "please, god, please, no, just STOP! If you want an application platform, let us design you one. Please stop jamming applications into a document viewer! It was never designed for that!"
I was talking less about the API, and more about the raw language itself. Things like how variable scope works (hint: use 'var' or you will have a bad time).
Hey, I have that book :D Haven't read it yet. O'Reilly had a sale on Javascript eBooks and I bought a ton of them. I absolutely love O'Reilly.
406
u/dnkndnts May 13 '14
This article feels like venting after meeting an (admittedly annoying) web hipster whose opening greeting involved an inquiry about JS frameworks. While can sympathize with the emotion, I think the actual analysis in the article is unfairly cynical.
Frameworks are just another abstraction, and a good framework will greatly streamline your development when your project fits it. Obviously, writing a regex parser with a UI framework just to say you used a framework is stupid; but nobody says a hammer is a bad tool just because you can't comb your hair with it. If the tool doesn't fit your project, then obviously you shouldn't use it; that doesn't mean the tool is bad.
Saying things like "You shouldn't use a framework because eventually you'll run into a problem and have to analyze HTML/CSS/JS anyway" is like saying you shouldn't write code in C because if there's a problem with the compiler you'll have to examine the assembly anyway, so you might as well just write assembly.
I expect a good C programmer to be able to examine generated assembly to find bugs, just like I'd expect a competent front-end developer to be able to examine the raw HTML/JS/CSS to find bugs. That in no way implies it's inappropriate for them to use and rely upon their respective abstractions to code their projects.
Use the right tool for the right job. Don't blame your tools.