[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]

Explain the hate for Javascript >As powerful as lisp >High

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: 31
Thread images: 7

File: téléchargement (1).png (2KB, 225x225px) Image search: [Google]
téléchargement (1).png
2KB, 225x225px
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
>>
Probably mainly leftover hate from the dark ages pre-ES6+ / modularization / Crawford-ish functional-evangelism
>>
>>60555183
"Backend" baka. I love JavaScript but it's not backend
>>
>>60555234
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.
>>
>>60555183
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
>>
File: zuker.jpg (83KB, 768x432px) Image search: [Google]
zuker.jpg
83KB, 768x432px
>>60555183
>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 /g/ has never actually used it and especially not in an actual job. most of /g/ just does the exercises in K&R then calls themselves programmers
>>
>>60555183
I've been using c# and its comfy as fuck compared to JS.
>>
>>60555286
>>60555286
Sort array of numbers?

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

array.sort();

litteraly it
>>
>>60555183
>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
>>
>>60555348
Found the neet

>inb4 that's in the spec
I know, which makes it even sadder than PHP
>>
>>60555476
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
>>
>>60555476
Sweet mother of fuck it's real
>>
>>60555692
That is bug-as-a-feature level thinking. Stop that.
>>
File: javascript bingo.png (6KB, 674x633px) Image search: [Google]
javascript bingo.png
6KB, 674x633px
It's completely inconsistent in its behavior in even the most fundamental ways.
>>
>>60555742
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.
>>
File: javascript.png (32KB, 576x402px) Image search: [Google]
javascript.png
32KB, 576x402px
more inconsistency
>>
>>60555802
My favorite:
typeof NaN
// "number"
>>
>>60555704
Yes, the spec states that sort() converts values to strings before comparing. What other language does this?

>>60555692
>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.
>>
>>60555692
>return this.sort()
If you passed in 12 and 2 to this, would it not just still return it sorted as 12, 2?
>>
File: 1495046648658.png (281KB, 500x500px) Image search: [Google]
1495046648658.png
281KB, 500x500px
>>60555840
I now believe javascript is worse than PHP
>>
File: lol-27.jpg (92KB, 400x801px) Image search: [Google]
lol-27.jpg
92KB, 400x801px
>>60555183
>As powerful as lisp
lol. They both have closure after all, amirite.
>>
>>60555692
fuck that
>>
>>60555895
It's passing a comparator function (which probably should be extracted, incidentally) to sort, so it's using that instead of the default.

>>60555862
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.
>>
>>60555802
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
>>
>>60556123
Javascript was written in like a week and was heavily influenced by various stimulants. Be nice.
>>
>>60556123
>>60556151
Actually a pretty interesting history:
https://www.youtube.com/watch?v=t7_5-XYrkqg
>>
>>60555476
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).
>>
>>60556151

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
Thread posts: 31
Thread images: 7


[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.