PHP Vs Node.JS

Which one would you choose for a web based project?

I mostly enjoy programming in Node.js, however if this projects gains some traction I may need to hire developers. With Node being my favourite tech I am considering PHP due to PHP developers being significantly cheaper and much more available as opposed to Node.js devs.

The front-end of the app will be based around React.js anyway.

Any decent PHP developer is going to be able to come up to speed on Node pretty fast.

Also, any experience the PHP developer has in programming under the HTTP request/response model will benefit them on day 1 using Node. There's a lot of concepts they already know.

Really, the only thing new that the programmer needs to learn is the mapping from PHP to Node language/library features, which is basically just a few pages of notes that the developer creates during their first month with Node.

I wouldn't worry too much about lower productivity during the first month due to learning Node. If the developer is good, it won't matter in the long run.

Node is awesome. I love Node.

But it's low barrier to entry means there are a LOT of fucking useless as shit "Node devs" out there.

>But it's low barrier to entry means there are a LOT of fucking useless as shit "Node devs" out there.

Wasn't that originally the case for PHP?

Those cheap php devs are cheap for a reason. I'd be wary of any developer who claims to only be proficient with one language. Today at work i used all of the following languages:

Php
Python
Ruby
Bash
Puppet

I use PHP because I always have and I'm too lazy to set up Nodejs on my server. I would have no problem using Nodejs, though. I mean I'm already using Typescript for the front-end stuff.

>PHP vs Node.js
That's like asking if you should rub your dick in Pajeet's street-shit or fuck a kind of annoying hipster girl. There is no competition. Node.js is simply far better for every single given task than any PHP framework. It performs about 3,000 times faster, it's infinitely easier to maintain, and the code fucking does what it looks like. PHP is a templating engine, not a programming language. Only a true piece of shit subhuman would ever think a single good thing about that poorly designed joke of a "language".

>Wasn't that originally the case for PHP?
It's STILL the case for PHP.

hmm i wonder why lots of cloud services are built with php instead of js then

btw saying "its faster" means everything to you, you would use C/C++ for everything. Why aren't you doing that?

Is Node a good alternative to Ruby? I'm sick of it. I used to do just PHP + jQuery but i've had to use Ruby+Rails for my last project.

Before I moved to Node.js I was a Ruby on Rails developer. I enjoy Ruby much more than any other lang, although I didn't like how opinionated Rails was and preferred the minimalistic Sinatra web framework with DataMapper.

This depends what you dislike about Ruby/Rails?

You can't compare the increasingly-small differences between the V8 Javascript engine and compiled C++ to the differences between PHP and them. That's like saying "If you're not going to buy a sports car why not just use a broken moped?"

I don't like how slack ruby is and how minimalistic the language tries to be. It's also too slow, and very bloated. I appreciate how quickly I can make websites, and how much control you have in deployment compared to PHP's filesystem, but that's about all I like about it.

I guess that's just the nature of web development though. I really prefer C style languages and doing software development

You are deluded, pajeet.

Lots of cloud services are built on literally any given language. That doesn't make a language good. Your measurement of "lots" is probably subjective too, meaning the toy language I made for fun has "lots" of cloud services built with it.

The fact of the matter is that Node JS simply works better. How do you store a variable between two files in PHP? Yeah, that's right. You're having trouble doing the most simple of shit in other languages. A fucking view counter requires a database for you.

I'd use C/C++ for everything if they didn't make my life harder. I use what is easiest, and that's [ANY REAL BACKEND LANGUAGE], not your glorified templating engine which makes anything other than shitposts painful to implement.

Also, if you're just trolling, you should use that format of typing more often. It's inherently aggravating to read.

>C style syntax
>peformance/startup time

There you go, Node.js can be a suitable substitute against Ruby/Rails for your needs.

This board is written in PHP.

This board was written in like 2003.

Exactly. PHP is only able to produce comical garbage.

Both PHP and JavaScript are terribly designed, warty languages that were never meant to be what they are today (a simple templating language and a quick and dirty way to introduce interactivity to webpages, respectively). What really amazes me though, is how JS, after years of being the butt of every programming joke, has somehow managed to became cool and hip (even though it still has all the same warts it used to be ridiculed for), while PHP can't shake its shit reputation despite objectively having gone a long way between

