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

SPAGHETTI CODE

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: 14
Thread images: 3

File: pajeet likes this.png (13KB, 335x155px) Image search: [Google]
pajeet likes this.png
13KB, 335x155px
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
>>
File: 360px-Spaghettoni.jpg (39KB, 360x480px) Image search: [Google]
360px-Spaghettoni.jpg
39KB, 360x480px
>>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
Thread posts: 14
Thread images: 3


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