Live data from Hacker News

PHP – The Right Way

phptherightway.com

151–160 of 349 posts

Re: PHP – The Right Way

#151

A language that changes the semantics of functions between minor versions has no "right way". "count()"less examples of crap. I have currently two weeks of code migration behind me because code running correctly on 7.0 fails on 7.3 -- while I see the reason for change was necessary I also see the hopelessness of rebuilding a flawed house with a fundament build on a pile of manure. And the good news given to me by a c…

PHP versions don’t follow semver.

And yes, it’s ok. Semver not a silver bullet.

Re: PHP – The Right Way

#152

Earlier quoted context omitted.

The fact you're talking about building a payment service provider in a CMS kind of tells me this isn't a conversation worth continuing.

I have seen something similar to a payment provider being done in Wordpress. The only silver lining is that the ledger was technically maintained by a third-party and WP was just the frontend to it.

Me too. And I've seen CRMs built in WP, eCommerce, an auction marketplace, financial dashboard, and so on. But, indeed, processing financial transactions through WordPress is amongst the most scary things I ever saw in computing.

Re: PHP – The Right Way

#153

Actually, that make me remember statements of Linus Torvalds on Git at Google Tech Talk Conference: But I did end up using CVS for seven years at a commercial company and I hated it with a passion. When I say I hate CVS with a passion, I have to also say that if there are any SVN users in Subversion, users in the audience, you might want to leave because my hatred of CVS has meant that I see Subversion as being the m…

Funny considering Linus Torvalds believes that C is the best since sliced bread.

https://www.google.com/search?q=c+the+right+way

Re: PHP – The Right Way

#154

Earlier quoted context omitted.

> more mature infrastructure and better language What does this mean?

PHP is a conceptually awful language. It is created by language amateurs and it shows in many early decisions such as the multiple thousands of built-in functions already mentioned. It had its benefits since those amateurs understood their use case and their users' capacity very well. But now all of that is gone and they are still stuck with a subpar language at the core.

> created by language amateurs > all of that is gone and they are still stuck with a subpar language

The argument is that the language is "awful" and "subpar" because it has "early decisions" like "multiple thousands of built-in" global functions introduced by "language amateurs"?

Sorry, but I remain unconvinced.

I agree that there are real reasons that PHP fails as a language in particular use cases, but it seems rare that those reasons get articulated in these threads.

Re: PHP – The Right Way

#155
post #144
post #117

Earlier quoted context omitted.

Totally agree. This is beyond taste or preference. Yes you can build a great app in PHP. But so you can in Kotlin or Ruby or ... Yes some have a career by starting with PHP. But that does not make it a good language for beginners. Same can be said (and to me is verrrry true) fro JavaScript. Language design matters. It shapes how you think about code. Talk to people who've learned AND USED many languages including som…

For me, a "beginner friendly language" has these properties: * A welcoming, helping and open community. * Built-in guidance or enforcement away from The Wrong Way and towards The Right Way. E.g. by making the former hard to do and the latter easy. * Ecosystem of high-quality, properly designed libraries and sample code. I see this in e.g. Rust. But e.g. JavaScript or PHP fail on all my three points. As does my main l…

While I agree on your three points, I don't think I would recommend Rust to a beginner developer.

Re: PHP – The Right Way

#156
post #148
post #128

Earlier quoted context omitted.

Namespaces in PHP are totally fake, they are not real as it is in C++, where you can actually store data within them. In PHP the namespace is just a name added to every class construct and nothing else. This is basically class MyThing the same as this namespace My; class Thing However namespaces was a pragmatic design choice that solved the community's problem with code organization and ever increasing project sizes…

Nice. Is the strict_types dance necessary for this? I really hope that if PHP introduces an import system, it does not combine it with stricter type handling.

> Is the strict_types dance necessary for this?

No, just that PhpStorm adds this for me and I always have it my files. I have removed it now to avoid any distraction to what I wanted to show.

Re: PHP – The Right Way

#157

The reason why people now care about PHP is that, decades ago they thought PHP would the right way to develop projects, now they are stuck, because they cannot get rid of PHP any more. If you look at any well grounded projects, they try to avoid PHP at all cost. Only handful amount people are responsible for core development. Decision are made based on "copying" other languages like Java, plus you always end up using…

> The reason why people now care about PHP is that, decades ago they thought PHP would the right way to develop projects, now they are stuck

I worked on many greenfield projects in recent year where the conscious choice was made to use PHP.

For the majority of projects NOT using PHP is basically throwing money in the trash. Best deployment story. Great ecosystem.

> Decision are made based on "copying" other languages like Java, plus you always end up using lots of tools just to make your code safer.

This is a really big strength. PHP is able to learn from other languages and when implementing features can avoid mistakes that they made.

Re: PHP – The Right Way

#159
post #134

Earlier quoted context omitted.

How do you feel about php7+ ? There were some serious changes.

I haven't worked with recent PHP versions, other than through WordPress, which, if I understand correctly, does PHP a big disservice. My last serious encounter was when I build and scaled a WordPress hosting company 5+ years ago. Which meant all my exposure to PHP was WordPress, which meant I wanted to avoid it as much as possible.

WordPress !== PHP.

WordPress sucks. PHP does not.

Re: PHP – The Right Way

#160
post #88
post #77

Earlier quoted context omitted.

Quoted post unavailable.

Why do you presume this is "hearsay PHP hatred"? I (not parent) have PHP hatred. It is fuelled by decades of PHP development and -exposure. My hatred is based on failing projects, missed deadlines, burnouts, money stolen, severe downtime, and companies going bankrupt. PHP had a role (not the primary, mind you!) in all of them.

> money stolen

How did PHP result in "money stolen" that couldn't have resulted from any other language?

Post reply on HN