DEV Community

loading...

Discussion on: The Shocking Immaturity of JavaScript

Collapse
faraazahmad profile image
Syed Faraaz Ahmad

This. Every word of it is what I've been saying and wanting to say about the whole Node/JS ecosystem for a while now. I was lucky enough to have stumbled upon and learned Ruby (and RoR) right out of high school and ever since I've hated the DX around everything Javascript.

I remember trying out tutorials for the MERN stack (even official ones from Microsoft) and was shocked by how much I needed to understand and install just to get started. It was so much easier in the Rails world to just do rails new project_name. There are some recent changes Rails has made that I'm a little iffy on, like requiring Yarn instead of just using NPM and using Webpack (which is great but I keep running into compatibility issues) which kills the DX for me a little bit.

Right now I'm a happy user of Elixir and the Phoenix framework.

Collapse
zaydek profile image
Zaydek MG

I think Node / JS became popular out of necessity. JavaScript kind of cornered the market by making it the only viable target for deploying to the web and Node bootstrapped V8 to make that happen on the backend. But JavaScript kind of has this legacy, with JavaScript being originally implemented in something like two weeks and not being able to revise itself due to backwards compatibility concerns. So it makes sense -- in hindsight -- why Node / JS can be so out of whack, but only if you understand the context in which JS was created and then ported to the backend.

I will say that NPM / Node / JS is fairly accessible today but that’s only if you are down with learning a bunch of tooling that may or may not fall out of fashion in the near future. Frontend is a tumultuous world.

All that being said, this is certainly not the best we can do. I really like that some frontend devs like yourself have branched out and are leveraging backend technologies, because the added experience can help re-contextualize frontend tooling for the rest of us.

I’ve never tried Ruby but I hear generally good things, depending on who you ask. 😀

Collapse
rxza profile image
youngdagobert

Ruby coder and can confirm its SO much easier than doing stuff in JS. Community is really helpful too :)

Thread Thread
thebarefootdev profile image
thebarefootdev

Subjective ease of use doesn’t always indicate quality, there are many reasons why some find things easier and harder. Usually that a lack more complete understanding of a language is why another is considered easy.

Simply because a language is syntactically clearer to an individual does not eschew any functional comparison, it’s more about the underlying language engineering and whether it’s a good approach for the domain solution and not entirely clarity for the developer

Thread Thread
jaredcwhite profile image
Jared White Author

It's a mistake to optimize for computers at the expense of humans.

Thread Thread
zaydek profile image
Zaydek MG

Comment of the year. 👍

Collapse
leob profile image
leob • Edited

I think JS might (gradually) be getting there in terms of DX - e.g. if both browser engines and node.js implement most of ES6/ES7/ESWhatever natively (so that we don't need Babel and so on), that will make a big difference.

It's not the whole story, but just the tooling is so much simpler for the other stacks (Ruby, PHP and so on).

Hopefully we'll gradually get less fragmentation and more 'standards' in the JS world.

Thread Thread
zaydek profile image
Zaydek MG

JavaScript is definitely more ‘aligned‘ then it’s ever been before. Though there is quite a bit of fragmentation now coming from tooling like TypeScript, for better or for worse. I use TypeScript but I feel like my TypeScript is not going to be constructed the same as everyone else’s because there’s a thousand decisions every TS developer needs to make or will be made for them and that causes me some concern.

I’m also all for not betting on Babel going forwards. I get that it was necessary at one point to really be productive, but it strikes me as a burden now to have fragmentation, like you said, in the core language itself, let alone TypeScript and type-oriented extensions. It surprises me that I haven’t heard more complaints about Babel?

It’s not that I dislike Babel, I just think it doesn’t make sense to force projects into using Babel because of legacy codebase decisions.

Thread Thread
leob profile image
leob • Edited

Spot on ... Babel is of course a technical marvel, but I never liked the fact that I'm not programming in the "real" language, but in a pimped version of it, which then needs to be cross-compiled to "the real thing" - in a separate build step (so, as a code generator, in fact).

It also makes debugging that much more of a hassle, always the struggle with source maps etc.

Obviously I respect the people who developed Babel, but I say good riddance when we don't need it anymore, once browsers and node.js support newer JS versions natively.

Ah yeah but then there is TS :-)

What I'd really like is if these "cross compilers" or "pre compilers" were just integrated into the JS engine, so that it would be something like a seamless "just in time" on demand compilation step, rather than requiring a clunky external build step ... JS is the only mainstream language which has all of this baggage.

Thread Thread
zaydek profile image
Zaydek MG

You may want to check out esbuild if you haven’t already. ;)

Thread Thread
leob profile image
leob

100 times faster than Webpack or Parcel ... how the heck is that possible?

Thread Thread
zaydek profile image
Zaydek MG

Webpack / Parcel are implemented in JS which ultimately is going to be as fast / slow as V8. esbuild is implemented in Go (closer to the metal) and uses a lot of concurrent algorithms as an optimization. In 1-2 years I think esbuild will emerge as the dominant tooling provider.

Thread Thread
leob profile image
leob

Right ... but why does that have to take 1-2 years? If it's that much better then I'd use it right away and dump the rest!

Thread Thread
zaydek profile image
Zaydek MG

It’s pre 1.0 and missing a few core features. It’s not far off but it’s also not 100% adoptable yet.

Thread Thread
leob profile image
leob

Ah okay :-)

Collapse
thebarefootdev profile image
thebarefootdev

This is a rather odd article. It’s not clear that you have a full understanding of the node and JavaScript ecosystem at all. You appear to lump it all in under one monolithic thing and then compare it to largely unrelated approaches.

Node is not a product directly as a platform for all JavaScript developers. It’s true it’s hard to do much these days in JavaScript without it but node itself is the V8 engine , and libuv written in C and as a tool is very powerful. Sure it’s powering JavaScript abstractions but if it’s dismissed as just part of a npm / JavaScript collective then it’s not a fair assessment.

Regarless, your article is absent of any real critical analysis on your dislike of JavaScript , you compare it to Ruby on Rails and elixir and Phoenix yet these are complimentary language / frameworks not constructs in competition with node and JavaScript. By all means a comparison between React or Angular and Rails for example would be more appropriate but denigrating JavaScript without examples is a rather naïve approach.

JavaScript has its problems that is true like most languages, but to know them is to understand JavaScript and to know it and to know Node.

Forem Open with the Forem app