3 ms·
This is debunked, in my personal experience. If I want to do internet data piping, data conversion or a database backend, its faster and simpler to do it in no
by gridmaths 13y ago
This is debunked, in my personal experience. If I want to do internet data piping, data conversion or a database backend, its faster and simpler to do it in node.
I also use node as replacement for scripting in bash, PHP and perl. I also use javascript for frontend work, so this means I need to keep only one programming language syntax in my muscle memory.
I've actually used node for quite a few commercial data back-ends : both nosql ( mongo, redis ) and relational ( postgres, mysql ). Ive written similar things in PHP, so I can compare them fairly : basically there is just more ugly syntax with PHP.
I use a node proxy to handle multiple small sites on one host, and have a small node program for hosting static content [which does gzipping, sets cacheing for images to help page load performance]. It might be slightly better to use nginx.. but for a small to medium traffic site, this is fine - I don't want to know the nginx or apache incantations to do this, its just faster to write code in node.
The main npm modules are pretty stable and cover nearly everything. The language is _better_ [ smaller simpler more readable code, less syntax, less ugly syntax, functional idioms, procedural idioms, readable map/reduce, readable 'functions as variables', better names, less UPPERCASE ugliness, less work ]
Yes, node is newer, yes there is a mindset change needed to handle the async-callback-centric approach. But basically node is a better PERL than PERL, a better bash than bash, and a better backend web language than PHP.
You'll write smaller nicer code.. its probably just as fast or faster these days at runtime [ although that is not my main reason for choosing it : my reason for choosing node is less PAIN.. and more enjoyment ]
- throwaway420 13y agoWhen you're dealing with a small amount of code, ease of hosting matters a lot more than programming language elegance. PHP hosting is available everywhere - that's what makes it a great fit for many small business projects. The relative merits of PHP are not in dispute. PHP is less elegant than just about every programming language out there. It's not necessary to write a marketing brochure to expound on Node.js's sublime beauty in comparison to PHP because everybody knows that's the case.