[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Redpill me on Node, /g/
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 113
Thread images: 11
File: 1436439824nodejs-logo.png (14 KB, 600x300) Image search: [Google]
1436439824nodejs-logo.png
14 KB, 600x300
Redpill me on Node, /g/
>>
cancer
>>
CALL BACKS
A
L
L
B
A
C
K
S
>>
File: 1459975898449.gif (971 KB, 270x252) Image search: [Google]
1459975898449.gif
971 KB, 270x252
Makes JS the fastest interpreted language by a long shot.

Bridges the gap between front-end and backend developers.

Consistent code between front-end and backend, also reusable.

People who hate JS typically have very little experience with it and can't get around its duck typing, prototypal inheritance, callbacks, and other functional aspects like first first class functions. They also get really confused with closures.

I'm guessing it's because they come from a language like Java and C++ and they see the familiar syntax but soon realize it takes more than 5 minutes to learn despite other similar people telling them it's a shallow language.
>>
File: lua.jpg (149 KB, 914x897) Image search: [Google]
lua.jpg
149 KB, 914x897
>>53912704
>Makes JS the fastest interpreted language by a long shot.
>>
>>53912624
Shitty technology for losers who can't get into some normal one. Using js when writing back-end is silly, the technology has been invented for stupid hipsters and other subhuman shit. Also Node doesn't even have multithreading, it has so called asynchronous feature, but you won't have some shared objects in you app because of that and etc. Personally, I don't like js because os architectural errors and the world around it, it will die when web assembly releases.
>>
>>53912764
Also, forgot to add, nodejs is cancer
>>
>>53912704
how is it for just getting (web) shit done compared to python

i want to create a website/app all in one language
>>
)};)};)};)};)};)};)};)};
>>
>>53912789
Pretty much the same shit. Just use Express for your API, Mongoose for ODM, and serve your static files however you want.
>>
>>53912704
The real problem I have with JavaScript and Node is that the documentation is always garbage.

Even fucking Google's Polymer API has shit documentation.

Nobody that develops for JS and JS accessories ever seems to have it in their head that they should document every little fucking thing, otherwise I'm left wondering what the fuck a function returns or how this asynchronous function interacts with this array of async functions and callbacks, because nobody documents exactly what happens to the callback, or what the callback as a function does.

MSDN documents are perfect in comparison. They may have too much goddamn detail but at least I know what I'm looking for is in there somewhere, instead of going on a goose chase for information that doesn't exist.
>>
I personally prefer static typed languages (TypeScript looks interesting). With untyped languages like Javascript is easy to make a mess once your application starts to grow, especially if you have subpar programmers on your team.
>>
>>53912704
>Bridges the gap between front-end and backend developers
If you weren't a retard you could learn and use more than one language
>>
File: 1459975540686.gif (967 KB, 270x252) Image search: [Google]
1459975540686.gif
967 KB, 270x252
>>53912834
Well, then the question is whether or not it's better to have 1, 2, 3 or x number of languages for your CRUD app. I suppose you can use 2-3 languages but what's the benefit? Does it improve your developers' workflow? If it does, then okay, but Node.js was a solution for people on Rails and PHP. People that are usually webshits and not more formal software engineers and having them write in more than 1 language is probably against good judgment.
>>
>>53912834
Why would I want to have those retard frontend devs working on the backend anyway?
>>
>>53912624
C A N C E R
A
N
C
E
R
>>
File: Node.png (79 KB, 1010x861) Image search: [Google]
Node.png
79 KB, 1010x861
What is going on here?
>>
>>53912764
top kek
>>
My dad took a 2 month bootcamp is now a freelance web dev making $500/week for a few hours of work in Wordpress. I'm sitting here in my 5th year trying to get my CS degree and I make $-60,000 a year.
>>
>>53912992
What takes your dad 2 months also takes some random faggot off the street in India 2 months.

He may be making $500/week, but it's incredibly unstable income.

Don't confuse monkey work for skilled labor.
Skilled labor requires education, monkey work requires training. Your dad received training, not education.
>>
>>53912624

Choose one:

>"Hey guyz, I want to make Websites!"
>"Oh well, you need HTML and JavaScript.."
>"I know both!"
>".. AND PHP or Ruby+RubyOn Rails... Have fun, it will take some moth to learn it!"

Or:

>"Hey guyz, I want to make Websites!"
>"Oh well, you need HTML and JavaScript.."
>"I know both!"
>"You're done."
>>
The whole Node.js ecosystem is pretty nice when it comes to creating web applications because it has modules for everything. Need a quick way to turn html into pdf and send it to AWS S3? Install two modules, bind them together with a couple of lines and that's it.

Also the very asynchronous nature of JavaScript is a blessing when it comes to API development. Couple that with functional programming style and your code is super easy to read. The same thing written in Scala would look like a monster from the deepest pits of the Abyss.

