Can someone tell me why people are so much hyped about javaScript libraries, SPA's, throwing more javaScript to browsers, using excessive tooling and all that. This seems a lot of questions but all that says one thing why people are making front-end complicated?
At the end of the day, javaScript has its own flaws and that can't be changed because of backward compatibility.
shouldn't we ignore writing JavaScript. Instead of throwing everything to JavaScript thinking that it will make things better.
Top comments (12)
I'm not sure it's fair to say that people are "making" front-end complicated. While there are of course a huge number of front-end frameworks and tools, I doubt there's a single one that wasn't created in response to some perceived problem or complexity that was already there.
I get hyped about tools, libraries and frameworks because they help me do more and better things. I mean I could do everything without tools, but it'd take ages and the end result wouldn't be as nice. That said, if I got stranded on a desert island and I could only take one tool, it'd probably be Sass (sass-lang.com/).
I mean, Wikipedia lists 26 different types of hammer. Isn't that excessive?
Front-end development is as uncomplicated today as it has been in the 17 years I've done it. 2000-vintage front-end was a mess of IE6 with perfunctory nods to Netscape compatibility, zero standards being in effect, and harsh limits on what was possible, all coded mainly in a plethora of server-side languages that were more or less suited to it. Ask me about the time I did a CGI script in ML, some time.
Today? Today if you know one language, you know web. JavaScript will see you through the database (Mongo, Couch, etc.), the server (Node) and the client (browsers, Electron, React-Native, etc.). All with a consistent structure, event-based activity, functional programming available, and standardized constructs. Browsers have largely been standardized to the point of high interoperability, and the rest is handled quite easily with libraries and polyfills.
So why the hype? Because we're basically in Heaven these days.
The main thing is that JavaScript has become more or less the 'assembler' of the web. You don't need to use javascript if you don't like the language (pick any other like typescript, coffeescript, reason, kotlin etc).
Even if it has bad parts, overall you can do enough things with the language. Every programming language has flaws, and the more you use it the more you'll find weird quirks or edge cases.
Well, I guess there are a few reasons for all this. Javascript has flaws just like every other language out there. If I were to guess the reasons behind Javascript popularity, I would say that developers use what they know to solve problems. I don't know Ruby for example, I won't use it to solve a problem I have. Javascript is most likely one of the first language new developers come to learn and get familiar with. I know I did. You learn some HTML, some CSS and you start moving to Javascript.
There are a lot of new developers coming in the market without any computer science background and who do not know what 'complexity' means in the programming world. It's difficult to know what is good practice and what is not when you partially know only one language.
So, I don't write everything in Javascript because I believe it's better than everything else. I truly have no fucking idea what I am doing. I write everything in Javascript because, for now, that is the only language I can solve problems with.
Frontend is a real time, 60 fps, asynchronous multiplatform affair. Noone is making it complicated, it always has been, and tools are trying to solve that complexity.
Do they add a layer of complexity to working in the frontend? Sure. Like everything. Could you manage a modern frontend workflow without them? Most probably not.
Browser: only JavaScript available on this platform. (Workaround: compile to JavaScript.)
Server side, standalone client etc.: I really don't know. There are sooooo many possibilities which are much-much better than JavaScript, every aspect (speed, elegance). Don't afraid to find reasons outside the technical domain, e.g. laziness, dumbness.
I believe it's because, as it has always been, Javascript is the only Front-end language for the internet.
What I mean is, yes you could write your whole web application using Java or ASP.NET, but manipulating the DOM would be much harder. Also, building PWA (whatever it is) would be impossible, manipulating animations and destruction of elements would also be harder.
I particularly love Javascript and its possibilities, mainly from a front-end point of view.
I'd say it boils down to:
Tongue-in-cheek aside, JavaScript will almost always work, in much the way Perl will always work.
The NPM ecosystem is fairly comprehensive, and applies Semantic Versioning well. Modern browser Javascript engines are excellent, and Node has caused some innovation/hand-wringing on the server side.
Do I want to be writing JS? No, almost never.
Do I like the ecosystem? Yes, quite a bit.
Trying to be edgy, yes?
The possibilities of JavaScript today are greater than I ever expected them to be. I used to think of it as a tool for creating limited interactivity, but nowadays there's nothing you can't do with JavaScript.
Then there are tools. I like SASS, concatenating stuff, minifying, you name it. I used to do this all with Ruby frameworks. Ruby is not my cup of tea and I was only interested enough in it to make my tooling works. With Node though, it feels like I can configure and customize my tooling endlessly as it is all in a language I feel comfortable in.
Oh and let's not forget about all the frameworks! How I feel it, JavaScript used to be a bit of a wild west. Building complex turned into something real messy real quick. Or at least it did for me, because I'm not that structured. Frameworks have brought me things to hold on to when building a bit more complex things.