Live data from Hacker News

Go with PHP

gowithphp.com

371–380 of 532 posts

Re: Go with PHP

#371
post #17

As a fullstack developer who has worked many, many years in the javascript hellhole, I mean ecosystem, as well as the python ecosystem and .NET; coming back to PHP the last 2 years, working essentially in Laravel and the like - I couldn't approve more of this message. Seriously, PHP is the grand father that will drive you to class and you'll never be late, the car will never smell and everything will always just be f…

> It's fast, it's typed (now), it's reliable. Fast, the most overrated feature that we developers endlessly look for. How fast? How much are you winning, milliseconds, nanoseconds, picoseconds? It's extremely likely that if something is slow is because you're doing something wrong regardless the language and/or framework. It's reliable PHP? Well, so are Python, Ruby, Go and other friends, right? > Laravel is pretty d…

> How do people debug in PHP?

Mostly xdebug. There is also ZRay on IBM if you use Zend, but I've never used it.

Re: Go with PHP

#372

Earlier quoted context omitted.

You lost me at WordPress haha... Ive a lot of love for WP, but I don't really get the appeal of extending it past blogging... if you're doing anything more complicated it's pretty trivial to implement blogging functions in your site.

The days of WordPress being used for only blogging are long gone. I have many, many multimillion dollar clients using it as the hub for their whole company (none of which have blogs). It's crazy how it just...works. A little PHP-FPM tweaks here, a couple NGINX tweaks there, and you're off to the races. Very little maintenance, almost no downtime ever.

[deleted]

Re: Go with PHP

#373
post #17

As a fullstack developer who has worked many, many years in the javascript hellhole, I mean ecosystem, as well as the python ecosystem and .NET; coming back to PHP the last 2 years, working essentially in Laravel and the like - I couldn't approve more of this message. Seriously, PHP is the grand father that will drive you to class and you'll never be late, the car will never smell and everything will always just be f…

> It's the BMX of the languages. How should I interpret this? The language is cool? Can perform cool tricks?

If you want to ride a bike, you can ride the bike. If you want to do tricks, you can do tricks.

