6 ms·
I was a php developer for some time two years ago, before switching to go. I was mainly solving high performance parallel processing and distributed problems.
by m4l3x 5y ago
I was a php developer for some time two years ago, before switching to go.
I was mainly solving high performance parallel processing and distributed problems.
There are things like ReactPHP which are an awesome achievement, but still every lib you use needs to be developed for ReactPHP.
After learning about go and goroutines I only find it painful to solve these problems in PHP, even using ReactPHP.
- jhgb 5y agoSo you switched from a language X not designed to do Q to a language Y designed to do Q, presumably because language Y didn't exist when you started doing Q. I imagine that happens all the time, but seldom is it a fault of X. But what I find puzzling is why PHP, of all things, was your choice for these kinds of problems before Go appeared.
- edoceo 5y agoIsn't Go like 10 years old now?
- jhgb 5y agoMore like thirteen. Apparently I misread the comment I was responding to as "for two years some time ago". Now I'm not sure why someone would have chosen PHP for such a task two years ago.
- m4l3x 5y agoSorry for unclear phrasing. I meant I used php from 2018-2020. And honestly I don't know why to use php for the task. I started at the company 2018 and the tech stack was given. A good compensation and praising like "PHP has changed and now supports types etc." let me take the opportunity. My bad, because it took me a lot of time. I needed to do benchmarks were actually PHP turned out to have comparable performance in the scenario under test (concurrent consuming of message Queues and heavily write operations to databases), however it took more than 4 times the effort to get there with php. In the end I resigned and switched to a new opportunity doing golang solving similar issues. My point is, that there are folks out there (ab)using PHP for all and everything. And finally php has made a lot of improvements but it is just catching up with other languages. There are still a lot of libraries, that still use older versions and probably never will get updated.
- jhgb 5y agoThe problem with PHP in this case has nothing to do with types. So their reasoning was wrong from the very beginning. I suspect that no amount of "catching up" will help here, just like no amount of development will turn future axes into screwdrivers. They'll still work like perfectly good axes, though. Just like PHP will still be able to handle HTTP requests perfectly well.
- fraktl 5y ago
- jbboehr 5y ago> I've written code that uses ReactPHP, and I can't see why every lib you use needs to be developed for ReactPHP. My guess is that you're an inexperienced dev. Not OP, but perhaps every library is a bit of an overstatement. But, as most PHP code was historically written under the assumption that blocking is fine, potentially any library you use could inadvertently block your event loop.
- m4l3x 5y agoThanks for clarifying. That is exactly what I meant.
- dang 5y agoWe've banned this account for repeatedly posting personal attacks after we asked you to stop. Not cool. If you don't want to be banned, you're welcome to email hn@ycombinator.com and give us reason to believe that you'll follow the rules in the future. They're here: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html.
- m4l3x 5y agoActually you are right, that was my first gig after college, however I actually know of Swoole and researched a bit, but when codebase and tech stack is already given to you by people worshipping their choice you haven't a real handle. Like written above my statement was meant like: there are people out there, the are so in love with php, that they would (ab)use it for everything. I also know it is my fault to hired with these guys in the first place, however it definitely teached me how to not do things.
- mountainriver 5y agoYeah not sure why anyone would use PHP nowadays, you can be as productive and more efficient in Go. Plus you can build just about anything with Go! Whereas PHP is pretty strictly for web development.