[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

What's wrong with JavaScript

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 108
Thread images: 8

File: javascript.jpg (95KB, 400x400px) Image search: [Google]
javascript.jpg
95KB, 400x400px
So, what's wrong with it?
>>
>>57427828
Everything.
>>
>>57427828
Overused.
>>
>>57427891
>>57427901
I'd like to read more detailed answers.
>>
most of it is non-free
>>
Always run into problems with the duck typing
>>
>>57427828
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.
>>
>>57427828
its not oop

we'll you can make it pretend to be.
also some bullshit stuff with regards to "truthiness"
>>
>>57427828
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.
>>
>>57427828
Node.js is cancer.
>>
Literally the only thing wrong with javascript ecosystem right now is web devs. They're all retarded 2bh
>>
>>57428678
Good for prototyping
>>
>>57428678
Node.js != JavaScript
>>
>>57427828

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
>>
>>57429030
What I'm more confused by is
"True" == True returns true
and 1 === True returns false
>>
>>57429030
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;
}
}


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

== With type conversion
=== Without type conversion
>>
>>57429119
I'm retarded
function Object(name, num)
{
this.name = name;
this.num = num;

this.getName = function()
{
return this.name;
}
}
>>
>>57427828
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.
>>
>>57429119
The fact, that class or object isn't a function is fucking confusing.
>>
>>57429179
>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.
>>
>>57427828
Javascript caused this. >>57429185

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.
>>
>>57429184
>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
>>
>>57429179
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.
>>
>>57429179
I bet you don't even know what AJAX is
>>
>>57429204
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.
>>
>>57429285
>>57429293

someone got triggered
>>
>>57429310
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.
>>
>>57429412
>The thing about loading times is also not really an argument against JS:

Actually that is a great argument against it.
>>
>>57429442
You're very ignorant. You wouldn't even be able to update a thread on 4chan without reloading the entire page if you don't use JS. Do some research before you talk shit.
>>
>>57429119

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
>>
>>57429473
>You wouldn't even be able to update a thread on 4chan without reloading the entire page if you don't use JS

What exactly would be wrong with that?
>>
>>57429494
>like fuck.event = {...};
That's not the same thing. That's creating an object without a constructor.
>>
File: 1466691383670.jpg (14KB, 300x301px) Image search: [Google]
1466691383670.jpg
14KB, 300x301px
>>57429504
>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.
>>
>>57429551
>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.
>>
>>57428704
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.
>>
>>57429508

So if you have an object without a constructor it is a var but one with a constructor is somehow a function?
>>
>>57429592
Oh god please no, just limit anything web devs can touch. They cannot control themselves.

>>57429348
The anon who got corrected? Yeah you're right.
>>
>>57429588
Again, I completely agree that it's overused, but you just can't remove it on every site without sacrificing a *lot* of convenience.
>>57429597
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.
>>
>>57429504
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.
>>
>>57429597
In JavaScript functions can be assigned to variables, so they're both functions.
>>
>>57429679
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
>>
>>57429641

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.
>>
>>57429714
>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.
>>
>>57429656
Some common sense in this thread, congrats.
>>
>>57429412
>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.
>>
>>57429641
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.
>>
>>57429946
Exactly, I was arguing in favor of JS
>>57429985
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.
>>57429990
The result is the same. Both Cat objects are the same.
>>
>>57427945
Everything is wrong with it.
>>
>>57430420
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.
>>
>>57430519
>
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.
>>
https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.sl53shu17
>>
>>57430578
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
>>
>>57430758
>it's fucking slow as shit
The V8 engine is actually very fast, and often much faster than Python
>>
>>57430793
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
>>
>>57430819
Fair enough, but I think it's also because huge scripts use a fuckton of RAM
>>
>>57430793
L M A O
M
A
O
>>
>>57430819
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.
>>
>>57430860
Of course it's not as fast as C you fucking retard. It is however fast for a scripting language and faster than Python.
>>
>>57430911
Why are you comparing with Python?

For web pages JS is usually clientside and Python is usually serverside
>>
>>57431128
I know but >>57430758 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.
>>
>>57431173
Doesnt matter.

Compare it with other CLIENTSIDE languages.
>>
>>57431232
JavaScript can run on the backend so my argument is perfectly valid.
>>
>>57431232
There is only 1 'Clientside' language. JS.
>>
File: huhdog.gif (54KB, 320x240px) Image search: [Google]
huhdog.gif
54KB, 320x240px
>all this stockholm syndrome from gay hipsters and curryniggers
Holy mother of fuck, how can anyone defend this slow, weakly-typed ass pull seriously?
>>
>>57431368
>all this stockholm syndrome from gay hipsters and curryniggers
/thread
>>
>>57431368
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.
>>
>>57431400
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.
>>
>>57431459
If you want to browse static documents then use a pdf reader.
>>
>>57431478
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.
>>
>>57431479
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.
>>
>>57431478
>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.
>>
>>57431530
Not every website is like this. You need it on 4chan to update a thread, that would be a very useful example.
>>
>>57431530
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?
>>
File: backtoreddit.png (285KB, 496x472px) Image search: [Google]
backtoreddit.png
285KB, 496x472px
>>57431510
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. http://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.

>>57431547
Are you serious? Look at what your San Fagsisco friends are using.
https://www.nativescript.org/
https://facebook.github.io/react-native/
http://phonegap.com/
>>
>>57431639
Holy shit, fuck off. Don't fucking use it if you don't like it. It's really that simple.
>>
>>57431735
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.
>>
>>57431765
You probably know this already but what about TypeScript? Maybe that would make it a bit more enjoyable
>>
>>57429641

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
>>
>>57431820
>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
>>
File: rmswater.jpg (1MB, 2272x1704px) Image search: [Google]
rmswater.jpg
1MB, 2272x1704px
>>57431807
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.
>>
>>57431842
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.
>>
>>57431906
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
>>
>>57431953
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
>>
File: 1454993248674.jpg (58KB, 480x480px) Image search: [Google]
1454993248674.jpg
58KB, 480x480px
>>57432317
>>
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.
>>
>>57431274
Its not backend javascript that makes most web pages slow bloated garbage though.
>>
>>57427828
>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.
>>
>>57427828
>>57427945
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.
>>
>>57427828
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
>>
>>57434374
>java
are you retarded? this is a javascript thread.
>>
>>57434374
>he fell for the java ==javascript meme
>>
File: 02254903.png (10KB, 771x711px) Image search: [Google]
02254903.png
10KB, 771x711px
> currently learning node js and express
If it's so bad tell me what should I use, PHP?
>>
>>57434395
>*java===javascript
>>
>>57434306
Please never ever comment on /g/ again. We don't need retards shitting up threads with their retarded and incorrect viewpoints. Thank you!
>>
File: 20071386.jpg (89KB, 400x400px) Image search: [Google]
20071386.jpg
89KB, 400x400px
>>57427828
yall niggas need typescript
>>
>>57430578
have you done OOP in any other language? they are not the same
>>
>>57434427
Here we have a specimen of the typical JS programmer.

A well constructed and well thought out rebuttal. 11/10
>>
>>57434453
Technically typescript is the cause of javascript's cancerous nature
>how do I pretend to be oop
Thread posts: 108
Thread images: 8


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.