Live data from Hacker News

Go with PHP

gowithphp.com

441–450 of 532 posts

Re: Go with PHP

#441

> Read the following code as if it were a documentation page: If I read this as a documentation page, this makes me scared: `Order::create($validated + ['status' => 'pending']);` What does it mean to add an array to something?

This could be rewritten as: Order::create([...$validated, 'status' => 'pending']);

Ah, makes sense. Thank you.

Re: Go with PHP

#442

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…

Thanks, I was confused with the downvotes as I was just relaying the facts of my experience!

Good to hear someone else has had a similar experience. Nothing against PHP at all, but it's definitely not suited for scale.

Re: Go with PHP

#443
post #432

Earlier quoted context omitted.

> The magic in these frameworks is evil, and likely a big part in ruining PHP's reputation. Have you actually used Symfony? It's an absolute pleasure in its domain and includes rich debugging abilities through its dev toolbar.

I have, though I admit it's been about 10 years since and my memory may be mixing in (pun intended) things from version 1.

You're really doing a disservice to others with opinions that are so out of date.

Re: Go with PHP

#444
post #407

Earlier quoted context omitted.

I'd argue that a vast majority of web applications are not "dealing with people's money" so there's not a need to code for such cases. The right tool for the right job, etc. etc.

I'd argue being able to stop worrying about your code after writing it and not making decisions like these is a good enough reason to just do it right. Especially when it's not much more additional work

https://jacobian.org/2022/sep/9/quality-is-systemic/

Re: Go with PHP

#445

I built and maintained open source frameworks in both. I left PHP for Go. 1. with http://sqlc.dev I don't have to write ORM or model code anymore. Define all your SQL in an easy to audit file and all your models and interfaces are generated for you. 2. with http://goa.design I can have well-documented OpenAPI API's that any team can generate a client for in any language. It also generates the HTTP JSON and gRPC clien…

It sounds like you haven't touched PHP in a very long time. Your comment reads like a 2015 forum complaint - which, to your credit, certainly would have been all valid points 8 years ago.

The language has evolved since. The ecosystem has evolved since. Most of the things you're complaining about are solved paradigms that no one does manually anymore unless they're trying to drastically improve on ecosystem tooling.

Even your complaints about Laravel are solved by open source tooling in its own ecosystem.

Nothing about your preferences are really unique to go - most, if not all of these tools exist in many popular languages.

The one solid point you have is that go lets you do many of these things by default without adding anything. To which I say: Duh. Go doesn't have a massive ecosystem of backwards compatible projects to continue supporting. It was barely used outside of niche cases until 2-3 years ago. In 10-15 years time, I'm sure people will say the same things comparing Go to a newer language.

Re: Go with PHP

#446

Earlier quoted context omitted.

Hi! I'm looking for advice on how Rails vs Laravel compare (as I'll have to pick one of them soon for a project). Assuming the same knowledge and familiarity on both of them, why would you prefer Rails over Laravel? Thanks!

The reason why I stuck with Rails is because I am already a Ruby user. I like PHP and all but I am way more comfortable with Ruby. I don’t think there is anything Rails can do that Laravel cannot and wise versa. It’s about taste. I think Rails + hotwire hit the sweetspot for me!

Thanks!

Re: Go with PHP

#447

Earlier quoted context omitted.

I love PHP, but a red flag?! If they’re busy in the Ruby/Java/C#/Go worlds (all get-it-done environments) then I’d just assume they don’t read many Hacker News praises for PHP. It’s easy to have not encountered it since the bad old days unless you work on a team that uses Laravel for some things. I do understand hiring someone who has that tradesman programming ethic and is comfortable with Linux, but that’s more req…

Yeah, that's fair. Now that you mention it, 90% of these guys where I get that red flag instinct I described are Javascript devs or wannabe Javascript devs. It's as if the JS ecosystem has driven an entire generation of developers insane

I'm in complete agreement there; I've seen a number of those. I like to ask simple questions about what they like about programming to catch some of those issues and look for a certain amount of self-understanding.

Re: Go with PHP

#448
post #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.

For "Advanced" Web Programming, I don't really feel like you're hitting the mark by sticking with PHP. Sure, it works, and will probably get the job done for most web projects any of your students will ever work on, but if you want to get people excited while making them employable, it's important to teach new tools and frameworks. Unless the "Advanced" part is more about the techniques and patterns and less about the language, I think you're doing them a disservice by not branching out. And, of course, you can teach patterns and techniques in any modern language.

I'd expect to see some discussion of async job processing and front-end web frameworks in any advanced web programming course, high-school or college level. Honestly, just teaching the usual react stack with a typical node backend would probably be ideal since JS is approachable, react is still "cool", and you still only need to use one language.

Re: Go with PHP

#449
post #245

Earlier quoted context omitted.

Rails console, metaprogramming, elegant blocks, procs & lambdas, Turbo/Hotwire. Concise Ruby language vs PHP framework code with hideous inlined fully-qualified method paths.

all of that pretty much is available and arguably much better in Elixir/Phoenix

OP was comparing Ruby and PHP.

Re: Go with PHP

#450

Earlier quoted context omitted.

I've tried Laravel, it's a beautiful framework. But I see no reason to switch from Rails, it's a beast.

Hi! I'm looking for advice on how Rails vs Laravel compare (as I'll have to pick one of them soon for a project). Assuming the same knowledge and familiarity on both of them, why would you prefer Rails over Laravel? Thanks!

Ruby is a beautifully-designed, concise language. PHP is the opposite. If you like Java-style verbosity you may like PHP. I don't.
Post reply on HN