It's also worth nothing that with modern tools you can write generic functions to be used in the front-end and the back-end, import them to wherever you need and let the build tool handle the rest. No copypasting required.

There are more modern and nicer languages available out there, but it's hard justify using them in some cases if Node does the same thing three times as fast.
>>
File: 1429592354579.gif (1 MB, 260x173) Image search: [Google]
1429592354579.gif
1 MB, 260x173
>>53912920
Node was derived from chrome's javascript engine.
It spawns just as many child processes as chrome does.
>>
>>53913264

How do I turn it off?
>>
M
E
M
E
>>
>meme language for hipsters.
>meme language teaches a whole new generation of programmers the worst programming practices all in one go
>meme language breaks because of a million dependencies
>meme language requires a million dependencies, even for things like removing spaces and line breaks because developers don't know how to do that themselves.
>meme language makes wordpress managers put "backend/full stack developer" on their resumes despite not knowing/giving a fuck about the complexities that lie ahead.
>meme language is meme language fucked up by naive directors who are too young to run a project this size
>meme language already fucked up by SJW and politics due to the insanely low entry level requirements
>meme language
>>
>>53912624
>Redpill me
fuck off back to /pol/ and suck my cock.
>>
>>53913211

Rails dev here

Both Ruby and Rails are fucking easy to learn

Compared to JS where I never taught myself more than what I learned in a single module on web development at university. JS has loads of bullshit going on that I don't need to know about because all I do is manipulate DOM elements with jQuery, which is easy as fuck.

The point is, there's no difference in the amount you learn. If you use node then you're going to have to know JS really really well, and it's no more effort to learn something fucking easy like Rails.
>>
>>53912704
>Makes JS the fastest interpreted language by a long shot.

That's because it's JIT-compiled and not interpreted. And it isn't the fastest JIT-compiled language by a long shot.

People who hate JS typically know that those properties are shit.

You guessed wrong, faggot.
>>
>>53912624
Check out the latest disaster of npm, it represents node.
>>
>>53912679
this, at the beginning I never used callbacks, then I started learning them and now I kinda feel like I can't program without using callbacks all the fucking time, it's kinda like I fucking forgot how to do shit without callbacks, it's pretty weird and annoying
>>
>>53913807

> manipulating DOM elements with jQuery

bro do you even React
>>
>>53913956

promises
>>
File: clairie_not_doing_well.jpg (93 KB, 828x581) Image search: [Google]
clairie_not_doing_well.jpg
93 KB, 828x581
npm install -g apache-cordova
on windows works great, on linux 200 errors even after chown change

wtf npm, I tought that you are hipster macbook cli
>>
So many memes. Fuck webshit
>>
>>53912679
RXJS
R
X
J
S

or promises.. stop being noob pls
>>
>>53912789
that's why we use it full stack on the enterprise I work with (10k+ employees - major broadcasting brand)

and that's why as a senior full stack JS developer with 9 years of experience my linkedin is pic related
>>
>>53912624
dont ask it on /g/ ... just a bunch of basement neets who thinks programming is about writing pointless exercises in badly written C, no one actually worked as a developer
>>
>>53913264
false

node uses v8 to interpret but it doesn't spawn threads by its own, you probably have an application that is not shutting properly or something that's spawning stuff

also.. why are you using node in windows? seriously?
>>
>>53913111
false, you clearly never had anything to do with outsourcing project to pajeet... indians programmers are starting using pc around 20 or more so it's a whole other world

anyway wordpress is so widely used, you're not a "real" developer but it gives a good income and you can learn from php and step up out of it (like I did after 4 years of php)
>>
>>53913956
rxjs or promises... are you fucking kidding me? all the poinds neets are making on this thread are absolutely false
>>
>>53913956
promises are now native on JS why not use them

I use native JS as much as I fucking can because i despise meme frameworks and tacking bloat on
>>
>>53912704
>can't get around its duck typing
var PI=((++[+[]][+[]]+[]+ ++[+[]][+[]]+[])* ++[+[]][+[]])*(++[+[]][+[]]+ ++[+[]][+[]])/((+[+[]]+'x'+(![]+[])[[+!+[]+!+[]]*[+!+[]+!+[]]])/(++[+[]][+[]]+ ++[+[]][+[]]));

> '5' - 3
2 // weak typing + implicit conversions = headaches
> '5' + 3
'53' // Because we all love consistency
> '5' - '4'
1 // string - string = integer. What?
> '5' + + '5'
'55'
> 'foo' + + 'foo'
'fooNaN' // Marvelous.
> '5' + - '2'
'5-2'
> '5' + - + - - + - - + + - + - + - + - - - '-2'
'52' // Apparently it's ok

