Live data from Hacker News

PHP 8.1.0

php.net

221–230 of 286 posts

Re: PHP 8.1.0

#221
post #108

Earlier quoted context omitted.

There isn't a language that can replace php in 2021. Javascript doesn't have the size of build-in library. Golang is compiled and limited, blank spaces/tabs will kill a Python program. Ruby /rails is slower. All are harder to host. What could you replace php with? The tales of legacy mistakes holding back php are things with no basis in reality. What legacy mistake holds php back? Method names/parameter ordering? Whe…

Honest question: what are people using if not PHP? Node? Python? The 80% of us who aren’t FAANG and are writing CRUD apps. I’ve tried researching the pros/cons and all I get are low quality listicles. Nobody can tell me why PHP is “bad” or what Python does that PHP can’t. Inconsistent params are the only argument I’ve heard. Which my IDE solves. What about JavaScript splice vs slice. I look it up every time.

Golang.

Static typing, concurrency, blazing fast, single binary.

Re: PHP 8.1.0

#222

I've been using PHP since 5.x. Often had to work on older 4.x web apps. I find it interesting when I read people saying "PHP has come a long way. It's a proper language now, etc." If you work long enough with a language and figure out most its quirks, it's a breeze. It's nice that they are adding all these new features, but they are hardly what makes it or break it for me. Here is the one features that is taken for g…

It really depends what you call a language. I find it interesting how developers can be to 3 different things with the word language : the actual language, the language + standard library or even the language + standard + ecosystem. So a sentence like "PHP has come a long way. It's a proper language now, etc." will mean very different things to different people.

The heart of PHP (not the standard library binding C libraries part) do have come a very long way. Even the things that look the same to you on surface have change under the hood and are way more performant thanks to it.

Re: PHP 8.1.0

#223
post #108

Earlier quoted context omitted.

There isn't a language that can replace php in 2021. Javascript doesn't have the size of build-in library. Golang is compiled and limited, blank spaces/tabs will kill a Python program. Ruby /rails is slower. All are harder to host. What could you replace php with? The tales of legacy mistakes holding back php are things with no basis in reality. What legacy mistake holds php back? Method names/parameter ordering? Whe…

Honest question: what are people using if not PHP? Node? Python? The 80% of us who aren’t FAANG and are writing CRUD apps. I’ve tried researching the pros/cons and all I get are low quality listicles. Nobody can tell me why PHP is “bad” or what Python does that PHP can’t. Inconsistent params are the only argument I’ve heard. Which my IDE solves. What about JavaScript splice vs slice. I look it up every time.

People are using Node. And they move a lot of the processing to the front end with things like React.

They have trouble grokking that there is a method of dev in which the server is not the language parser, so all other languages feel like a wrong step.

Here on HN someone just asked why anyone would write in anything except JS [1].

Now, Node has it's advantages, and so does PHP. My personal preference is PHP. But in mindset, Node is far ahead of anyhere that Rails or Django ever got in their respective waves.

[1]: https://news.ycombinator.com/item?id=29321426

Re: PHP 8.1.0

#224

I've been using PHP since 5.x. Often had to work on older 4.x web apps. I find it interesting when I read people saying "PHP has come a long way. It's a proper language now, etc." If you work long enough with a language and figure out most its quirks, it's a breeze. It's nice that they are adding all these new features, but they are hardly what makes it or break it for me. Here is the one features that is taken for g…

> Edit file -> Alt+tab ctrl+R. Oops, Alt+tab fix -> Alt+tab ctrl+R.

> When debugging I can do that 50 times a minute. With my react app, I can do it maybe 5 times a minute. With my golang app I'm lucky if I can do it twice a minute.

