js shills will defend this:
https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/
we get it, lambdas and closures are hard when you're coming from fizzbuzzing in C
>>58487112
does the fact a program is difficult to read make it better?
why not switch to brainfuck then?
or go back to basic and use goto
>smells like spaghetti
>tastes like spaghetti
>hurr durr let's call it with a new greek name
>>58487019
>spaghetti code
>not a single goto in sight
FUCK OFF STREETSHITTER
>>58487019
That's kind of disgusting.
The worst part is that you can write this better in Java:request.on("error", System.err::println)
.on("data", chunk -> body.push(chunk))
.on("end", () -> body = Buffer.concat(body).toString());
Now how the flying fuck did we get to the point where JS is wordier than Java?
>>58487019
>an protocol
>>58487019
Those are just examples
Use named functiona if you don't want to end up in the callback hell
>6 lines of code still manages to be spaghetti
these types of 'abstractions' are a lot like using big words in english. You may think you are smart for using them, but they convey the same meaning and everyone else will think you are autistic af
>>58487524
JavaScript can do this too:request
.on('error', console.log)
.on('data', chunk => body.push(chunk))
.on('end', _ => body = Buffer.concat(body).toString())
>>58487424
It isn't hard to read, you're just a babby who only has learned about imperative languages
>>58487424
You just don't comprehend the elegance of it.
I kinda pity you.
>>58487752
what it does I can understand putting some effort.
the elegance you mention is far beyond my sight. please enlighten me
>>58487786
Most js in a post-jquery, node and react-based world is naturally more elegant than ancient cruft of greybear terminal based gobbledygook.
>>58487655
es6 is a godsend desu