Live data from Hacker News

Moving from Go to PHP Again

dannyvankooten.com

261–270 of 371 posts

Re: Moving from Go to PHP Again

#261

Earlier quoted context omitted.

You conveniently leave out all the security mess of that design, especially WordPress. The plugin system is pretty much the cause of all the security issues in WordPress. Perhaps end-users should not have the capacity to so easily add third party PHP code, even if it’s “simple.”

I really don't see how Wordpress is a valid argument here. We run several business systems in PHP serving hundreds of thousands of users. Last time I used Wordpress was over 10 years ago for my personal blog. Haven't used it for anything else. PHP is great for us, regardless of how Wordpress performs.

I was primarily responding to the OP that used WordPress as an example of how easily you can add plugins (third-party PHP code). I see that as an anti-pattern, because it encourages non-developers to add PHP code into the system, much of it poorly written and insecure (or not performant).

But that plugin system also is one of WordPress' greatest assets. And you can add PHP code to any part of a "theme" too. If you turned off the ability for themes and plugins to be "added live" then I don't think WordPress would be nearly as successful as it has become.

Re: Moving from Go to PHP Again

#262
post #32

Earlier quoted context omitted.

Not sure about the OP, but for many Go is the only compiled language they ever used, so they get to attribute features to Go that aren't that unique of it.

> for many Go is the only compiled language they ever used That, or it can be read as "in the family of web-friendly languages". The only other "fast" language widely used for the web is Java.

C++, .NET also come to mind in the widely area, with OCaml, Haskell failing under the not so widely, but fast umbrella.

Re: Moving from Go to PHP Again

#263
post #176
post #98

I love Go, for many situations, but definitely not for a typical user facing website. The community seems bent on the whole "all you need is net/http", but that just isn't practical in modern web development. People like ORMs, easy to handle html forms, security as a default, easy session/cookie handling etc. In the end, web developers want ease of life. Go is a great language for many things, but if it's going to ta…

> but that just isn't practical in modern web development People always use this modern term as if it implies something significantly different or more "advanced". The web hasn't changed much. It's still data over tcp sockets to a contained runtime -- a web browser. > People like ORMs People in my experience are starting to dislike ORMs. If you have done this for long enough, you realize they are great for getting of…

> People in my experience are starting to dislike ORMs

That's what I see around me as well.

Re: Moving from Go to PHP Again

#264

Earlier quoted context omitted.

> for many Go is the only compiled language they ever used That, or it can be read as "in the family of web-friendly languages". The only other "fast" language widely used for the web is Java.

And java is a memory hog quite painful to deploy and tune.

Memory hog only by those that don't know what they are doing and happilly new everywhere.

Yes it is hard to tune, but not so much different than playing with C or C++ compilation switches, across each compiler that is being used in production.

Re: Moving from Go to PHP Again

#265
post #2

For the kinds of applications people tend to build in PHP, PHP is probably a better choice than Go. I'd still do Django or Rails before PHP, but Go just isn't designed to make serverside-rendered database-backed websites especially pleasant to write.

> but Go just isn't designed to make serverside-rendered database-backed websites especially pleasant to write.

Or anything else for that matter, maybe aside from some command line tooling.

Re: Moving from Go to PHP Again

#266
post #66
post #61

Earlier quoted context omitted.

> Go just isn't designed to make serverside-rendered database-backed websites especially pleasant to write. Citation needed. I’ve had a very nice time. It’s statically typed, has excellent templating support, and is generally very productive.

Well, they thought Go would be an alternative to C++ (1) which has never really been the most popular website backend language. I'm glad it's working out for you, but I don't think it's a stretch to say it wasn't really designed for it. On its own, that doesn't mean it's a bad fit; but I agree with your parent and think it's awful for this type of stuff. (1) - https://commandcenter.blogspot.com/2012/06/less-is-expone…

It turned out to be more of a replacement for Python for places where you need speed. Then again, a JVM or .NET language would probably be better.

Re: Moving from Go to PHP Again

#267

Earlier quoted context omitted.

This is so true. I love go so much, because deployment is so easy, but using it for end-user web content is a real PITA.

What makes it a PITA? I use go for building websites and it was the first time web development really made any sense. All the other systems out there require tons of tools, and lock you into doing things their way . So, what makes GO so much of a pain? Maybe ignorance is bliss for me?

> All the other systems out there require tons of tools, and lock you into doing things their way.

Nothing is stopping you from writing everything yourself in any other language. You can do the same in Java or .NET. Then you start finding out you need routing, validation, security, DB access, etc. which golang lacks and ends up making it much more verbose than other mature frameworks.

Re: Moving from Go to PHP Again

#268

Earlier quoted context omitted.

However, deploying a Flask/Django/Rails app still is usually less fun than deploying a PHP app of the same spec written w/ Symfony or Laravel. Configuring a service to monitor gunicorn, which itself took a bit to configure, before I begin configuring NGINX or Apache... it's really a pain in the butt. LAMP/LEMP stacks just... are

So ease-of-install beats code quality, code readability, security, future maintenance and better tooling. Dang. LEPP (nginx, PostgreSQL, Python) stack seems to me an all-around better stack for most of the deployments people use LAMP for.

You have to make your own cost analysis to see what is most efficient for you.

Writing secure, readable, quality code in PHP is something I'm far more comfortable doing than deploying Flask or Django apps on a VPS. That's a function of my lived experiences.

YMMV, but I think declaring python/ruby on the backend is "the all-around better stack" for everyone is a bit short-sighted imho.

Re: Moving from Go to PHP Again

#269
post #9

> Honestly, Go is great. Its simplicity is refreshing and its performance unmatched. I would still pick it if we need a small API or something that requires high throughput. I wonder which part is performance unmatched? My opinion would be Crystal language for its simplicity and higher throughput but unmatched performance is behind Rust and C.

Crystal is still pretty young and under pretty active development. For me, the biggest con is the long compile times for Crystal.

Re: Moving from Go to PHP Again

#270

Why do so many companies keep moving to go? I tried to like it, but it was just so painful to write.

I'm curious, what is painful about it? I came to Go from mainly C++, Java, and Python background, and I feel like it's the best of all 3 (to me). It's compiled and really fast (like C++), it has a great set of libraries and community interaction/support (like Java), and it has simple syntax that is clear and quick to understand (like Python). It's not a perfect language (nothing can ever be), but it's become my favor…

Here's a good starting list: https://www.reddit.com/r/programming/comments/an33mo/aspnet_...
Post reply on HN