What do you think about nodejs?

...

Other urls found in this thread:

laracasts.com/series/learn-vue-2-step-by-step/episodes/22
twitter.com/NSFWRedditImage

Its shit. Nothing is stable, all packages interfaces are constantly changing and breaking. The python community looks like a well planned orchestra compared to npm.

Its great.

The language runtime itself is fine and has a lot of neat and expressive features that manage to be fairly performant in a lot of cases.

npm is kind of an awful clusterfuck but it's fairly easy to avoid the worst of it.

It's comfy to be able to do fullstack in javascript.

What surprised me about node is that it's not hard to write, but it's much harder to reason about what your code will do.

I'm not a big fan of the proliferation of dependencies, but at least this shows there is a huge ecosystem for everything you need.

On the other hand, this tends to make devs lazy and just take everything for granted, instead of building things themselves.

try using yarn

>literally npm with caching

Node.JS is rotten from the top down.

1. Javascript is a pretty bad language with lots of thorny corners and missing API's in the standard library. ES6 is helping remedy some of this. However...
2. The combination of Javascript and Node.JS's API is completely ill-suited for writing concurrent applications. EVERYTHING has to be written in a sissiphysian asynchronous style with 3-4 different styles of exposing said asynchronous functionality from libraries, spotty asynchronous error handling, and very little help from the language itself.
3. The Node.JS ecosystem moves at way too quick a pace. Libraries fall in and out of favor too quickly and there's no such thing as "stability". I'm not even sure a Node.JS application written a year ago would run on a recent release with up-to-date libraries without some serious upgrading pains.
4. For what most people are doing, Node.JS's method of programming your own event-driven HTTP server is 100% overkill and completely unnecessary. You could use the traditional CGI-style request model in a language like PHPerubython safely proxied to by nginx or apache and save yourself tons of headache.
5. If programming your own event-driven HTTP server is NOT overkill for what you're trying to do, languages like Java, C# and Go gives you language stability, a plethora of mature libraries (or in Go's case a comparatively nice stdlib) and sane concurrency features that the language actually works in tandem with.

