Live data from Hacker News

PHP in 2019

stitcher.io

31–40 of 489 posts

Re: PHP in 2019

#31

"While async and await are not available yet, lots of improvements to the language itself have been made over the past years" It's 2019 guys. Please.

It's good if they take some time to think about the implementation instead of doing a crappy job like Python did.

Re: PHP in 2019

#32
post #5

Thanks for sharing. The thing that I am most concerned about with PHP is not, strictly speaking, the language itself. The syntax is slightly odd but otherwise fine. And the semantics are much the same as any similar language. The real problem that I find with PHP is that the designers seem (from an outside perspective) to take a similar approach towards language backward-compatibility that, for example, C/C++ have. T…

I think that is largely changing. Quite a lot of breaking changes to clean up ancient cruft are slated for 8.0. For example, PHP has infamously had broken ternaries (they're left associative, which is never what you want, not how any other language works, and a rich source of bugs). Nested ternaries are being deprecated and will be removed completely in 8.0; in a future version correct (right associative) behaviour will be able to be added.

Obviously there's a long road to go, but being willing to change how an operator works on that level demonstrates a willingness to break compatibility when necessary.

Re: PHP in 2019

#33
post #4

Is the debugging experience finally any more bearable?

The debugging experience is very good, actually. Certainly comparable to other languages.

Re: PHP in 2019

#34
post #21

Maybe it isn't, but other languages/frameworks have improved the past ten years as well. I don't see the selling point in building something in PHP in 2019 when you have similar if not better/more mature languages/frameworks at your disposal. Won't your prototyping be faster in Go/Python/Node/Ruby anyway, with a more stable surface to build upon it? I really fail to see where PHP has its place in 2019. For your "buil…

It only means you don't know PHP enough. No offense, I moved from PHP to Rust after 11 years of using it, but it was definitely not because of tools or speed of development. I just prefer strict typing and Rust's errors handling.

If somebody prefers dynamic languages and want to create some prototype - it can be done even without any frameworks, quickly enough, with millions of libraries for any need.

Re: PHP in 2019

#35

Rather than chasing MVw or OO trends of the JavaScript ecosystem and become more like JavaScript or Java, so to say, why don't the PHP developers identify and build on the unique strengths of PHP? Which are IMO: the large installed base in classic web hosting, and the original purpose of PHP as a high-level scripting language embedded in otherwise static HTML as in " ". There is a huge room for improvement there sinc…

Your claims are vague, do you have a specific example of a new feature and a new mainstream framework that has the security issues you mention?

Re: PHP in 2019

#36
post #21

Maybe it isn't, but other languages/frameworks have improved the past ten years as well. I don't see the selling point in building something in PHP in 2019 when you have similar if not better/more mature languages/frameworks at your disposal. Won't your prototyping be faster in Go/Python/Node/Ruby anyway, with a more stable surface to build upon it? I really fail to see where PHP has its place in 2019. For your "buil…

> Won't your prototyping be faster in Go/Python/Node/Ruby anyway, with a more stable surface to build upon it? One of the most understated pros of PHP (IMHO) is that it's so easy to get setup with. You can start hacking on something so quickly. In my experience, Go has not been like that. Node.js also was never as quick.

Not really the case with Docker. I can spin up a container targeting any language in less than 10 seconds, mount a volume and start hacking away. Best of all, it doesn't pollute my system in any way. We shouldn't pick a language just by how easy it is to get started, a decision which often leads to a lot of regrets. Pick whatever is good for the project not your disposition.

Re: PHP in 2019

#37
post #31

"While async and await are not available yet, lots of improvements to the language itself have been made over the past years" It's 2019 guys. Please.

It's good if they take some time to think about the implementation instead of doing a crappy job like Python did.

Wait what? Python's async is actually well implemented and very consistent.

Re: PHP in 2019

#38
post #19

It might not be, but how does it fare against similar languages? I have no idea why you'd choose it over Go/Node.js/Ruby or similar for your standard webdev stuff.

All apps I saw, written in Ruby, were awfully slow. I don't know Ruby, maybe it's just me, but would be interesting to know examples of not slow Ruby apps.

Re: PHP in 2019

#40

php > echo count(get_defined_functions(TRUE)['internal']); 1196 They should clean up the global name space, but that will never happen, so I'll continue not using PHP.

Yeah and they should add basic features like lambdas and rewrite the entire standard library to support that while they are at it and when they are done with all of that could they potentially provide a separate syntax similar to facebook's reason? It's no longer the same language anymore if you change everything and therefore there is no reason to waste time improving PHP.

PHP has had lambdas for years, and the next major version has a concise syntax similar to JS arrow functions.
Post reply on HN