> var x = 3;
> '5' + x - x
50
> '5' - x + x
5 // Because fuck math
>>
>>53912624
>Redpill
>>>/pol/
>>
>>53914367
> does not use es6
> haven't read js the good parts to avoid these problems in es5
> does not know how to handle duck typing
>>
>>53914266
Babel disgusts me too
Nodejs are of course worse and more sheep like than the Ruby guys so good luck working on a project that doesn't use this bloatshit
>>
>>53914732
I've never heard of that one, surprising as i'm meant to be a webdev

>went to their website
>see this

[1,2,3].map(n => n+1);

and you get!!!

[1,2,3].map(function(n) {
return n+1;
});


why would you want this? i don't understand
>>
it's from the shit time between 2012 and 2015 when redditors thought js would replace everything
>>
M E M E
E
M
E
>>
>>53914367
>look mom, I do subtractions using strings and numbers
>ima pr0grammer
>I'm also adding a bunch of parantheses and brackets
>I'm such a l334 h4ckzorz mom
>>
>>53912920
You started a shitload of node processes and took a screenshot.
>>
File: 1459441056290.png (312 KB, 506x662) Image search: [Google]
1459441056290.png
312 KB, 506x662
>>53914797
> fast forward to 2016

JS is replacing everything (nwjs|electron (desktop) / react native|phonegap (mobile) / node (backend) and obviously frontend

tons of JS jobs everywhere around the world, paying up to £700-800/per day

yeah it feels really bad to be a full stack js dev
>>
>>53914005
> does not not how npm works
> does not now he's supposed to use nvm to have multiple versions of node and npm on the same machine (if you work for real, it's mandatory)

yeah you're good
>>
>>53915585
https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript

Fairly silly, but nice talk nonetheless.
>>
>>53915659
> xs = ['10', '10', '10']
["10", "10", "10"]
> xs.map(parseInt)
[10, NaN, 2]

Javascript.
>>
>>53915659
> from pycon
> 5 people wrote a line of js code in the last year out of hundreds
> does not consider ES6/7 and the evolution of the language

yeah, no


>>53915682
the second argument of a map is the index, the second argument of a parseInt is the radix

use xs.map((x) => parseInt(x))

do you guys want a lesson? I can teach you the "easy meme language" you don't know how to write
>>
>>53914005
npms are with sudo
>>
>>53915729
no they are not, it should use nvm which creates bindings to a folder in your home, you should never use sudo
>>
>>53915717
>yeah, no
Javascript is portrayed in a positive light in the talk.
>>
>>53915637
>lel
I typed apt-get install npm, then I type npm install -g apache-cordova

do I really have to know each tools from inside to be able to use it?
aptitue or pacman works great
>>
>>53915959
if you have a wrong node installation yes

anyway, just use sudo if you can't copy paste 1 line of curl call to install nvm

apt is mostly outdated, so dont use it to install interpreters. If you do the same with ruby (you should use rvm) or python (you should install it via virtualenv)

also, npm is not a standalone package since at least 2 years or more, so you just need to install node and you'll have npm

so.... why blame js if the problem is exactly between the keyboard and the chair?
>>
does nodejs have co-routines yet?
>>
>>53916052
it's web scale
>>
>>53916052
samefag, looks like it has generators
>>
>>53915659
this was good
>>
>>53914874
He's not trying to prove he's a l33t hackz0r. He's showing you how retarded javascript is
>>
>>53913991
You don't need something like React if you make something simple like a website with a toggleable menu and perhaps some form validation
>>
>>53917087
> 2016
> not building universal SPAs

anyway... just use youmightnotneedjquery.com and you'll see that nowadays you won't need jquery anymore, react is cool for forms and simple things as its just a view layer, best if you use redux

or just keep it standard client-server like in the 90s

> react 60kb vs jquery 250kb
>>
I downloaded https://nodejs.org/dist/v4.4.2/node-v4.4.2-linux-x64.tar.xz

but my sha1sum node-v4.4.2-linux-x64.tar.xz is completly different than
https://nodejs.org/en/blog/release/v4.4.2/

what is this sorcery?
>>
meme desu
>>
File: 1458848577341.gif (798 KB, 600x505) Image search: [Google]
1458848577341.gif
798 KB, 600x505
>>53912624
JavaScript is cancer.
>>
>>53919436
Why?
>>
>>53914085
>using linkedin
oh vey
>>
>>53914367
jesus what the fuck
>>
Node/JS in general is the best for actually getting worm done. Only turbo autists care about how shitty JavaScript as a language is desu.
>>
>>53920209
>not using a full-stack framework instead
Literally why?
>>
>>53912704
>because they come from a language like Java and C++ and they see the familiar syntax but soon realize it takes more than 5 minutes to learn despite other similar people telling them it's a shallow language
This was my experience with it. There's a lot more to it than just the basics.
>>
>>53912764
>"it has so called asynchronous feature"
>english that is this broken
DESIGNATED
>>
>>53912808
>The real problem I have with JavaScript and Node is that the documentation is always garbage.
That's a side effect of it being so new. Compared to languages that have been around for 10+ years, it takes time to document everything.
>>
>>53912881
Because then you wouldn't have to hire more people and can save money.

