Live data from Hacker News

PHP – The Right Way

phptherightway.com

41–50 of 349 posts

Re: PHP – The Right Way

#41
post #34

I totally expected it to be a troll site. It's actually sensible advice. But, really, I suggest using other tools. We have nicer tools now.

I don't know that many nicer tools than Laravel, to be fair.

Especially Laravel + Lighthouse, which is an extraordinarily neat GraphQL layer considering the huge deployability you get with PHP.

PHP is progressing towards a nicer language in a way that JavaScript, IMO, is not. And taking tens of millions of programmers with it.

Re: PHP – The Right Way

#42
post #5

But what's the point? The beauty of perl scripts, and later php templates, was in their BASIC-like simplicity. They were not secure or structured in any way, but very accessible. Once you add these frameworks, you realize you could have started with Python or Java in the first place and get more mature infrastructure and better language along the way.

> Once you add these frameworks, you realize you could have started with Python or Java in the first place and get more mature infrastructure and better language along the way.

And, with things like Flask or FastAPI, you get BASIC-like simplicity and immediacy with a language that has a concept-space that scales with your understanding of it.

Re: PHP – The Right Way

#44
post #20

My problem with PHP is that it solves the issue of code reuse the wrong way round. In other languages, you can import code like this: import mail as mailer The external code ("mail") does not have to make assumptions how it will be called when it is used. In PHP, it is the other way round. Every piece of code needs to try avoiding namespace conflicts by prefixing the code with something like this: namespace Illuminat…

No post body was provided.

Re: PHP – The Right Way

#45
post #10

Earlier quoted context omitted.

Shared hosts are still there, and are cheaper and much simpler to use than your average cloud based deployment. Some even support these new hipster programming languages ruby and python.

"new hipster" programming languages: Python 1.0: January 1994 PHP 1.0: june 1995 Ruby 1.0: December 1996

Sure, but if we're talking about these languages being "socially acceptable" for writing websites, they arrived a bit later to the party than PHP.

Granted, it still happened about a decade and a half ago, so I hoped the sarcasm using the word "new" would come through.

Re: PHP – The Right Way

#46
post #11
post #5

But what's the point? The beauty of perl scripts, and later php templates, was in their BASIC-like simplicity. They were not secure or structured in any way, but very accessible. Once you add these frameworks, you realize you could have started with Python or Java in the first place and get more mature infrastructure and better language along the way.

PHP share-nothing architecture is awesome. It's amazingly simple and it scales to arbitrary size.

PHP has a deep history of less than ideal defaults and Tutorials/Examples. This makes scaling a codebase without some kind of framework (even if homegrown) even more of a challenge.

And in my opinion PHP tends to be ugly and less readable by default.

Re: PHP – The Right Way

#48
post #34

I totally expected it to be a troll site. It's actually sensible advice. But, really, I suggest using other tools. We have nicer tools now.

What tools? What server language today except PHP (and its forks) is actually designed for the web and works as the web was intended?

Re: PHP – The Right Way

#49
post #36

Earlier quoted context omitted.

You can hope all you want but you won't be able to submit any duplicated namespace to Packagist.

That is another consequence I don't like about the quirky namespace approach. It collects more and more problems like a ball of dust that gets bigger and bigger. The consequence you mention is that one depends more and more on tooling and services.

Did you actually get these issues in a real use case? I've been developing PHP software for +15 years and I never had this namespace dilema.

Re: PHP – The Right Way

#50
post #20

My problem with PHP is that it solves the issue of code reuse the wrong way round. In other languages, you can import code like this: import mail as mailer The external code ("mail") does not have to make assumptions how it will be called when it is used. In PHP, it is the other way round. Every piece of code needs to try avoiding namespace conflicts by prefixing the code with something like this: namespace Illuminat…

[deleted]
Post reply on HN