What's wrong with JavaScript

So, what's wrong with it?

Other urls found in this thread:

hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.sl53shu17
i.stack.imgur.com/35MpY.png
nativescript.org/
facebook.github.io/react-native/
phonegap.com/
twitter.com/NSFWRedditGif

Everything.

Overused.

I'd like to read more detailed answers.

most of it is non-free

Always run into problems with the duck typing

It's not a very well designed language but it's also pretty based (you can do functional programming with it). It tends to be overused though. You should only use it in a browser where you can do something simple yet useful with it, but a lot of web devs use huge scripts that affect the entire site.

its not oop

we'll you can make it pretend to be.
also some bullshit stuff with regards to "truthiness"

The language itself, not so much,

The community of developers who try to push this JS IS THE PARAGON OF HUMAN THOUGHT and insist that it should be used everywhere, that is the problem.

Node.js is cancer.

Literally the only thing wrong with javascript ecosystem right now is web devs. They're all retarded 2bh

Good for prototyping

Node.js != JavaScript

it's got really confusing high level language features

Most confusing is how it does oop

you don't have classes like other languages, you just define them in the middle of a program

What I'm more confused by is
"True" == True returns true
and 1 === True returns false

I don't think the way JS does OOP is "bad", it's just different. Instead of a class you have something like
function Object(name, num)
{
this.name = name;
this.num = num;

function getName()
{
return this.name;
}
}

What's confusing about this? It's a pretty basic feature.

== With type conversion
=== Without type conversion

I'm retarded
function Object(name, num)
{
this.name = name;
this.num = num;

this.getName = function()
{
return this.name;
}
}

What's wrong with Javascript?

Listen.. I'm no programmer I have made in the past some HTML pages, nothing fancy, simple shit.

Here's the thing I started using www in 96 at a school computer, it was a beast of a machine really fast to, Pentium 1 at 133MHz on a ISDN dual line so it got 128kbps it was awesome. And there was never any issues with any webpages loading, my 486@100mhz could have loaded them. Javascript today means that my Pentium Dual Core at 2200MHZ can't load majority of webpages today without slowing the fuck down.

That's what's wrong with javascript.
>inb4 that is the developers fault

oh get the fuck out of here with that bullshit excuse. Part of Google's success was how fast they were, they used to have a milisecond counter for how fast their front page loaded and how fast the results loaded. I'm all for progress and doing things better, but I don't call progress needing 10 times the resources to do the same thing I did 20 years ago with something that wasn't even the best back then.

The fact, that class or object isn't a function is fucking confusing.

>oh get the fuck out of here with that bullshit excuse
That's not a "bullshit excuse", developers adding tons of scripts to their web pages has nothing to do with the language itself.

Javascript caused this. I have a 180 line long rant file about my work with using a javascript engine.
I would post the whole but it has identifying stuff in it.

>Dynamic typing is the original sin which we all are born into; trying to seek forgiveness in this chaos is wasted effort.

>Cesium is astylistic, ugly, disagreeable, unintuitive, verbose, tautological, malperformant, unreadable, and unwritable.
>I hate every aspect of it. There is nothing about it I like other than the minimum sanity required for functionality.
>This idiotic API who’s documentation only occasionally describes what a class does,
>never even hints at how to construct and aggregate things other than tautologies.

>The tautologies somehow don’t explain themselves, I didn’t know that was possible.

>Every time I explicitly have to type "this." I want to punch whomever is responsible.

>Show someone a regular, unlocked door. Give them a hammer. Ask them to open the door. >Possible outcomes:
>worst- randomly bash the door with the hammer until it falls apart
>pessimal- Hit the door handle until the jam breaks open
>best- Turn the handle and push it open

>Monomorphic singletons are an antipattern, but that's fine because javascript itself is an antipattern.

>The fact, that class or object isn't a function is fucking confusing.
Do you mean that the equivalent of a class in JS is a constructor function is confusing? It's just different and not really hard to get used to it

By the way google doesn't do the exact same thing it used to, sure AT ITS MOST SIMPLE FORM it's just returning searches, but it's fundamentally different now, shows how little you know 2bh

Also, developers do actually deserve a lot of the blame, there is no reason they should be chasing trends and adding a bunch of shit into whatever the fuck they're building just so they can put a react logo on their website.

I bet you don't even know what AJAX is

It is an excuse, I get what you're saying but the reality is what it is. And not to be all globalist and shit but we sometimes forget that the internet is a world wide network, I can access websites from anywhere in the world by logging on to the internet almost anywhere in the world, including china even if censored.