Question, I currently know rails, and a fair bit of php, is it worth learning node, or should I simply finish off php (I'm still unclear on many things).

Unless you are specifically looking to hop on a bandwagon for job purposes (and honestly, I couldn't imagine writing Node.JS professionally, it'd make me go insane), stick with PHP. Like I mentioned node is overkill for 99% of things, and PHP is not going away anytime soon.

call me a retard but why would a package manager need caching?

Just the idea of using js as your backend should make you want to throw up.

node dindo nuffin wrong

exact opposite experience here. probably because im on windows regarding python package issues

i dont know what youre using that unstable on node side though. you know what youre getting into if you look up anything you install

is there a point of comparison for a good package manager? ive found npm to be by far the best of any i've tried. the few issues i had all predate 3.0

homebrew

>JS
>standard library

You know how I know you're full of shit?

>ES6
>APIs

>language
>APIs

uh i meant for a programming language

my rundown:

pip (i want to kill myself)
nuget (is good majority of the time but sometimes fucks up project dependencies)
mix (havent had issues but isn't nearly as convenient as others

cargo has a few minor problems but is generally pretty good

I recently chose node.js for a web server because I saw numerous reports that it was quite a bit faster than PHP+Apache or PHP+Nginx or PHP+whatever.

Besides speed, the other important factor for me was ease of installation, and if I can simply have the user to do a "apt-get install nodejs", and require no further configuration, then that's a big win.

>node is overkill for 99% of things, and PHP is not going away anytime soon.

As far as I can tell, if you want your project to be installable on shared web hosting, it must be PHP. Nothing else besides PHP is universally available on shared hosting.

And there's no way a shared hosting account is going to allow a user to run a node process -- and even if they did, it would necessarily need to use a weird port number, with some way of allocating port numbers to the different users. That ain't ever gonna happen on shared hosting.

If you want to run node, you absolutely must have a VPS, or some other situation where you have root login privileges. And that loss of flexibility means that node is probably never going to be a realistic alternative to PHP. If somebody wants to develop a language to unthrone PHP, they will need it to be a module for Apache and Nginx.

most peoples opinion is gonna be based on when they started webdev

there's not much incentive to switch from your own primary backend language because most people aren't doing very complicated backend stuff to begin with

hence php programmers come on here and say its shit and there's no point to bother, while newer webdev folks like me arent invested in php and choose the more modern language

the benefit of node is that npm is gigantic. you basically never run into the "is there really not a library for this?" in node. this lets you scrap together shit extremely quickly. it's on a different level when it comes to prototype speed

also something to note is that node ranks among the highest in tech satisfaction surveys. in other words, the people that don't like node are not the ones using it

It has neat automation tools.

It does?

>python3.x hater detected

Same as ruby
> autistic tool for autistic kids

>uglify your JS code to make it difficult for people to steal it
>automatic language styling
>automatic compilation and deployment
>etc.

It's great for quickly hacking together a performant HTTP server for small projects but I laugh in the face of companies using Node for their core infrastructure. It's too unstable, and doesn't scale as well as well-written C++ and Go. Also JavaScript pls go.

>the benefit of node is that npm is gigantic. you basically never run into the "is there really not a library for this?"


NodeJS, the platform you choose when you don't actually know how to program, you just run what other people write.

>pip (i want to kill myself)

take it easy drama queen

>i like to waste my time writing shit thats already been written a million times before

suit yourself dood. id suggest picking languages that solve your actual problems instead of being a mong though

Lack of a good and usable SQL ORM is an absolute deal breaker for me.

Rails (Ruby) and/or Laravel (PHP) are what I'll use for anything that needs to talk to an SQL DB in the future.

But if MongoDB works for your purposes then, sure, Node can be cool.

LOOK AT ALL THE SHIT DEVS HAVE TO SET UP BEFORE EVEN STARTING A PROJECT

laracasts.com/series/learn-vue-2-step-by-step/episodes/22

Well fuck if that ain't the pot calling the kettle black.

Literally every other language already has implemented everything that node and npm and the js community are busy rebuilding.

>id suggest picking languages that solve your actual problems
>wager my livelihood against myself in favor of the perceived collective competency of the npm community

left-pad lives matter

you contradicted your last post then mong

>why innovate when you can reuse poorly implemented inefficient code written by someone with no accountability

NodeJS

Bit of a novelity to me personally and npm is out of control, packages need some kinda of QA system by the community to clean out all the rubbish.. In the wild I have only seen it used in dev environments for building/bootstrapping front end clients using grunt or something... as for backend I wouldn't even consider it on the server right now I'm moving into scala (play framework) after mastering and working with php for the last 5 years

I don't really care for it. All the callbacks and functions make the syntax look messy and unclean to me.

examples of your innovation? feel free to leave by your github

Actually I do have a couple packages published on npm, ironically enough. I'm not stupid enough to link them here though.

literally fixed in 10 minutes

ive used sequelize with postgres and it seemed fine

mongo for maximum convenience though

pic related: most nodejs developers

>an entire javascript ecosystem was rocked by a single package containing eleven lines, one single function, that went missing
>this is acceptable

>mongo for maximum convenience

Experiment time.

Step 1: Fill a mongo collection with hundreds of millions of records with a single indexed string field, populated by random hexadecimal strings ten characters in length.

Step 2: Execute a count operation where that field is equal to "AAAAAAAAAA" and wait literally minutes for it to complete because mongo traverses the entire index b-tree to perform a count.

Step 3: Execute a find operation where that field is equal to "AAAAAAAAAA" and specify a skip/offset of a few hundred million and wait literally minutes for it to complete because mongo traverses the entire index b-tree to perform a find with an offset.

Step 4: Lose your goddamned mind at how almost any other database, especially relational databases, can perform these operations in milliseconds.

it isnt acceptable, but it was fixed and isn't really relevant

its like citing shellshock for why you dont use linux. downy argument

>isn't really relevant

Your argument for using NodeJS is literally "it's easy, just use packages other people wrote" so how is it not relevant? This mindset will not work long term as evidenced by npm's clear lack of stability.

>shellshock is evidence of linux's clear lack of stability

see it's still dumb

youd have to have persistent issues for there to be "evidence" of what youre talking about. a thing happening is just a thing

But shards are the secret ingredient in the webscale sauce.

If /dev/null is webscale then I will use it.

Because Facebook is literally retarded and it doesn't solve anything other than Facebook's retarded special snowflake node.js usage.

yeah id never have 100mil mongo records

convenience means not mapping data around

My first experience with Callback Hell was with Node, and boy let me tell you I was not happy.
Living in 80 columns per line land was pure bliss until I stepped into the wonderful world of web development.

Shellshock was a Bash vulnerability, and yes, this among other things is an indication of the lack of stability in the open source community as a whole. Heartbleed went on for how long undetected?

Are you surprised to learn you can have linux without Bash? I mean, you are a NodeJS programmer, so it's hard to be sure without asking.

>yeah id never have 100mil mongo records

Buy my book --

MongoDB: Scaling and how it doesn't affect you (because mongo doesn't scale).

>id never have 100mil mongo records
Spoken like a true webdev

What sane person would develop a DB that isn't supposed to scale?

nothing you do scales either because youve never made anything noteworthy

youd rather theorycraft performance situations you've never experienced in practice while trying to be sanctimonious over programming languages instead of just getting shit done as quick as possible

ive used just about every major language extensively besides java lul

im sure whatever it is you use is totally "the best" in all situations imaginable though dood. you've found the secret

why would you require your user to install node on their own machine?

unless this lack of stability has influenced your use of these tools then what you are currently undergoing is a "non sequitur" which you havent picked up on in the past 3 (you)s for some reason

Node and non make it easy to quickly make shit and start distributing it.

Pretty nice. ES6 pretty much makes JavaScript a very competitive scripting language for sure. Also helps that it has a very fast Kit and is truly universal.

>youd rather theorycraft performance situations you've never experienced in practice

I have experienced this firsthand, sorry. Some millennial decided mongo was a great fit for a rather large dataset my employer manages. Hundreds of millions of documents later we're looking to replace it with a database that actually works.

Why should I even care if I can write java? I can make a hobby project using Spark, it is very easy. I can choose my templating language, whateverstuff.

The concept of having the language provide a package manager drives me up a wall. Why would you want to have some webshit's ruby script messing around with your root filesystem? Most Unix systems already have a package manager, and that should be the only tool that messes around with the software and libraries you have installed.

Using gem/pip/npm to make system wide changes just makes a mess, and makes your system harder to manage. It would be one thing if these tools had the sense to always install to the user's home directory. Instead, the default is usually to drop files into /usr/lib and sort them out never.

exactly this
/thread

This happens every time

>mongo traverses the entire index b-tree to perform a count

jesus, there's no indexes? how horrifying.

i would think there would be a huge incentive for someone to add indexes, even forking the whole project if necessary. keyed retrieval is such a fundamental operation.