PHP makes simple stuff easy and difficult stuff possible. (But you're not going to win the Tour de France on a BMX bike.)

Nowadays, a lot of other things also do this, but PHP was the first to really "get" this. I understand it's not for everybody, and for certain things, other languages are certainly better. But there's precious little that you can't do with PHP, since it's been around for so long and has been growing with the Web from pretty much the very beginning.

Re: Go with PHP

#374
post #17

As a fullstack developer who has worked many, many years in the javascript hellhole, I mean ecosystem, as well as the python ecosystem and .NET; coming back to PHP the last 2 years, working essentially in Laravel and the like - I couldn't approve more of this message. Seriously, PHP is the grand father that will drive you to class and you'll never be late, the car will never smell and everything will always just be f…

> It's the BMX of the languages. How should I interpret this? The language is cool? Can perform cool tricks?

And...the language can be taken to a high school prom - like any BMX bike can be: https://www.youtube.com/watch?v=VPVJzi7Ta9w

Sorry, could not resist! lol :-D

Re: Go with PHP

#375
post #17

As a fullstack developer who has worked many, many years in the javascript hellhole, I mean ecosystem, as well as the python ecosystem and .NET; coming back to PHP the last 2 years, working essentially in Laravel and the like - I couldn't approve more of this message. Seriously, PHP is the grand father that will drive you to class and you'll never be late, the car will never smell and everything will always just be f…

Most things wrong with PHP that I really care about are currently being resolved in Psalm which undoubtedly will eventually (might be 10-15 years who knows) be rolled into the language.

Re: Go with PHP

#376
post #337

Earlier quoted context omitted.

"when hosted on a $6/month server" Dropping half a sentence will often make it sound goofy, yes. The point being made is "you don't need a massive K8s infrastructure to handle hundreds of thousands of orders a month". Most people don't; https://www.joelonsoftware.com/2001/04/21/dont-let-architect... is an oldie but a goodie on the subject.

> "you don't need a massive K8s infrastructure to handle hundreds of thousands of orders a month" This is true of many languages that are slower and faster than PHP. It's not useful as evidence of PHP being a better choice for anyone.

It's not an argument of "this is the absolute best possible choice".

It's an argument that raw language performance in this sort of context isn't going to be the problem for 99.9% of people developing code. If you have 500k orders a month, you can afford more than $6/month in hosting.

I sometimes see folks post on StackOverflow trying to micro-optimize things like string concatenation or single versus double quotes that make perhaps a second of CPU difference in a million executions. The point is directed at those folks; the ones who are thinking "language X is faster, and for that reason alone I should use that instead".

Re: Go with PHP

#377
post #366
post #338

Earlier quoted context omitted.

Please see the sister comment. If this is what “modern design” looks like — no wonder things are so bad. Instead of clear text sizes and simple messaging like in https://qbix.com/communities , there are texts of at least 5 different sizes jumbled in. Instead of contrast so you can read text — there is white text on black over white text on black. There is also text that is gray and low contrast until you scroll it in…

Hi, I made the Payload site Apparently it triggers you. I don't claim that it's perfect by any means (actually I think some of what you're saying is right).

Sorry if my criticism sounded harsh. I was not triggered by it, but simply going into depth why I do not think I should spend time making my site look like that.

My response was simply a reaction to the scope of criticism and the claim that this is the new best practices. Because the other site was held up as an example of what I should spend days emulating and making my site look like, the sheer time investment and “well, if you think it isn’t good, then you can’t be helped” made me believe that this is some canonical example of best practices and design. So I naturally critiqued it and said exactly why I thought the latest design standard was crap. That’s why it came out like that.

If I knew the author would be reading it, I would have been a lot more tactful in my criticism. But I do stand behind what I am saying. (For what it’s worth, the developer section of Qbix also needs a lot of work, but the OTHER sections + overall design of the site I think are good — but happy to take specific and constructive criticism in the same vein I gave it.)

Re: Go with PHP

#378

Earlier quoted context omitted.

Everything between checking if the user can "place-order", and then validating the inputs, and then finally creating the order.

I don't think the request object can be modified by the end user or that it is modified by the server at that point. If my belief is correct, does this code still contain TOCTOU bugs?

It's the underlying state of the database that will change between these different checks. Not the end-user modifying the request object, which is in PHP memory

Re: Go with PHP

#379

There's 2 things to separate here: 1. PHP the language and developer experience (frameworks, tools, community, docs, etc) 2. PHP performance at scale In my experience, PHP is much improved for 1. and fine to work with. Laravel and composer are great. For 2. I would never use PHP on anything above a few hundred requests a second. It's slow on its own, but more importantly it's blocking IO model will grind things to a…

Weird that you get down-voted but I lose more and more respect for HN these days so I can only say I am not surprised that a common-sense post was given the gray treatment.

I have the same experience as you, I've participated in migrating from PHP to JS, to Elixir, and to Golang. The transition to JS was mostly a performance disaster (not much performance was gained) but at least more devs could help so it was still a big win organization-wise, whereas the transitions to Elixir and Golang were a screaming success on every front: we immediately gained anywhere from 7x to 25x more req/s and the DB load was stable and the request timeout errors dropped by 97.9% on the first day (and were completely eliminated a week later), not to mention the cost of our hosting also dropped by at least 70%.

I am past my phase of "hating" languages but honestly, saying "PHP is not the right tool for jobs X and Y" is a "hate" in the eyes of many anyway. And yeah it's not good enough for big scale. I mean, if you make $1M a month then you likely don't care much if you pay $50K in hosting, sure, but why do you have to spend 5% of your revenue on hosting? There are a lot of modern technologies with which you'd be hard-pressed to justify having more than 2 application servers and 1 DB server (with read-only backups and replicas if sh_t hits the fan).

Re: Go with PHP

#380
post #57

Earlier quoted context omitted.

I agree, the main problem with PHP in my experience so far has been that it's very memory-hungry and slow (even PHP7/8), especially when coupled with frameworks/ORM magic. I remember after spending some time with Go, I got used to being able to process tens of thousands objects in memory in milliseconds. When I proposed to do the same in PHP, during architecture review, PHP devs thought I'm out of my mind because tha…

You're doing something terribly wrong. Sounds like caching isn't setup and your http -> php handler is cold booting the interpreter for every single request. Check these Go vs. PHP benchmarks. PHP is quite fast and stands up nicely to the performance you get out of Go. https://www.techempower.com/benchmarks/#section=data-r21&l=z...

This benchmark means nothing.
Post reply on HN