Live data from Hacker News

Taking PHP Seriously (2016)

slack.engineering

21–30 of 150 posts

Re: Taking PHP Seriously (2016)

#22
Long live PHP.

15 years of PHP dev work. Games, mobile apps, health care, etc. I have been unemployed for 2 days in 15 years. PHP runs %80 of the internet. Talk to anyone at facebook that wears a suit on friday -- they code PHP (and it seems to scale for them). I think I will be 90 years old hacking on PHP.If you really don't like how the arguments are passed just use an IDE. Or get stuck with real problems like a transition from python2 to 3. (wtf)

Re: Taking PHP Seriously (2016)

#23
post #6

So the entire argument is that PHP is single threaded and each request starts with no state? Am I missing anything else? I’m trying so hard not to rant here, so I just wanted to confirm that those are the only positives he outlines about the language.

FTA: "I claim that PHP’s simpler “think; edit; reload the page” cycle makes developers more productive.

I agree wholeheartedly with this. I prefer statically-typed languages w/ a bit of local inference (I end up in java usually, but C# got it right) and I consistently see people in my world underestimate the edit/reload workflow. Even a small compilation step is enough to break flow and make development a chore, once you've worked that way.

As a side note: java not allowing signature changes and requiring a whole server restart is absolutely awful. It didn't have to be this way: the DCEVM[1] was presented at the 2009 JVM Language Summit[2], by Thomas Wuerthinger. He patiently demonstrated and explained how his work allowed for hot swap of arbitrary class changes, while the Sun guys sitting in the audience told him that what he was demonstrating was impossible. We ended up using the DCEVM for a long time, but as of right now I'm back to restarting my server when I make breaking changes. It's a funny world.

¯\_(ツ)_/¯

[1] - This is a modern fork of the project: https://dcevm.github.io/

[2] - http://wiki.jvmlangsummit.com/Hotswap

Re: Taking PHP Seriously (2016)

#25

Given PHP 8 has been released, does Hack provide enough value to consider it as an alternative? My take on it is no, but I'm curious about other people's opinions.

It is good to keep in mind that this article is more than four years old. I would advise against Hack at this point since most of the good bits have been integrated into the main PHP release - typing is a lot more predictable and enforceable for instance.

Re: Taking PHP Seriously (2016)

#26
post #18

The best language for a startup is one the founders know the best. Every other discussion will at best make a 1% difference.

Close I think - the best language to use is the one you will have the easiest time hiring good talent for. If you found a startup and all really love and are fluent in COBOL that's great but... good luck when it comes time to hire another employee.

Re: Taking PHP Seriously (2016)

#27
"For instance, 123 == “123foo” evaluates to true (see what it’s doing there?), but 0123 == “0123foo” is false (hmm)."

Can anyone explain this to me? I know if a string starts with the number, PHP takes the number part and throws the rest, so "0123foo" should be 0123 for the comparison, so why is that false?

Re: Taking PHP Seriously (2016)

#28

"For instance, 123 == “123foo” evaluates to true (see what it’s doing there?), but 0123 == “0123foo” is false (hmm)." Can anyone explain this to me? I know if a string starts with the number, PHP takes the number part and throws the rest, so "0123foo" should be 0123 for the comparison, so why is that false?

Edit: I was wrong. 0123 is octal, not decimal

[Incorrect original post: 0123 evaluates to the integer value 123]

Re: Taking PHP Seriously (2016)

#29
post #28

"For instance, 123 == “123foo” evaluates to true (see what it’s doing there?), but 0123 == “0123foo” is false (hmm)." Can anyone explain this to me? I know if a string starts with the number, PHP takes the number part and throws the rest, so "0123foo" should be 0123 for the comparison, so why is that false?

Edit: I was wrong. 0123 is octal, not decimal [Incorrect original post: 0123 evaluates to the integer value 123]

[deleted]

Re: Taking PHP Seriously (2016)

#30
post #6

So the entire argument is that PHP is single threaded and each request starts with no state? Am I missing anything else? I’m trying so hard not to rant here, so I just wanted to confirm that those are the only positives he outlines about the language.

FTA: "I claim that PHP’s simpler “think; edit; reload the page” cycle makes developers more productive. I agree wholeheartedly with this. I prefer statically-typed languages w/ a bit of local inference (I end up in java usually, but C# got it right) and I consistently see people in my world underestimate the edit/reload workflow. Even a small compilation step is enough to break flow and make development a chore, once…

It’s hard for me to relate, because I just don’t see “edit; reload” as being that important.

I think the difference is I write tests. I usually code everything while writing/running tests. Then it always works the first time I run it, so there’s no need for “edit; reload”.

Post reply on HN