Explain the hate for Javascript

Explain the hate for Javascript

>As powerful as lisp
>High demand, high salary
>Used in literally every website
>Flexible
>Simple syntax, easy concepts
>Can be used for developping web apps/games
>Easy to maintain/Test with chromes console for exemple
>Simple animations
>Useful libraries used for Backend and Frontend

Other urls found in this thread:

youtube.com/watch?v=t7_5-XYrkqg
twitter.com/NSFWRedditGif

Probably mainly leftover hate from the dark ages pre-ES6+ / modularization / Crawford-ish functional-evangelism

"Backend" baka. I love JavaScript but it's not backend

If it can be used to write implement an HTTP server and connect to some persistence layer, then it's effectively a back-end. Its lack of a reputation as an often-used language for doing so is irrelevant.

I'll take the bait

>Explain the hate for Javascript
>>As powerful as lisp
They're both Turing complete, so I guess you're right in a way?
>>High demand, high salary
Sadly yes, not really on average
>>Used in literally every website
Literally no choice you faggot
>>Flexible
...what isn't flexible by your definition?
>>Simple syntax, easy concepts
Please sort an array of numbers for me
>>Can be used for developping web apps/games
Eww
>>Easy to maintain/Test with chromes console for exemple
Many languages have a REPL, not easy to maintain due to callback hell
>>Simple animations
What does this have to do with the language?
>>Useful libraries used for Backend and Frontend
New library every week, old ones no longer supported after 2 months so you end up rewriting your "app" multiple times a year to keep up

>high salary

That's only because there are so many meme frameworks that it is getting difficult to find someone with more than 1 or 2 years of quality experience building stuff with them.

majority of Sup Forums has never actually used it and especially not in an actual job. most of Sup Forums just does the exercises in K&R then calls themselves programmers

I've been using c# and its comfy as fuck compared to JS.

Sort array of numbers?

var array = [4,1,3,5,7,2,9,6];

array.sort();

litteraly it

>Explain the hate for Javascript

Shit type enforcement. Shit OOP model. Variations on common tasks (defining functions; defining a class; inheritance) makes code difficult to edit/maintain. Carefree typing and syntax leads to spaghetti code.

All of this leads to Meme Library of the week because every last millennial wants to re-invent JavaScript so they don't have to actually code in JavaScript.

using node.js with socket.io and no framework now. it's quite fast for big loads


>As powerful as lisp
Wrong, misses alot of the features from lisp
>High demand, high salary
Wrong, people get paid 4$/hour for that shit on average
>Used in literally every website
iPhone is used by almost everyone
>Flexible
true, it's quite extensible
>Simple syntax, easy concepts
makes it easy for low level incompetent people to get inside and reducing the quality of programming
>Can be used for developping web apps/games
pascal and algol can be used for this too, nobody is dumb enough to do it
>Easy to maintain/Test with chromes console for exemple
true
>Simple animations
its simpler with CSS
>Useful libraries used for Backend and Frontend
you mean 1GB tabs and memory leaks / crawling slow websites?

Javascript is only good frameworkless or with something small like jquery, add angular or react or something like that in the mix and you're losing users from page load delays, this is coming from a node dev

Found the neet

>inb4 that's in the spec
I know, which makes it even sadder than PHP

Fair point, the spec is gross. This is acknowledged by many, hence why there is a (very thin) book called "Javascript: The Good Parts".

But part of the charm of JS is how easy (though, arguably, dangerous) it is to correct for it:
Array.prototype.sortNumeric = function() { return this.sort((a, b) => a - b);}

[1,2,3,4,5,6,7,8,9,10,11,12].sortNumeric(); // yay

Sweet mother of fuck it's real

That is bug-as-a-feature level thinking. Stop that.

It's completely inconsistent in its behavior in even the most fundamental ways.

Agreed, which is why I specifed it's dangerous. I'm not advocating this particular kludge, just demonstrating the flexibility and intuitive functional and dynamic aspects of the language that in my opinion outweigh the shitty parts of it.

more inconsistency

My favorite:
typeof NaN
// "number"

Yes, the spec states that sort() converts values to strings before comparing. What other language does this?

>my language of choice sucks balls so hard I have to monkeypatch the stdlib
And this is not going to be fixed anytime soon because backwards compatibility. We might see some progress if/when webasembly becomes a thing (no need to rely on browser to have updated version of your language anymore) but I hate it for many other reasons. We need to go back to simple websites and proper, offline applications.

>return this.sort()
If you passed in 12 and 2 to this, would it not just still return it sorted as 12, 2?

I now believe javascript is worse than PHP

>As powerful as lisp
lol. They both have closure after all, amirite.

fuck that

It's passing a comparator function (which probably should be extracted, incidentally) to sort, so it's using that instead of the default.

It's not monkey patching. The .sort spec allows passing a comparator function. Granted, the shortcut shouldn't modify globals, but that was just for demonstration, and beside the point.

disgusting.

>dammit we need a language for this world wide web thing
>couldnt we just use Lisp or C or...
>hell no! C is too hard for most programmers and Lisp is too old and the people that use it smell funny
>why don't we take the worst features of both languages and call it ECMAscript?
>we need it to sound more official, Java is the new official, we call it Javascript
>2010: basic web applications now require 1GB of memory
>2016 : basic desktop applications now require 2GB of memory

literally the history of JS

Javascript was written in like a week and was heavily influenced by various stimulants. Be nice.

Actually a pretty interesting history:
youtube.com/watch?v=t7_5-XYrkqg

this is why strong typing exists and is superior. weak typing is fucking retarded

>wahhh I might need conversions then

good, then you can define them (or use a well-defined STL).

Brendan Eich is that you

how did you go from working on legit systems engineering stuff like DSP and operating systems to making this abomination