Hmm... when working on React stuff I don't even have to do the ctrl+R stuff. Hot reloading in the browser is a thing and works quite well. When working with Django it's very close to being the same as the PHP experience thanks to automatic server reloading. I worked with PHP extensively back in the day but I never miss the tight feedback loop (although maybe this experience is why I always make sure I have such a tight feedback loop in whatever I do, I guess you don't always get it by default).

Re: PHP 8.1.0

#225

I've been using PHP since 5.x. Often had to work on older 4.x web apps. I find it interesting when I read people saying "PHP has come a long way. It's a proper language now, etc." If you work long enough with a language and figure out most its quirks, it's a breeze. It's nice that they are adding all these new features, but they are hardly what makes it or break it for me. Here is the one features that is taken for g…

What monsterous golang app are you running that takes 30 seconds to compile?

I think the problem is they haven't set up tools to make it really quick. Even if the compilation only takes a few seconds, they are probably switching to a shell, firing of a make command, maybe restarting the server etc. All stuff that could (and should) be automated and available at the press of a keyboard button. In my emacs setup, any language that requires compilation I bind the key C-c C-c to "build the app now". So then compilation literally takes a few seconds not a few second plus ten seconds of overhead.

Re: PHP 8.1.0

#226
post #178

I've been using PHP since 5.x. Often had to work on older 4.x web apps. I find it interesting when I read people saying "PHP has come a long way. It's a proper language now, etc." If you work long enough with a language and figure out most its quirks, it's a breeze. It's nice that they are adding all these new features, but they are hardly what makes it or break it for me. Here is the one features that is taken for g…

You can do this in Golang as well. Just put all of your business logic inside template/html.

Yeah, you could, but should you? ¯\_(ツ)_/¯

Re: PHP 8.1.0

#227
post #108

Earlier quoted context omitted.

There isn't a language that can replace php in 2021. Javascript doesn't have the size of build-in library. Golang is compiled and limited, blank spaces/tabs will kill a Python program. Ruby /rails is slower. All are harder to host. What could you replace php with? The tales of legacy mistakes holding back php are things with no basis in reality. What legacy mistake holds php back? Method names/parameter ordering? Whe…

Honest question: what are people using if not PHP? Node? Python? The 80% of us who aren’t FAANG and are writing CRUD apps. I’ve tried researching the pros/cons and all I get are low quality listicles. Nobody can tell me why PHP is “bad” or what Python does that PHP can’t. Inconsistent params are the only argument I’ve heard. Which my IDE solves. What about JavaScript splice vs slice. I look it up every time.

When picking server language for web development I think it is more important to look at how the platform works rather than language features.

This is important

  * memory model (shared, per request, etc)
  * request model (by the app or by the web server)
  * compilation/build step
  * deployment 
  * hosting
  * tooling (IDEs, linters, testing, package manager, etc)
  * how to scale
  * available programmers
  * community
This is not important

  * $ in variable names
  * arrows (->) for accessing object members
  * argument order in standard library
  * not elegant enough

Re: PHP 8.1.0

#228
post #175
post #108

Earlier quoted context omitted.

There isn't a language that can replace php in 2021. Javascript doesn't have the size of build-in library. Golang is compiled and limited, blank spaces/tabs will kill a Python program. Ruby /rails is slower. All are harder to host. What could you replace php with? The tales of legacy mistakes holding back php are things with no basis in reality. What legacy mistake holds php back? Method names/parameter ordering? Whe…

> Javascript doesn't have the size of build-in library. Golang is compiled and limited, blank spaces/tabs will kill a Python program. Ruby /rails is slower. I have once heard an ancient prophecy (I think it's Greek) that says "Debating around PHP online summons the ghost of the dark behind your back" or something like that (I don't speak Greek, sorry). In the Client/Server world now days, the most of the time you onl…

It exist multiple libraries/frameworks that allow you to write modern dynamic applications with server side rendering only, like Hotwire, Livewire, htmx and unpoly, thus the need to write a large amount of JavaScript for the frontend is no longer needed.

Re: PHP 8.1.0

#229
post #183
post #32

Earlier quoted context omitted.

Elegant is not the word I'd use to describe PHP. Solid, perhaps. Undoubtedly useful. But if there is elegant PHP, I haven't seen it.

Hello World in PHP is literally Hello World I know no other language that elegant.

If programing stopped there we wouldn't have an argument, its when you design high performant code that is maintained for over 10 years etc.

Re: PHP 8.1.0

#230

Earlier quoted context omitted.

I just run go test. No need for alt+tab. Why reloading anything when testing the backend code?

Perhaps it's not a SPA but has traditional backend-side templates for pages.

What's the problem having a HTTP client running in tests?
Post reply on HN