1000 times this.

It's a huge warning sign if someone only knows PHP. Specialization is for insects, not programmers. Programmers need to know at least a little bit about just about everything -- and they also need to a lot of in-depth knowledge about at least 5 or 6 different things.

I would expect a PHP developer to know:
(1) HTML/CSS/JavaScript in GREAT depth,
(2) Database management and SQL in GREAT depth,
(3) Network stuff (MAC addresses, IP addresses, TCP, HTTP, DHCP, DNS, etc.),
(4) The state of the art in PHP debugging tools and techniques,
(5) bash (specializing in network tools like curl, nc, nmap, etc.) and wireshark
(6) Configuring Apache, nginx, and IIS; and optimizing them for php,
(7) How to manage a domain name. (Name servers, certificates, etc.)
(8) At least some basic familiarity with gcc and python

Plus they need to know about all the top PHP-based frameworks, so they have enough experience to not reinvent the wheel if a project comes along that fits well into the framework, instead of rewriting a bunch of new code.

>Hey guys I have this js site, please don't block my scripts or my site is going to be broken and unusable.

>(1) HTML/CSS/JavaScript in GREAT depth,
not much js but a lot php
>(2) Database management and SQL in GREAT depth,
check
>(3) Network stuff (MAC addresses, IP addresses, TCP, HTTP, DHCP, DNS, etc.),
ez
>(4) The state of the art in PHP debugging tools and techniques,
implying there's anything remotely useful
>(5) bash (specializing in network tools like curl, nc, nmap, etc.) and wireshark
some experience but this isn't that useful
>(6) Configuring Apache, nginx, and IIS; and optimizing them for php,
check
>(7) How to manage a domain name. (Name servers, certificates, etc.)
check
>(8) At least some basic familiarity with gcc and python
not useful

what do I win?

The fact of the matter is simply that the majority disagrees with you. They're not seeing it differently because they're poorly informed, but simply because your statements only reflect your own opinion about PHP and JS.

JavaScript has gained popularity because it's Scheme with a C Syntax. It has some bullshit in there and a really weird type system, but it's easy to wrap your head around and easy to code in.

PHP still has a shit reputation because it's still inherently shit. It was designed, from it's very core, but a true idiot. It's lead dev doesn't even enjoy programming. PHP has come a very long way, but it was so beyond fucked to begin with that it'll have to repeat this journey infinitely many more times before it graduates to being equal to languages most deem complete trash.

PHP is incapable of even the most basic shit without adding outside resources significantly to it. I can basically re-implement Futuba in pure webpy. Given, it'll preform like shit, but at least it's possibly to do.