>frontend devs need more money to jump to backend
Contracts, bro.
>>
>>53912920
You jizzed all over node.js like the bitch you are.
>>
>>53920684
SHITTING
>>
>>53913577
>"meme language requires a million dependencies"
>"even for things like removing spaces and line breaks because developers don't know how to do that themselves"

>implying this isn't the "unix philosophy"
>>
>>53914060
>not working at a midsized startup
>not earning 6 figures before the big bust
>not investing those 6 figures wisely before the bust
You have literally nothing to lose by learning webshit.
>>
>>53920012
>not having a job
>>
>>53920838
This. I did application dev for 10 years as a hobbyist and dreaded web dev. Now I do webdev as a job and it's easy as tits and rakes in the cash
>>
>>53920784
STREETS
>>
I like my node.js

Writing front and backend for small projects inside the same project folder feels really refreshing. Writing in just one language feels just right.

Sure javascript is not the fastest language when it comes to computing. If you had to write a server program which calculates a complex route on a map you would not use js but most of the time webservers just publish and transform data from the db. For this tasks node is just fine. The projects are very lightweight which makes coding a breeze.

Previously I was coding C# back-ends which was okay. But 99% of the time there was an enormous coding overhead involved and it still wasn't as fast as node. End of the story: node.js is here to stay.
>>
>>53912744
It's true, LuaJIT still eats V8 for breakfast.
>>
>>53920048
It's all true.
https://www.destroyallsoftware.com/talks/wat
>>
>>53920862
>needing linkedin to get a good job
>>
>>53921283
>The projects are very lightweight which makes coding a breeze.
Most node projects I have seen can not justly be called lightweight. Lots of tiny dependencies to get "nifty" functions and other shit because the stdlib is so lackluster, making it hell to maintain when things get dropped or whatever.
>>
http://www.haneycodes.net/npm-left-pad-have-we-forgotten-how-to-program/
>>
>>53913956
Coroutines.
>>
>>53916863
Except if you actually know JS all these conversions make sense. You can shit talk a language all you want but it shows just how much you actually know. You're pretty much nothing more than a language shill.
>>
>>53921626
It's a choice to add left-pad as a dependency. I would not.
>>
>>53922995
They makes sense because they're specified, but who in the god damn motherfucking world uses this behavior I would like to know.
>>
>>53923020

It's an anti-pattern to use implicit type conversions. Only a junior developer would code like that.
>>
>>53922857
>Coroutines
Too bad so few languages support it.
>>
It really is a meme language and ecosystem desu
>>
I can get a simple rest API running in less than 3 minutes with it, what other language/technology lets me do that?
Yeah
>>
>>53923700
Any language/framework if you know how to use it
>>
>>53914367
>doing arithmetic with strings

durr herp derp
>>
I make 130k doing fullstack JS as a consultant.

Recently on my new project I've been moving to typescript. Angular 2 and nativescript supporting TS as a first class citizen will do wonders for its adoption. Plus the overhead it relatively low, you can add types progressively so new developers are not constrained by the type system.

That in combination with understanding promises/generators as well as observables and JS is a great language to get shit done. The real pain comes from developing with other developers who are mostly retarded, use callbacks everywhere, and abuse every dynamic aspect of the language.

I think Java was created to stop these retards from ruining things.(Most of /g/ falls into the retard category)
>>
LuaJIT and the JVM shit on V8, as well as any AoT compiled language. JS (ecmascript generally) is far from being a good language even if it improved during those last years. Why would you use node at all? There's no proper reasons nor any use case to it. This is incomprehensible.
>>
What's the best way to into Node + React + the larger JS ecosystem?
>>
>>53924849
>Angular 2

CANCER CANCER CANCER
>>
>>53924849

>>53925764
This. My company scrapped projects due to how shit Angular was
>>
>>53912704

We hate JS not because of duck typing, but because of weak typing. == is completely unusable because it's not transitive and thinks strings and numbers can be equal. It also doesn't have a real integer type. Everything is stored in IEEE doubles.
>>
>>53925161
>same language for frontend + backend
Only reason I need.
>>
>>53927792
Doesn't matter how it's stored, V8 optimizes shit so well that while it looks like doubles to the programmer, it's really being stored in the best possible numeric container
>>
>>53923052
It's retarded to use languages with weak dynamic typing. Not even a junior developer would code like that.
>>
>>53924554
kek
thats not the point dumbfuck.
Thread replies: 113
Thread images: 11

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.