And not everyone has the same resources, pages not being able to load fast on a p2c means that you really have a seperation of the network between those with low end processing computers and those with the latest i7. That separation didn't exist in the 90s or even the early 2000s. It used to be that developers were worried about how the page would look on every computer of every resolution and that doesn't happen anymore.

The one thing that was great that came out of the firefox browser and the iphone, majority of websites used to be built for IE6 and would not work "properly" on anything else and now they're the same everywhere on every device, but anyway I'm rambling.

someone got triggered

No offense but you don't even realize how useful JavaScript is and what it can do. The internet has changed, a lot. If all scripts would be disabled on all sites for a day, everybody would freak out because a lot of sites would loose a lot of core functinality.

The thing about loading times is also not really an argument against JS: I get what you mean and I completely agree that it's overused, but even very tiny scripts that are even smaller than the HTML itself can be useful. You can blame the devs for using thousands of libraries and huge scripts, but you can also write very little JS and improve the site. Stuff like AJAX is very important nowadays.

You probably just don't realize what it all does, but it's not just adding animations and special effects.

>The thing about loading times is also not really an argument against JS:

Actually that is a great argument against it.

You're very ignorant. You wouldn't even be able to update a thread on Sup Forums without reloading the entire page if you don't use JS. Do some research before you talk shit.

because you can also do that same thing in a million different ways

like fuck.event = {...};

also you get shit like strings being primitives or they can also be objects, and you can add methods (or properties and other javascript shit) to something you made with the string constructor

>You wouldn't even be able to update a thread on Sup Forums without reloading the entire page if you don't use JS

What exactly would be wrong with that?

>like fuck.event = {...};
That's not the same thing. That's creating an object without a constructor.

>What exactly would be wrong with that?
It's really fucking inconvenient?

Disable JavaScript on every site permanently and don't enable it for a single site, no excuses. Now tell me that JavaScript isn't useful.

>Disable JavaScript on every site permanently and don't enable it for a single site, no excuses. Now tell me that JavaScript isn't useful.

Just because webdevs use it to death doesn't mean it couldn't be replaced or even removed from majority of sites out there.

This. Imagine if you gave those faggots C, 90% of all website would give you random segfaults. It's not always the fault of the language if pajeet paints shit with it, javascript is ok as long as you don't abuse it like Hillary does little girls.

So if you have an object without a constructor it is a var but one with a constructor is somehow a function?

Oh god please no, just limit anything web devs can touch. They cannot control themselves.

The user who got corrected? Yeah you're right.

Again, I completely agree that it's overused, but you just can't remove it on every site without sacrificing a *lot* of convenience.
No.
function Animal(name, age) {
this.name = name;
this.age = age;
}


var Cat = new Animal("Pajeet", 3);

var Cat = {
name: "Pajeet",
age: 3
}

// Both are the same thing

Although using any sort of libs or engines with it is horrifying, I do have to say js is great for small simple things, like webforms or simply DOM manipulation - what it was originally created for.

Re downloading content over and over is the problem also giving up your pages state every time you want to get even a single byte more information, that's the problem kid.

In JavaScript functions can be assigned to variables, so they're both functions.

Not entirely correct, both are objects, the difference is that you can use a constructor or define all of the properties yourself.

Functions can be assigned to variables (anonymous functions) but that's something else

that's confusing as hell when you actually put it into practice because people use things like async.

and you still cant justify why even things like strings can be objects or can also be primitives.

>that's confusing as hell when you actually put it into practice because people use things like async.
What do you mean? What does that have to do with anything?
>and you still cant justify why even things like strings can be objects or can also be primitives.
I'm not trying to say that JS is perfect but a lot of people just don't understand how it works or think that it's evil and that nobody should ever use it, which is fucking retarded.

Some common sense in this thread, congrats.

>a lot of sites would loose a lot of core functinality.

This is not a good thing.

>The WorldWideWeb (W3) is a wide-area hypermedia information retrieval initiative aiming to give universal access to a large universe of documents.
>universal access

JS may "only" call a few hundred KB of libraries, but imagine that on the nearly-dialup speed that a lot of the world still has. A lot of sites will just time out entirely.

you're wrong, Pajeet. One inherits the Animal prototype and the other inherits from Object. they both have the same keys but they're far from the same thing.

