Live data from Hacker News

Re: Moving from PHP to Go and Back Again

blog.breakthru.solutions

21–30 of 281 posts

Re: Re: Moving from PHP to Go and Back Again

#21
post #9
post #3

Everyone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using , or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experien…

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

I've been eyeing up Pony (https://www.ponylang.org/) a lot lately. To my eye, it has a lovely syntax and a very useful mix of modern programming features. I'm particularly enamored of the types, safety, actor model, and absence of exceptions. From a distance, it looks like the best parts of Rust, Golang, and Python.

> Haskel? Where are the libraries?

Well, I suppose the same drawback would apply to Pony. :)

Re: Re: Moving from PHP to Go and Back Again

#22

  Go is not OOP in any shape or form, no matter what “they”
  try to tell you. Go is imperative language with procedural
  style of writing code. Yes, you have objects and you can
  attach methods to them, similarly to Ruby where everything
  is an object, but that’s basically it. Never, ever, try to
  repeat yourself in Go. You will crash and burn.

  When it comes to Go, spaghetti code is what you want to write.
This was really funny. Definitely the rantings of someone who is used to too many layers of abstraction and coded themselves into a corner before finally blaming the language. I'm detecting a lack of self-awareness. Here is where the author should have used the gif that was used at the start of the article

Re: Re: Moving from PHP to Go and Back Again

#24
post #3

Everyone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using , or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experien…

Can't help but think of: "The grass is greener on the other side of the fence."

Re: Re: Moving from PHP to Go and Back Again

#25
From My point of view. Go is a great language and this author is right when talking about using Go is better than PHP in cases like Uber or Youtube. I mean, Im not a fan of PHP, I like to use low level languages the most time but web is complicated. First of all, I don't think that not abstracting all the IO and network HTTP socketing or all this stuff 'helps' somehow developing a 'better' web app. Maybe for Uber, Youtube, Google, Docker, AWS, yeah. But for the most of everyday-apps for small/mid-sized business? I don't think so. I mean, it would be great but from my point of view, developing a Go web app for this kind of business, but it could be a little bit overenginered. Using PHP/JSP would be much more straightforward for the developer/s, and maybe for maintenance. The entire cost of the app will be greather as Go developers for Web Apps cost you more than any PHP/JSP programmer out there. Remember Ruby? It's the same problem. From the point of view of engineering, right, take Go, but I think sometimes, isn't necessary. PHP is not the solution but will solve you some problems that could be great for even mid sized businesses. Just my opinion.

Re: Re: Moving from PHP to Go and Back Again

#26
post #9
post #3

Everyone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using , or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experien…

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

What about Apple's language Swift?

Re: Re: Moving from PHP to Go and Back Again

#27

Earlier quoted context omitted.

I’d really like a strongly typed (or optionally typed) Python or Perl derivative. Rust feels most Perl-like so far.

Modern PHP is very nice to work with. Ignore the haters that haven't touched the language in 10 years.

To be fair to the haters, even modern PHP can be horrible. The old nightmares are still around; we've just agreed to ignore them, and maybe deprecate a couple of the worst. (And ternary syntax is still broken, and the standard library is anything but standard.)

But yes, if you're working on a modern PHP project, there's a lot to love: A solid module system, an enormous sea of high quality libraries, type checking, a really nice deployment and scalability story, decent performance, good tooling (IDEs, debuggers, etc.), a servicable C-style syntax. For many purposes (not all!) it's ten times better than, eg, nodejs. (Which might seem like a low bar, I admit...)

Re: Re: Moving from PHP to Go and Back Again

#28
All of the points this article makes are already addressed in the last one.

Yes, Uber is running a production Go service with massive QPS. This is exactly what the original author meant when referring to Go's strengths with single-purpose, high performance, "nano" services with relatively little business logic.

There is also the insistence that frameworks are bad and developers absolutely have to care about "granular control" and "manipulation of bytes and bits" and packets and IO (unless they're writing a "glorified todo list") which rubs me the wrong way. Why is it so hard to acknowledge that there are a large number of perfectly good websites and codebases that do well with popular frameworks?

We ourselves have a proxy layer and a couple other services written in Go, and they work great, but the rest of our stack is Java and some Python. Developers are free to choose the best tool for the job when starting new project, but after a few days of messing around in Go every new service is undoubtedly built using our existing web stack.

Re: Re: Moving from PHP to Go and Back Again

#29
post #9
post #3

Everyone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using , or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experien…

> And yet we keep writing Go. What are the alternatives if you want something with type checking? Java? No, thanks. Haskel? Where are the libraries? C/C++? I guess Typescript is the only alternative

Scala, or C# ?

There's Nim and D too, but I get the lack of big commercial backing could disqualify them.

Re: Re: Moving from PHP to Go and Back Again

#30
post #24
post #3

Everyone I know who uses Go complains about it. Every day you write Go code you will come across some piece of code that would be shorter with templates in C++ or using , or you could do it more simply in Python, or if you were really clever it would be a single line of Haskell. And yet we keep writing Go. By comparison, I'm a bit put off by the Rust community's evangelism, but that might just be my personal experien…

Can't help but think of: "The grass is greener on the other side of the fence."

Or "There are only two kinds of languages: the ones people complain about and the ones nobody uses."
Post reply on HN