Live data from Hacker News

Go with PHP

gowithphp.com

411–420 of 532 posts

Re: Go with PHP

#411

Earlier quoted context omitted.

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

My experience with WordPress has been broadly positive under certain use cases. What were the negatives you saw/issues you ran into?

I've had enough problems with WP installs that I won't ever touch it again and I don't even want to list specific issues, but it's all about quality. So for a while it has been the same story, over and over:

    - non technical someone wants a CMS
    - I tell them I'll build them what they need, then give them a quote
    - non technical someone doesn't like my quote and installs Wordpress and a gazillion shiny plugins, because "it's easy with the shiny admin panel and I can install it anywhere for cheap and all the functionality is already covered in plugins"
    - things break, because plugins are meh
    - things go real bad, security issues, loss of data, shitty performance, the whole piñata
    - non technical someone cries over the phone "can you fix my website ???"
    - I won't fix their website because I like to build things, not clean up someone else's mess. Feel free to fill that business opportunity but I want to do something else.

Re: Go with PHP

#412

Earlier quoted context omitted.

Exactly. array_filter and array_map, have different order of arguments. ($array, $callback) vs ($callback, $array) A small example of how inconsistent the language is from the ground up. Most people can explain their respective web servers, but I've never heard anyone even come close to what PHP/Laravel is actually "doing". Side Complaint: If you are working with Laravel Queue, it is such a hassle to reload your code…

So what's the programming language that's 100% consistent? For example Python isn't.

Perfect is the enemy of good. There are many languages much more consistent than PHP.

Re: Go with PHP

#413
I actually think this article undersells PHP, as it doesn't mention the incredible additions that PHP 8 introduces, nor does it mention excellent static analysis tools like PHPStan.

I recently rewrote a PHP web app in Rust (https://soapstone.mradford.com/riir/) and although it was interesting, I think it would have been better staying a PHP app. As nice as the Rust compiler was, I felt PHPStan would have automatically caught a similar number of bugs, all the while feeling less combative.

Re: Go with PHP

#414
post #63

Earlier quoted context omitted.

In almost any scenario? >I couldn't fit the data set in memory with PHP. But I could do it with Go. I guess this on is self-explanatory. >I couldn't do parallel computations in PHP in order to respond to an HTTP request quickly enough. But I could do it with Go. Consider the following (covers both statements above): you need to get some data from a few sources (databases etc) do some computation on each set and then…

> you need to get some data from a few sources (databases etc) do some computation on each set and then do some sort of mapping to get the resulting set. You may want those computations to run in parallel and idealy you'd like to start mapping as soon as each computation function starts producing results. This definitely sounds like a typical situation for handling the job in a queue (plus with an async library like…

An example (not the best one maybe but I'm not the right guy to come up with good examples immediately) from a year ago:

We have to integrate company M and W (one is a marketplace the other one is a big store, think Walmart or something).

Company W mostly uses software similar to SAP-whatever and have a small team resposible for building 'helper' services in place where SAP can't do the job.

Company W can't communicate with M in any other way except through your generic http API they provide.

So every now and then M has to send a request to W and W has to prepare a pretty large XML response. (obviously the data is split in some way and we are not talking about tens of GBs but even so W has has to fetch the data from more than one data source, process it and send it)

In some cases you can simply have a cache\a view\whatever for this (so you only have to fetch prepared data) but in some cases you can not.

PS: this is if we are talking about HTTP communication. Or maybe some real-time communication where you can't really respond with "hey, we are getting your data prepared so just wait for a bit and re-request it with this nice jobID at a later time"

Re: Go with PHP

#415
post #316
post #93

Earlier quoted context omitted.

Don't you dare to tell me that my isomorphic Node trpc graphql with redux and sagas on top of next.js with SSG and SSR and parts in server components with my home grown validation and ORM framework and still no translations because they don't work together with everything else and deployed on serverless docker lambdas to a kubernetes cluster is over engineering a landing page with a contact form. So fast! That's a st…

Don’t forget to deploy all that code to the edge. Your $5 VPS in NY running both nginx and MySQL is going to be a huge bottle neck when somebody in Texas tries to view your simple website and it takes .10 seconds longer to load. You’re going to want that contact form code on at least 1,000 servers worldwide for maximum benefits and conversions.

Also, now that you are on the edge and your form submissions are web scale you likely need to model eventually consistency for the processing so you will need a highly available queue running somewhere.

Re: Go with PHP

#416
post #66

Why would you go with PHP+whateverframework instead of Ruby on Rails or Django? I haven't touched PHP since 5th version and I'm kind of sceptical it can offer anything RoR can't.

PHP 8 is a vast improvement over PHP 5. Also, the frameworks have become much better - I especially love the Yii framework as well as the Codeigniter framework if you are looking at a Rails replacement.

I'm a Go dev these days and rather looking into TS and Rust.

I was just curious to be honest. With RoR being what it is PHP frameworks has to offer something on the same level (at least) to be of any interest (as a I see it). Not to mention ecosystem\packages\gems\etc.

Re: Go with PHP

#417
post #66

Why would you go with PHP+whateverframework instead of Ruby on Rails or Django? I haven't touched PHP since 5th version and I'm kind of sceptical it can offer anything RoR can't.

Use the right tool for the right job. I always use plain PHP for all those things I want to keep running forever without having to spend time and brain space to maintain. You can't beat putting a file on a LAMP server and forget it's running. I have tons of public endpoint that do all sort of stuff , aren't core to my business and don't want to deal with the operation hassle that would come to keep such framework wor…

Sounds like a scripted and slower (not trying to diminish) version of Go.

Re: Go with PHP

#419
Nice. I needed this today. I teach "Advanced" Web Programming and my classes start next week. I've been generally ignorant of most of the kazillion fancy Javascript frameworks and have more or less kept PHP as the base of the course. This is what more-or-less has felt right most of the time.

Re: Go with PHP

#420

Earlier quoted context omitted.

Then use lumen, it comes with laravel.

Nah, I’ll use python or other proper languages, thanks.

> Nah, I’ll use python or other proper languages, thanks.

Python is no more "proper" than PHP as a language.

In fact, they're both identical as far as footguns go.

Post reply on HN