Live data from Hacker News

Go with PHP

gowithphp.com

331–340 of 532 posts

Re: Go with PHP

#331

That PHP code right there at the very top of the page that is supposed to be representative of how great it is has multiple TOCTOU authorization and validation bugs. In fact, nearly every piece of code on that entire page is riddled with transactional bugs

If you may, could you point out what are the TOCTOU bugs you have mentioned?

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

Re: Go with PHP

#332
post #307

"500,000 orders per month" That's like, what, 12 orders per minute? Is this meant to be impressive or something? I bet any language run on a modern laptop can handle that.

"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.

Re: Go with PHP

#333
post #300

The other day I finished a side gig I was doing - a Wordpress site recreated using the Wayback Machine - the site went down a while ago and the admin stopped answering phone calls, not to mention emails. It was a largely pleasant experience, taking me back to my early years as a "web developer". I had to modify some PHP files because the theme used didn't offer slots for widgets in places I wanted it to. That being s…

I’d had a site in a similar state, and I did figure out what it was doing.

Client had launched a product that was a bit more successful than typical. Nobody could access the site though. I dig around a little, come to find a neat little snippet of template looking for a featured user for some markup.

The genius who set this up iterated through each record trying to find the featured item. One query at a time, testing each record in the application for the flag.

Php is fine, some very inexperienced “developers” use it though so you find a lot of gems like that in the space.

Re: Go with PHP

#335
post #330

That PHP code right there at the very top of the page that is supposed to be representative of how great it is has multiple TOCTOU authorization and validation bugs. In fact, nearly every piece of code on that entire page is riddled with transactional bugs

Do you mind elaborating? I can see how the user's ability to 'place-order' might be rejected between the access check and the order creation but that would be an extraordinary edge-case that does not need to be accounted for in 99% of applications. If you're developing an application that needs to account for such an edge case you could easily do so with an insert w/ join method on the Order model. The author isn't t…

That's really the point. The code is deceptively simple for a whiz-bang "look how easy this is!" kinda presentation but the reality is that it's not useful for anything but a toy web store. Maybe it's fine that it only works 99% of the time if you're just trading Pokemon points, but not when you're dealing with people's money.

Re: Go with PHP

#337
post #307

"500,000 orders per month" That's like, what, 12 orders per minute? Is this meant to be impressive or something? I bet any language run on a modern laptop can handle that.

"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.

Re: Go with PHP

#338
post #128

Earlier quoted context omitted.

You seem to know what you’re talking about. I checked out payloadcms though, that site is pretty terrible…

I mean no disrespect, but imo you need to get a modern UX designer involved in rethinking and redesigning your site. Message-wise, your site has too many angles, sells too many use cases, and has too many general marketing statements and not enough concrete examples. This only confuses readers. In terms of design, the site design (1) doesn't promote a linear flow of reading, (2) doesn't space out information with eno…

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 into view, but then it gets covered up by code examples. Most regular customers are scared by code examples.

Instead of one clear button or call to action per section, there are 20 on the screen, making the user unsure what to click and what the Information Architecture / hierarchy is.

And moreover, all the links are black on white or white on black — just like the text. No clear visual separation of where to click. It violates like every UX guideline I have read in the last 12 years.

It has GIANT TEXT HORIZONTALLY SCROLLING ACROSS THE SCREEN the minute you start to scroll down. Then when you get past that, it has a GIANT VIDEO THAT DOESN’T FIT and doesnt look like a video, more like some more text in many font sizes.

I could go on… but why? Do you actually prefer this monstrosity to clean design: https://imgur.com/a/IMT6pgB

By contrast, if you land on https://Qbix.com it looks empty and clean, and asks you who you are before showing you a page: a customer, an investor, a developer, etc. Then that page is specifically tailored to what you need.

Text is text. Colors are colors. A large black menu bar is unmistakably at the top, organized neatly so you don’t get lost, not scrolling out of the way.

Unless you think apple.com is old outdated design and modern UX is the payloadcms site?

Re: Go with PHP

#339
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…

All those arguments would apply to Python and Django in my opinion.

Re: Go with PHP

#340

Earlier quoted context omitted.

PHP has a lot of top tier CMSes. IMHO bunch of them are even better than Statamic. Craft CMS ( https://craftcms.com/ ) is a lot more mature database based CMS. Kirby ( https://getkirby.com/ ) is better at flat-file and has a lot better admin interface. Twill ( https://twillcms.com/ ) is better integrated in Laravel and is fully open-source. Statamic mostly feels like it's sitting besides Laravel and they call themsel…

You're absolutely right! PHP is blessed (or maybe cursed, depeding on your perspective) for that. I believe Craft and Statamic share a root in ExpressionEngine, which I loved also. I've only used Craft a little bit, for me the biggest issue is that it is (or was when I last looked) built on Yii, which isn't my go-to framework in PHP. This is in no way a showstopper. I haven't used Kirby, but it looks like a completel…

Statamic, Kirby, Craft are all commercial products and not free licensed (as in freedom). Twill is only one that's Apache License 2.0. I agree this is both blessing and curse and for products like this is much safer to get the commercial product that has safer future. But for example if you wanted to start small CRUD SAAS based around CMS it would be feasible to do only with Twill.

I don't think it's a good idea to have your product and your presentation website in one app so for me it's not a feature. They should really be separate concerns.

I haven't used Statamic 4 yet but last time i've used it they didn't seem to use much from the Laravel. It basically publishes routes to Laravel from their own system and that's it. It even recommended it's own templating language Antlers. It just feels they want to really ride the Laravel wagon while still being just separate system. Thats OK but Twill for example really depends on Laravel and feels more deeply integrated with it.

Craft is good simply because it leverages database powers well and it's super mature. Things like relations and search are a lot harder in flat-file systems. Twill does this OK. Flat-file systems generally have ways to use database but it's more work. I would pick Craft for sites where having DB is more advantageous than flat-file.

Kirby is kinda it's own thing. It's oldest and mature, simple, steady but modern. It tries to have as little abstraction as possible. Opposite philosophy to all Laravel magic. It's kinda edgy and zen because of that. The advantage of less code and dependencies - it's super fast and easy to read source code. Not that it would matter in a CMS. Kirby embraces flat-file as kind of nosql database. For example every page has unique identifier that is indexed an can be referenced anywhere. I don't know about CMS that does that out of the box. And Kirby admin interface is also pretty different because it has no preset ways. When you install it it's empty - you have to completely define it. This can be huge advantage or more work for developer depending on what you do. It's more like build your own CMS package than CMS.

Statamic has inspired lots of their features/implementation on Kirby and for years played catch up. Nowdays they are all very feature rich so it's more matter of taste (and price). Statamic has one really nice advantage and that's GUI blueprint builder. If you hate writing YAML to define admin area (which both Kirby and Statamic need) with Statamic you don't have to.

Post reply on HN