Exactly, I was arguing in favor of JS
Not every script has to be nearly that huge. And making sure that Internet Explorer 1 and everyone with an 1 kb/s connection can view your site like everyone else is ridiculous, a huge pain in the ass for web devs and often not possible.
The result is the same. Both Cat objects are the same.

Everything is wrong with it.

Cat1 instanceof Animal // true
Cat2 instanceof Animal // false

I see a lot of JS hate in this thread that is essentially "muh feels" without naming a single bad part of JS that shouldn't be used anyways (i.e. ==) coming from children who probably can't write a non-trivial program in any language, let alone JS.

>Cat1 instanceof Animal // true
Cat2 instanceof Animal // false
How is that important in any way? They're essentially the same

There isn't much wrong with javascript itself and it is improving all the time. Most of the people who complain about it have never bothered to learn how the language works and start complaining because it doesn't work like the language they're used to. That's not a problem in the language itself but the people using it.

Now what is wrong with javascript is how it is being used. Your shitty little blog or a news site doesn't need megabytes worth of javascript, end of discussion. But most devs don't care since bandwidth costs or speed isn't their problem. And because they aren't good enough to do simple things without massive libraries so every single functionality brings in multiple libraries to do simple things.

hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.sl53shu17

In your contrived example they are almost the same, the difference is the inherited prototype. However if one were to add to the Animal prototype,

Animal.prototype.isBiological = true

Then it becomes immediately clear that the second example using the object literal syntax lacks the same keys that an Animal may have.

Maybe devs' fault more than js's, but it's fucking slow as shit, there is no reason a core 2 duo should be struggling with webpages but alas here we are

>it's fucking slow as shit
The V8 engine is actually very fast, and often much faster than Python

Note that "slow" doesnt necessarily refer to the language itself as it does refer to how bloatedly used it in on 90% of the internet

Fair enough, but I think it's also because huge scripts use a fuckton of RAM

L M A O
M
A
O

agree 100%, most webshitters and even framework authors don't give a shit about performance. to average devs its just about getting things done on time, and to framework authors, mindshare is more important than benchmarks.

there is no incentive really for webshitters to care about performance. just caring about performance already makes you in the top 10% of software engineers in general.

Of course it's not as fast as C you fucking retard. It is however fast for a scripting language and faster than Python.

Why are you comparing with Python?

For web pages JS is usually clientside and Python is usually serverside

I know but said that it's slow which isn't really true. Of course the language itself has no "speed" but the V8 implementation is faster than CPython.

Doesnt matter.

Compare it with other CLIENTSIDE languages.

JavaScript can run on the backend so my argument is perfectly valid.

There is only 1 'Clientside' language. JS.

>all this stockholm syndrome from gay hipsters and curryniggers
Holy mother of fuck, how can anyone defend this slow, weakly-typed ass pull seriously?

>all this stockholm syndrome from gay hipsters and curryniggers
/thread

It's a fucking scripting language for making websites more interactive, stop treating it like a language for making fucking operating systems. Of course it's not "perfect".

The problem with Javascript is also one with a lot of modern browsers: an attitude of "yeah, sure, throw that in as well."

So you get non-JS browsers like dillo that are blisteringly fast, though "all" they do is browse the web.

Virtually all modern development is now done on top of this shit, what the fuck are you talking about? Mobile apps and other frameworks are shilling the shit out of this steaming turd. No language is perfect, but JS is fucking PHP tier and many of the dumbfucks in this thread are pretending absolutely wrong is nothing with it.

>it's a scripting language so it can be shit!!!
Go program in Tcl or something, you drooling retard.

If you want to browse static documents then use a pdf reader.

OP asked what exactly is wrong with it, but you fucking retards can't even name a single argument except dynamic typing.
That it is being used for other shit except the web now is just a fucking conclusion from a lot of people knowing how to work with it.
If you want to be taken seriously, then argument correctly.

That makes no sense.

News articles and journals are static documents, even if they put all sorts of badly made javascript on top of it to make you think otherwise.

>Mobile apps and other frameworks are shilling the shit out of this steaming turd
I highly doubt that that many mobile apps use JS.
>it's a scripting language so it can be shit!!!
I already said that it's not "perfect". But guess what, there is no "perfect" language. If you don't like it then don't fucking use it you retard. There's no need to be this angry about it.

Nothing.

Not every website is like this. You need it on Sup Forums to update a thread, that would be a very useful example.

Stop reading the news from the web then and buy a subscription to a newspaper like a normal person.

