Live data from Hacker News

Go with PHP

gowithphp.com

181–190 of 532 posts

Re: Go with PHP

#181
post #5

They’re not wrong… PHP7+ is blazing fast, has a huge library, gradual typing support, etc. If starting a new project in the space where they all “compete”, I would choose PHP7 or PHP8 with Laravel or Symfony (or maybe even WordPress) over Rails, Django and probably over NodeJS.

Not gonna bash PHP, but WP... never again.

Re: Go with PHP

#183
Performance is always a good argument, but, be realistic and be honest, most applications did not need ultra fast performance and most applications did not have hundreds of parallel users.

Re: Go with PHP

#184
post #128

Earlier quoted context omitted.

The way your landing page is laid out isn't doing you any favors. If you are going to build a rapid application development platform, look at Retool for inspiration in terms of designs and copywriting. Cut the token stuff, otherwise you will lose customers or self select for crypto bros. The license you chose will turn off most professional development shops and the ones using the platform would be based in places li…

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

I am afraid that if you think that then there is no help.

Re: Go with PHP

#185
post #20
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…

For a framework that is radically different but also PHP-native (since PHP 5), would you like to spend an hour playing with https://github.com/Qbix/Platform ? If you do, please share your experience in a comment. I’d love to hear it. I architected this framework over the last decade :)

Quick scan.. I'm going to be 100% honest. Screenshots looks like it's a hobby project. While scanning the code I came across folders named "files", "classes", "includes" and "scripts" are big warning signs.

Re: Go with PHP

#186
post #57
post #24

I'm in the group described halfway down: was on the Internet during PHP 5, lost interest in it, and moved on [to Go]. I haven't written anything in PHP newer than version 5. Even transitioning from 4 to 5 was quite a big deal, I definitely noticed improvements. But it wasn't enough. I couldn't fit the data set in memory with PHP. But I could do it with Go. I couldn't do parallel computations in PHP in order to respon…

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…

FWIW: There are a bunch of ways to "do" php execution, and a lot of them are wrong. That's not exactly PHP's fault, just that there's been a lot of blind-leading-the-blind.

Assuming that you're not spinning up and tearing down a container for every request, you want to be sure you're running php with a php-fpm configuration (preferably talking over a unix socket) -- this is the fastcgi process manager, which maintains a pool of "hot" php interpreters for you that are immediately ready to execute code for an inbound request. This is usually good enough for most applications without going into the weeds on things like opcode caching, but that's all available as options too.

I'd be happy to help troubleshoot this with you if you're interested. I've also got a fully automated build script that works pretty well. You can find my contact info via the link in my profile. I promise it doesn't have to take anywhere near 300ms for php to reply to a request.

Re: Go with PHP

#187
I see couple singletons calls in those examples. Is it considered a good practice in PHP now, or was it made to simplify the demoed code?

Re: Go with PHP

#188
post #85
post #62

Earlier quoted context omitted.

I want to second this. The top StackOverflow comment for protecting against XSS in PHP still recommends htmlspecialchars() https://stackoverflow.com/questions/1996122/how-to-prevent-x... which is a terrible and ancient approach (context-aware templates are the modern approach). I also Googled to check CSRF protection and all the sites I can find just discuss rolling it yourself; the example uses some CSPRNG that can…

You don't get XSS protection out the box from any language's standard library, nor CSRF.

You do get XSS protection out of the box in most templating languages, though, and PHP is also a templating language.

Take this template:

  {{ title }}
In most templating languages, for a title of "alert();", the result will end up being:

  <script>alert();</script>
In PHP, which is a templating language, the equivalent seems to be:

  
But this will print the title unescaped, which is a security vulnerability, and incorrect. In reality, the equivalent is:

  
Now, you could say, don't use PHP as a templating language! But if you're not supposed to use PHP as a templating language, why does it behave as one? This is one of PHP's footguns to be avoided. Personally, I recommend a linter like PHPCS to catch issues like this one.

Re: Go with PHP

#189
I’ve been writing PHP for over 20 years. I use it for my hosted (backend) programs.

Works a treat. It’s robust, fast as hell, easy to make secure, runs on the cheapest, crappiest hosting, and has an enormous support infrastructure.

That said, I’ve never particularly liked the language, and have never become an advanced adept at it. I use it to manage the less-glamorous part of my work. I’m mostly a native Apple developer (Swift).

Re: Go with PHP

#190

If you're looking for a great CMS and were bitten by WordPress back in the day, you should take a look at Statamic ( https://statamic.com ) It's a Laravel package and it's the best CMS I've ever used (from a dev perspective). v4 just dropped the other day

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 themselves Laravel based for marketing.
Post reply on HN