The work was put in to make Javascript cool (as long as you're using the hazmat suit that is Typescript and never actually coming in contact with .js files). It wasn't easy, but there wasn't much of a choice. Front-end technology is too damn resistant to change. I mean motherfucking GIFs still exist, for fuck's sake. Whereas Back-End technology changes all the time.

Congrats, village idiot! You may now take one poo in your local street.

Obvious trolling. Even a PHP dev knows Node.js is server-side.

>truly advocating for Typescript, the worst JS pre-processor known to man
>complaining that something which advertises itself as a SuperSet of Javascript (which isn't true) as a method of fixing JS
Most of my JS code works with TypeScript already. Does changing .js to .ts really make you think it's better code?

Type safety is not optional. If you think it is then you have never worked on a project larger than 2k lines.

>Type safety is not optional.
I'm a huge fan of type safety, but yes, type safety absolutely optional. Simply only allow competent people to touch the codebase or adopt a functional style of programming for the project and have your automated tests check for function impurities.

I've written some pretty big projects just by myself before, and I've developed even larger ones with teams who didn't use type safety.

My point wasn't that type safety is bad though. My point was that TypeScript is bad. It's a really really shitty implementation of type safety and fucks up the workflow by adding transpile time to an otherwise JIT language.

>JavaScript has gained popularity because it's Scheme with a C Syntax
This. JavaScript was good from Day 1 if you learned it well and knew enough about programming to avoid the obviously broken shit.

I don't love PHP but I fucking hate JavaScript. It's a fucking pain and would never use for a backend.

>Typescript is a bad language because it has to be transpiled
What the fuck? Ignoring the blatantly obvious comparisons to any actual language the needs to be compiled, do you just run JavaScript verbatum? Don't even like browserify it or anything? What, are you 15?

But go ahead, have your solution to bad language design be "just use better programmers." Don't let me stop, internet tough guy.

>familiarity with gcc and python
>not useful

For someone to have an excellent understanding of web, network, database, Linux/bash, etc. -- but then to NOT even know how to compile a C program is ridiculous. It's a huge red flag. I've actually never even seen anyone who has such a strange blind spot like that.

Same is true now for python. Every Linux distro ships with python installed. If you don't know how to use it, that means there's a whole bunch of potentially useful (and pretty easy to use) tools that you have, but you're not aware enough to use. That's definitely not a good look for you.

It's still the case for everyone. Why do you think FizzBuzz is a fucking meme?

Hint: most "coders" can't fucking code.

>Simply only allow competent people to touch the codebase

It's not an issue of competence. It's an issue of productivity. As the team size grows, using type-safe languages becomes increasingly important to prevent an exponential decay of productivity.

It looks like you haven't really worked in particularly large teams. Why do you think Facebook took all of their PHP code and added in-house type-safety features to it? (The resulting language is called "Hack".) Why do you think Microsoft bothered to create TypeScript? There's a reason big companies do those kinds of things, and it's a good idea to understand their reasoning.

I love how you pull one thing out of context and act like it's the entirety of my argument.
My point was that it adds slows workflow with no benefit. There are plenty of languages where this workflow slowing is worth it. TypeScript isn't one of them.

Please stop name calling and actually learn a thing or two about programming.

>It looks like you haven't really worked in particularly large teams. Why do you think Facebook took all of their PHP code and added in-house type-safety features to it? (The resulting language is called "Hack".) Why do you think Microsoft bothered to create TypeScript? There's a reason big companies do those kinds of things, and it's a good idea to understand their reasoning.

Because they're running a business, and you hire incompetent people because they're cheap. I understand why big companies do those things. Please read all of my post before getting angry.

As I said in my last post, I am a huge fan of type safety. I simply don't like TypeScript. They're entirely different things.

>It's a huge warning sign if someone only knows PHP. Specialization is for insects, not programmers.

I actually really fucking hate this about IT. Back in the late 90's / early 2000's I felt like you could spend serious time learning 2-3 languages in depth.

Now...in large part because of the fucking chaos that is meme web dev...you have to know 50 fucking things. Which means you never...EVER...know any of them in depth.

And that's a big part of the reason why we have processors that can race through literally billions of instructions per second yet so much stuff runs like shit. Especially on the web. I will regularly come across web pages that run up my CPU temps. When I check it out its js files take more space than late 80's GUI OSes and some where there's a stupid piece of fucking code that represents literally the most inefficient way to do something, pegging a cpu core at 100% for 5 minutes when a decent dev could have solved the problem in 0.05s.

>good from Day 1
>avoid obviously broken shit

Choose one and only one.

>Which means you never...EVER...know any of them in depth.
Maybe if you're brown. Languages are mostly syntax outside of the three popular paradigms.

>Maybe if you're brown. Languages are mostly syntax outside of the three popular paradigms.
>"It's all the same and I'm so sophisticated I know all of them."

Every single language, compiler/interpreter/JIT, runtime library, and framework has its own performance characteristics, optimal design patterns, and security issues. The best way to tackle a problem can be very different depending on what you're using at any one of those levels.

I was recently reminded of this in a coding challenge where most C++ devs got their asses handed to them by a Python dev. Not because Python is fast, but because that guy knew the optimal approach to the problem in Python while the C++ guys did not know the optimal approach in C++. (I'm proud to say my code, in C, was the fastest, but I was shocked that the Python submission took 2nd. Until I looked at some of the other submissions and realized how ass backwards they were.)

Few people learn the best way in any single thing now. We're all too busy learning some new fucking meme.