JavaScript what is that? Haven't needed to use it and actively blocked it for many years?

OP was obviously baiting and you're mentally retarded if you can't figure out what's wrong with Javascript:

- Double for everything, no options for other number types. No, fuck you, just because you make toy apps doesn't mean another programmer won't need an actual number type without loss of precision.
- Absolutely retarded truth table. i.stack.imgur.com/35MpY.png
"Oh, just use ===!". How about I make a programming language where you use == for half-assed equality, === for comparing some types of numbers, ==== for comparing strings somewhat okay and ===== for actual equality? Oh, no, you're just whining if you don't know the quirks of my language, this is how God tests us programmers. It has nothing to do with my inability to design a proper programming language.
- At least two major implementations (Mozilla's and Google's) of it with varying degrees of completeness. Decent performance but fucking absurd performance. No, this is not the developers' fault, I shouldn't need a quad-core CPU to play some gay-ass jQuery animation without killing my computer.
- )};)}};):}[];}
- Immensely retarded scoping rules? Lexical scoping? Yeah, fuck you, hoisting and shit because why the fuck not.

Are you serious? Look at what your San Fagsisco friends are using.
nativescript.org/
facebook.github.io/react-native/
phonegap.com/

Holy shit, fuck off. Don't fucking use it if you don't like it. It's really that simple.

I have no choice because it's the only language that exists client-side. I wouldn't be so fucking butthurt if there were something else, but all the curryniggers and SF hipsters are so in love with it that we're stuck with it forever.

You probably know this already but what about TypeScript? Maybe that would make it a bit more enjoyable

this has just made everything even more "what the actual fuck"

JavaScript just sucks. Especially how it tries to somehow sort of be kind of object-oriented

>this has just made everything even more "what the actual fuck"
I don't understand why so many people think this is a big deal, it's really not that hard to understand

I depend on it, yeah. There's no other sane way to program client-side without wanting to kill yourself. The underlying language is still a mass of festering shit though, and something as dumb as agar.io rapes the shit out of a dual-core CPU.

There's something many people in this thread don't realize: having dynamic programmable rich web documents is amazing. What isn't amazing is JS, the only language we have for doing that. It takes a really fucked up Stockholm syndrome suffering currynigger to enjoy writing 10+ lines of JS.

My room has a broken window and my guests complain about it when it's winter time. I don't understand why they think it's a big deal, just wear a coat. It's not that hard to do.

Your shitty analogy has nothing to do with how OOP works in JS

This thread and everyone in it is pretty much a disaster. Never ever have an opinion on anything you dumbasses lmao

you too.

JS is inherently antihomosex which is why should stand firmly against the homophobic javascript users.

Or at least disable js in your browser if you support the LGBT cause.

it's a virus language

...

What's actually wrong with it?

People trying to use it to do things it wasn't designed to do.

People wanting it to be Java when it's not Java.

People wanting it to be a FP language when it was written to be something like a FP but not FP.

People not understanding it so they write shitty code or code that breaks in ways that are easily avoidable and exist for specific reasons, they then make fun that it broke because it was designed that way.

People who make fun of full freedom because they don't fully trust themselves or the people on their team.

Its not backend javascript that makes most web pages slow bloated garbage though.

>no types
>no threads, fuck callbacks up the ass
>no enforced class structure like C# or Java, not that it really fucking matters because theres no types. Noone wants to play guess the object type.
>barebone class libraries... jQuery IS the fucking class library
>no access modifiers, public private protected and package? nope

And the worst thing is that some people think this pile of dogshit makes a good server side language aka:node.js

If the client fucks up whatever, nobody gives a shit. The server though? The thing that deals with ALL the clients. The thing that deals with the database. The thing that really really shouldn't fuck up. Yeah it should be a strongly typed OO language like C# or Java. JavaScript belongs nowhere near the goddamn server.

It's a kludge designed to win Netscape the browser wars, and it's quite obvious that it's not very well designed.
The fact that edgy millennial hipsters use it for literally everything (including server-side scripting and fucking desktop apps) is not a flaw of the language itself but still makes me want to nuke the whole planet.

Mexico tax system software is based on java
juanito the mechanic has to log into the webiste to do his taxes
>you must install java to view this site
>you must install silverlight for this site
>chrome no longer supports java on this website
>explorer is too old for java, please upgrade
>juanito needs to buy new computer and hope it works
>cant use cellphone or macs
jesus christ how horrifying

>java
are you retarded? this is a javascript thread.