[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
Why does every web things need to have node js these days? Do
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: 85
Thread images: 4
File: nodejs-logo.png (14 KB, 600x300) Image search: [Google]
nodejs-logo.png
14 KB, 600x300
Why does every web things need to have node js these days? Do you use it for all of your projects? Does it add a lot of complexity to your stack?

What is your comfiest stack /g/? From server to css processor
>>
File: 1461886597973.png (47 KB, 698x832) Image search: [Google]
1461886597973.png
47 KB, 698x832
>>54303096
>Why does every web things need to have node js these days?
no idea
>>
>>54303096
It allows same people to write server side and client side logic. This is very important when you are a freelancer, you can be a one men army without learning two languages (lowers entry barriers), and is mildly important for bigger companies (your employees are more universal so it's easier to manage projects). Those advantages are helped by the fact that most web frameworks were bad anyway so it's not like nodejs+whatever is that much worse. Additionally switch to node is most of the time a business decision, and those are not made by people who know that much about programming.
>>
JS is easy (at least on the surface) and a lot of people know it - even non-programmers, like frontend developers. By bringing JS to the backend, everyone who can do JS, can do the whole stack. Cloud services take away the complexity of operations. The end result: People who were previously restricted to shifting pixels around are now empowered to build an entire application by themselves. And that's appealing.

Consequently, when looking into the Node ecosystem, you find a vibrant community of people building lots of awesome stuff. At least it appears to be awesome from the outside. I frequently have to read 3rd party Node code, and I've seen things I could only attribute to a monkey with a keyboard. Bad practices all over the place. Although is plenty of quality code too, a lot of the rest reeks of bad practices. That code was written by a person capable of the language, but ignorant of software engineering practices.

On the bright side, Node stuff is usually exceedingly well tested and people value strict CI and coverage tests. So if you're looking to use a Node library, it's pretty safe to do so, regardless of code quality.

I use Node in the build pipeline for browser-side JS and Sass, as well as for some server-side micro services with a very small interface and feature set.
>>
my stack is simple: mysql and php. if you need to use javascript for anything you've failed as a web developer.
>>
>>54303747
>php
You have no right to criticise javascript
>>
>>54303747
>mysql and php
Mate, you have failed as a web developer. MySQL is an RDBMS that doesn't scale, and PHP is the most inconsistent language ever to be created. You'd be better off with pretty much anything else, except for maybe Assembler, C or APL.
>>
>>54303807
>>54303810
sorry i cant take javascript 'developers' seriously after the leftpad fiasco.
>>
>>54303096
because npm allows javascript devs to remain lazy & stupid
>>
>>54303694
>VIBRANT COMMUNITY
>AWESOME STUFF

You're a web dev so I'm going to assume this means misplaced ideas that are inefficient or insecure when implemented using "web technology"

>lol guys i made zelda in html5
>>
>>54303856
Did you even read the post, you fucking faggot? Get some reading comprehension, retard.
>>
>>54303810
MySQL does scale if you use things like MariaDB or Percona. Nobody who knows anything about databases uses actual Oracle MySQL. MySQL is a term that refers to a family of products most of the time.
>>
>>54303820
Nobody cares. You use PHP, you have no right to criticise anybody's technology picks.
>>
>>54303883
I happen to maintain an application that evolved to handle a ridiculous number of rows. Traditional optimization doesn't work, MariaDB and Percona only reduce the problem a bit, and clustering is the thing I have yet to try. Should have used Cassandra from the start.

Moral of the story: MySQL may be nice and dandy as long as the application doesn't have high database load. And if you don't need a more standards-complient SQL feature set.
>>
>>54303883
>all that backpedaling
if someone uses MariaDB, he just says he uses MariaDB, he doesn't "refer to a family of products" that happens to be the name of other database. MariaDB or Percona aren't that good either btw
>>
>>54303923
Well ok but if you are going for cassandra then you load will break any popular databases used for web stuff, not only MySQL. That does not make that database bad, it just does not fit your use case.
>>
>they don't use GOlang for everything
>>
>>54303953
Postgres with hstore would have lasted longer, and possibly been sufficient. You do have a very valid point, though.
>>
File: elixir.png (74 KB, 400x400) Image search: [Google]
elixir.png
74 KB, 400x400
>>54303096
In all honesty, Elixir has replaced any need I had for Node on the server. Any advantage Node provides over more "traditional" server-side scripting languages (Python, Ruby, PHP) seems like fools gold next to what the Erlang ecosystem offers, and Elixir is the comfiest language therein.

JavaScript will always exist on the front-end, but I have no great love for it, and thus "Being able to code entirely one language!" provides me no particular joy.
>>
>>54303979
>JavaScript will always exist on the front-end
I'm hoping for asm.js to come through. No more nasty JS - just the language of your choice, compiled to a subset of JS.
>>
>>54303747
I use mainly Perl and MariaDB for web dev, but I have to admit that JavaScript is useful in limited amounts for building AJAX functionality in forms, etc.

if your site functionality completely relies on JS and you need to load 200kb of jQuery, and a 4ghz i7 to run the site smoothly, then you've failed as a web developer.
>>
>>54304069
This is why I design my sites to be as small as possible, as a challenge to myself and to hopefully offset the shitty web development of today.
>>
>>54303096
>server lang
java

>framework
spring

>template
thymeleaf

>db
pg

>css processor
none
>>
>>54303096
In the style of the java post above me:
>server lang
python

>framework
Django

>template
Django's template system

>db
pg

>css processor
sassy

imo, Django is ridiculously fast for getting products out, good time investment learning it
>>
>>54304113
muh nigga
>>
>>54304166
its a bit archaic but it works well.
i never have any problems with dev but the server needs a lot of ram
>>
>>54304210
>its a bit archaic but it works well.
yeah, everyone starts to treat Spring as a REST endpoint for Angularjs nowadays, but I much more prefer thymeleaf templating
>>
>>54303096
>he doesn't use ember.js fastboot in production yet
>>
>Server
JavaScript (Node 6.0 kicks butt)

>Framework
Express (Well it's a microframework)

>Template
React /w Redux (Who the hell does 100% server side rendering nowadays?)

>Database
Postgres, DynamoDB, Mongo, depending on the case

>CSS Processor
PostCSS with multiple plugins such as Autoprefixer

Node is pretty great because of native JS objects in the back end. It takes away one layer of complexity and allows you to easily share code with the front end. Isomorphic apps are the future. Of course it's easy to shoot yourself in the leg if you don't know what you're doing and there are way too many JS cowboys around who can't even grasp the simple concept of input validation or testing. Thankfully the isomorphic scene seems to be a little too hard for them so they stick with crap tier frameworks like Angular.js in the front end and rely on total shit like Sails.js in the back end. Watch out for those idiots.
>>
>>54303979
Golang is also a decent alternative to Elixir when you prefer a bit of static typing.
What makes Go good isn't even essentially the language itself, but the designers propagated an attitude that made most devs writing stuff for the eco system prefer simpler solutions.
They got the message through and it's pretty enjoyable.
>>
>>54303674
Holy fucking shit how stupid do you have to be that you can't learn more than one fucking programming language?!
>>
>>54303096
>comfiest stack

>web server
nginx
>frontend
meme js library
or jinja2 for server side rendering
>backend
flask
>database
sqlite3
>>
>>54304470
>easily share code with the front end
What the fuck could possibly be shared between the server-side and the front end?
>>
>>54304526
I find both languages are useful, and best of all, are useful for different things. For what I am currently focused on, Elixir is the right call. If I were building something that required a bit more granular control over my bits and bytes, I would definitely turn to Go (or maybe Rust). Elixir's strengths in terms of fault-tolerant, distributed systems comes 90% from Erlang, and Go doesn't really have an answer to that in terms of "big picture" system architecture. That doesn't mean Go isn't awesome in its own ways, but for a suite of distributed services, where performance is a 2nd or 3rd priority, I feel my needs are better suited by BEAM languages and I can "go from idea to production" much faster. I'm also not a big static typing guy, and I find that QuickCheck is more than sufficient in the few cases where I do care.
>>
>>54304616
... pretty much everything?

An easy example of a 3rd party library would be node-uuid, you just import it into your React components and it can be used there. I also like to write my own input validators so it's just one module which can be then used when checking the data coming to the back end, and notify the user in the front end if their input is bad. There might also be scenarios where I have to construct html emails where some calculations are necessary (business reports), yet I want to show the same data in the front end. I just write the calculation module once and it works everywhere.
>>
>>54304526
>no generics
>>
>>54304695
Definetly agree with you.
I've found that Go's error handling is a good alternative to exceptions without supervisors, though.
The error handling is a lot more explicit but it's pretty easy to see how code handles errors, which isn't always obvious with exceptions. (It's also more efficient in almost every case - which kinda fits the "low level backend" niche)
Supervisors provide a whole different advantage, though, and definetly work best with exceptions.
>>
>>54304592
No matter how intelligent you are, it's always faster to learn one language then to learn two.
>>
>>54304592
It's about time
>>
>>54303096
>What is your comfiest stack /g/?

Client:
- React
- Redux with Immutable.js
- Webpack

Server:
- Node.js
- MongoDB
>>
>>54303747
You make simple, static web sites.

I make complex, interactive web applications.
>>
>>54303096
>What is your comfiest stack

Nginx
NodeJS
MYSQL
Redis

>>54303430
>dna protein sequencing on a web server

fucking autists
>>
>>54303694
>Consequently, when looking into the Node ecosystem, you find a vibrant community of people building lots of awesome stuff
where what
>>
>>54303979
>Erlang ecosystem
where pls
>>
>>54304210
>never have any problems
>but the server needs a lot of ram
come on you listed the biggest problem right there
>>
php is king. I am draong dildo man and I say fuck you.

now suck my dick.
>>
>>54304470
>share code with the front end
what
>>
>>54303096
Node is fast, JavaScript is a standard dynamic functional language. Async is convenient to write servers. Write less, do more.
I use node to build my custom web-servers and for generating static sites. Also I do some statistics and light natural language processing entirely in node.
Finally, I use JavaScript/Node as a hobby for writing games/sims prototypes.

>>54303430
This is edited image. In my benchmarks Node.js is a mere 4~5x slower than C++.

>>54303747
hello pajeet.com
>>
>>54305689
NodeJS's approach to concurrency is one one of the worst of all possible approaches.
>>
It beats PHP's ass at everything and it only requires full-stack(overflow) developers to learn one language.

Why would you not want this? I also hate JS, but it's a huge step up from PHP. Especially if you use Typescript.

The world just isn't ready for ASP.net yet.
>>
>>54305172
That's tight bro hit me up with your CV or something you created.
>>
>>54303430

>hurr, durr imma compare a compiled language versus an plattform designed for the web on the basis of scientific calculation benchmarks

Is this why people hate nodejs or are they just stupid?


Anyways, comfiest stack:
nginx
Meteor
React
>>
Is it easy to debug when you use Node.js ?
I love to trace line by line when debugging Java on remote server side.
>>
Ruby, sinatra, thin, nginx, Ubuntu I guess
>>
>>54304592
Anon, fizzbuzz aren't the only thing you can program you know? He means master a language and build his own libs.
>>
>>54303979
Phoenix still ironically using nodejs for brunch and shit.
>>
>>54305856
not nginx + openresty + luajit + moonscript + lapis like an ultra hipper.
>>
>>54303096
If you're building an API that just does IO (no complex business logic processing) such as user login or serving JSON from a database, absolutely nothing comes close to how easy it is to write it in Node.js.
>>
>server
Perl
>Framework
Rolled my own for practice a year ago. Turns out it wasn't complete shit
>Template
Stole WAHa's templating code from Wakaba and modified it a bit
>Database
SQLite for prototyping, Postgres for the final product
>CSS Processor
Nothing. I'm a backend dev first before I'm a web designer so I don't need babying
>>
>>54304701
This sounds like a good thing but I feel like we're all going to be cursing ourselves for pushing it 10 years from now
>>
>>54307427
Also, I don't really consider front end code part of my stack, but I've dabbled with React for some of my more interactive projects. Most of the time I'm just building internal tools at work, and I don't mind being redirected from page to page via forms, so most of the time a little plain javascript to fill in the gaps
>>
>>54306590
I don't think this is true at all. Its all going to look the same no matter the language if you're using a modern framework
>>
>>54304113
Same except

>framework
Struts 2

>template
Velocity
>>
what's a good stack if i'm learning golang
>>
File: round-peg-square-hole.jpg (77 KB, 500x333) Image search: [Google]
round-peg-square-hole.jpg
77 KB, 500x333
Remember when github wrote atom with node?
>>
>>54309974
i use atom with the sftp sidebar plugin and it is fantastic
>>
>>54303430
It's maximum comfy to write js code
>>
>>54303096
Because node is extremely powerful and allows developers to more easily be full stack developers.

PHP and Ruby are both inferior to Node and Node is currently on a path to replace them.
>>
>using SJW languages/meme frameworks

Wt here
>>
>>54305711
>NodeJS's approach to concurrency is one one of the worst of all possible approaches.

I can do 200-400 concurrent connections in one process and that's not the limit.
>>
>>54305689
>This is edited image.
https://benchmarksgame.alioth.debian.org/u64q/javascript.html
>>
>>54311855

by benchmark task performance
n-body

secs KB gz cpu cpu load
Node.js
27.73 24,448 1297 27.72 100% 0% 0% 1%
Java
22.66 30,036 1424 22.68 97% 3% 0% 1%


n-body is what's important to me because I'm into simulation.
>>
>>54304805
For sure. I'm rarely a fan of exceptions even in languages where they are more common. If I have a say in a project's style, I'll vote for avoiding them almost entirely. It's too tempting for undisciplined programmers to use them as magical escape hatches from deep within poorly-structured code.
>>
>>54304099
+1. My website is under 5KB with images, and also functions without JavaScript, just for the heck of it. (Gzipped, that is.)
>>
>>54306380
Ironic? How so? Loads of backend frameworks do something similar in order to handle front-end JavaScript. I'm glad they didn't stubbornly rewrite yet-another-front-end-build-tool, and instead get to focus their efforts on their project's actual goal. Plus that's like saying that even though you don't write your backend in C, it's "ironic" that your http server or text editor uses libc. It might be coincidental, but it's not ironic.
>>
>>54303096
I use spring boot on postres / mongo depending on project. Front end is usually js.
Can't get comfier than autogenerated dao layer tbqh
>>
>>54312701
>autogenerated dao layer
what ORM do you use with postgres? hibernate?
>>
>>54312701
>>54312833
This thread is getting too enterprisey for me
>>
>server
Nodejs
>Backend Framework
Express
>Frontend Framework
Angular
>Database
MongoDB
>CSS Processor
Less
>>
>>54314729
>server
Nodejs
>Backend Framework
none
>Frontend Framework
none
>Database
MongoDB
>CSS Processor
none
>>
So you node users what do you recommend as a solid backend for content-heavy node projects? Or do you usually write them from scratch? I'm bored as hell of using php for developing websites but I'm always in need of a solid content management in the backend.
>>
>>54315190
One of the biggest advantages of Node is how easy it is to write a backend from scratch. Just do that.
>>
So any thoughts on stuff like keystonejs and other premade node backend solutions?
>>
>>54315323
Very little reason to bother with them unless you don't know what you're doing or don't care about what you're making.
>>
>>54303096
2nd comfiest :
-nginx
-sqlite
-bottle.py
-pure css3

Comfiest:
Email the computation code, speciaal and api documentation to the webdev boys
Thread replies: 85
Thread images: 4

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.