DEV Community

I'm Javascript. And I'm done taking your shit.

Akaash Patnaik on May 04, 2020

Alright, douchebag! You think you can go on the Internet — the house that I built — and talk smack about me? You thought I wouldn't know every ti...
Collapse
 
190245 profile image
Dave

This! (sorry, couldn't resist).

Seriously though, as an OO developer, I don't hate on JS... I hate on the guys telling me it has to be used as a panacea. JS has it's uses, as does COBOL etc.

Collapse
 
fjones profile image
FJones

Aye. Much as the comedy is appreciated, I think a lot of it does touch on the crux of the issue: There's really nothing JavaScript is good at. Just (increasingly fewer) things it is less frustrating than existing available languages at. It's not really a language of choice, but a language of necessity or for lack of alternatives (though it definitely could be - the paradigms lend themselves really well to some really niche applications).

As a scripting language, even for the web, we've been working around it since it became common - very little web JavaScript is actually written in ECMAScript - and when it is, we still need to preprocess it. And on the other hand, we're shoehorning JavaScript into environments it is decidedly not designed for - it is indeed seen as a panacea.

Rebuilding web frontends on a new language obviously isn't going to happen, but sometimes the vast sea of superset languages and frameworks with their own syntactic quirks does make me wonder what the web would look like if Netscape had run on Python or Lua instead... Well, that's a dark thought, nevermind.

Collapse
 
jpantunes profile image
JP Antunes • Edited

If you keep misusing a language or ignoring how it has advanced since you first worked with it 20 years ago then yeah, that would be right.

Personally it took me about 2 decades to come around and actually try to learn (modern) JS and I only did it because node.js + streams + generators + async/await + bigInt + es6 give me an easy-to-use and hard-to-get-wrong environment to work with, from cryptography to web services, and the ecosystem is filled with good modules and examples.

Thread Thread
 
190245 profile image
Dave

Many other languages have mostly the same capability, and, in my opinion are easier to use while being harder to get wrong, than JS is.

Take the situation with boolean's in JS as an example, and the fact that they can be undefined. Dead easy to get that wrong if you don't know what you're looking at. Plus, as an OO developer (mostly Java, but lots of others too), a boolean value that can have 3 states is simply bonkers - again, in my opinion.

Thread Thread
 
fjones profile image
FJones

And yet, none of the examples you list are ones I find particularly compelling. Yes, JavaScript is easy-to-use - as easy as most any scripting language. It certainly isn't hard-to-get-wrong, though.

node.js is exactly one of those environments JS wasn't designed for. It has, in many ways, combined the worst parts of Python, Java, and PHP into one, with few noticable upsides. Talk about misusing a language.
Async/await is a construct that embraces easy-to-get-wrong if anything - conventional Promises were actually better than this.
BigInt in a language where everything is a low-precision float is another matter of working around language design. Yes, almost every language faces this, but JavaScript's solution isn't unique either - much as it isn't for streams and generators.
And ES6 is indeed the point about a language evolving over 20 years: Most of ES6 is syntactical shorthands for existing functionality. JavaScript has advanced, yes, but so have other web languages. PHP 8 is still struggling from old flaws, but it, too, is a huge change from 20 years ago. Does that make PHP a good language now? Many of the flaws in language design are still there.

Mind you, I wasn't trying to hate on JS all that much. It's a flawed language like many others. I'm trying to see anything it excels at in productive use, used as an example of JS being good. Every language has its use - what is JavaScript's? Versatility, perhaps. But is that due to the language or due to the ubiquity stemming from its use in Netscape? I would argue the latter, and I would argue that a jack-of-all-trades language just opens itself up to even more misuse.
Cryptography in JS is something I'll freely admit to continue hating on, though - and that's even ignoring the constant security flaws in that ecosystem of modules.

Where Perl and PHP are the duct tape of the web, JS is the splint. It's useful, but it isn't good.

Thread Thread
 
190245 profile image
Dave

Seriously now... can you please come to work with us?

Why don't others in the industry understand? Appropriate tool for the job, that's all that matters.

Have some love, you deserve it!

Collapse
 
ozzythegiant profile image
Oziel Perez

I could basically say the same thing about Java: it's a nice programming language that has its use cases but man do I not like the ecosystem it has. So many libraries and frameworks use XML configurations and it's like, am I programming in Java or XML? Then there are frameworks or some applications where everything is overengineered. So many classes that are named AbstractHyperOmegaFactoryConverterConfigurator or some similar tongue twister that leaves you wondering what exactly it does, and all these classes are all over the place when I'm pretty sure most of the work these classes do could have been done with 90% less code.

See? Most of the times it's not a problem with the language, just some people haven't fully mastered how some things get done in a language they are not used to, but that's not to say all programming languages are perfect or anything.

Collapse
 
1e4_ profile image
Ian

You can literally write this article about any language. People always feel the need to bash a language instead of just accepting that it can be used.

Though saying that I couldn't make it through the whole article

Collapse
 
190245 profile image
Dave

I write Java (mostly) for corporate code... in a previous job, just for giggles, we actively had a competition running (monthly winner got a prize) for the longest method names that would still compile and make sense in English. I think the record was somewhere around 130chars - for a method name!

Hating the long names and lack of readability isn't really a reason to bash on any language - the same misuse can happen in all languages. But remember, the original post was (I presume), posted in humour...

Collapse
 
ozzythegiant profile image
Oziel Perez

Agreed, and that's basically my point: a lot of times people don't like certain conventions about a language or its environment and it's not really about the language itself. That or they don't have the full mastery over a programming language's mechanics so "people hate what they don't understand".

Thread Thread
 
190245 profile image
Dave

I tend to hate the people that hate what they don't understand, but maybe that's just me. :D

Collapse
 
giorgosk profile image
Giorgos Kontopoulos 👀

This is hilarious, thanks for the write-up.

Collapse
 
worldpiece profile image
Akaash Patnaik

Thanks! Glad you liked it. :)

Collapse
 
dendekky profile image
Ibrahim Adeniyi

😂😂😂

Collapse
 
nombrekeff profile image
Keff

Cool stuff, I'll be sharing this :)

Collapse
 
waylonwalker profile image
Waylon Walker

Amazing