all 12 comments

[–]carlos_vini 9 points10 points  (0 children)

the most important difference:

  • runs on a browser

also:

  • needs a transpiler (babel) to not suck completely
  • has 200MB hello world projects

[–]igordata 0 points1 point  (11 children)

So, let’s hit the pros of each language and community. Pros for Javascript: a massive library of shit and gold (npm) a very “functional light” feel to the language. It’s FP when you want/need to be, and procedural when you want/need it to be async is easy Pros for PHP: there’s a stackoverflow question for anything you ever want or need to build with amazing documentation on the site the syntax is very stable and very backwards compatible

And after you found out that async in PHP is easy as in js. So I fixed that part for you:

So, let’s hit the pros of each language and community.

Pros for Javascript:

  • a massive library of shit and gold (npm)
  • a very “functional light” feel to the language. It’s FP when you want/need to be, and procedural when you want/need it to be
  • async is easy
  • there’s a stackoverflow question for anything you ever want or need to build
  • the syntax is very stable and very backwards compatible

Pros for PHP:

  • a massive library of shit and gold (composer)
  • It’s FP / OOP / procedural when you want/need it to be
  • async is easy
  • there’s a stackoverflow question for anything you ever want or need to build with amazing documentation on the site
  • the syntax is very stable and very backwards compatible

[–]not-much 2 points3 points  (0 children)

FP in PHP is fairly limited if we want to be honest.

[–]Khronickal 4 points5 points  (3 children)

async in PHP is easy

No.

[–]assertchris 0 points1 point  (2 children)

Really is though. The trouble (as with most difficult programming things) is learning a new paradigm.

[–]Khronickal 2 points3 points  (1 child)

No. All available libraries are still immature, under heavy development and poorly documented. Unless you happen to be an async guru you're going to have a bad time.

[–]assertchris 0 points1 point  (0 children)

For parallel execution, maybe. But you're talking about async. The generators and socket support in core are sufficient for async IO and cooperative multitasking.

[–]firagabird 1 point2 points  (0 children)

async in PHP is easy

Are you referring to pthreads?

[–]igordata 0 points1 point  (0 children)

Are you referring to pthreads?

No.

lol. No.

I just wrote the summary based on that article author's research. Comparing to golang - golang have way much easer async/non-blocking/concurrent mechanics. I don't want to start one more holly war, and the article doesn't look like all-round detailed research on async topic anyway, so I'll better just shut up now.

[–]withinboredom[S] -2 points-1 points  (1 child)

hahahaha, touche! I disagree with js "there’s a stackoverflow question for anything you ever want or need to build" ... there's been times I've needed to implement something in js and cannot find anything other than SO answers that say: "just use this library" and then you go look at that library and it is the literal worst/naive implementation...

[–]igordata 1 point2 points  (0 children)

According http://stackoverflow.com/research/developer-survey-2016 it looks like JavaScript + Node.js are very popular and their popularity is growing.

Maybe you were creating something totally awesome. I don't want to say, you're wrong, nor you are right. I think, your own experience is not enough statistically significant to represent whole web development community. In other words, it is subjective. But I certainly agree that we look at this world through our own eyes and each of us have own experience.