Live data from Hacker News

Re: Moving from PHP to Go and Back Again

blog.breakthru.solutions

41–50 of 281 posts

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

#42

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, Yo…

I think JSP is a great contender, and I see your point about overengineering. PHP with type-checking is alright, but if I'm going to use a scripting language I'd prefer Python or Ruby.

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

#43
post #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 f…

It is a fair enough point though. Even Go written by pros often does not fit together easily. Adjusting one library to fit with another is often a non-trivial task, and many package authors freely admit as much.

I must have links to at least five different gzip middlewares in my favorites, and I'm sure there are more than that...

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

#44
post #21
post #9

Earlier quoted context omitted.

> 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. :)

I've seen a lot of stuff on Pony as well and it looks promising. Have you built anything with it yet?

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

#45
post #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 f…

you got me to make an account and move the gif, I hope you're happy with yourself

Happy enough to give you the ol' retweet: https://twitter.com/ArentWyatt/status/940480529740193792 Italian chef kiss

EDIT: p.s. thank you for designing your website so that can actually handle some traffic. That's worthy of the hacker news gold achievement

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

#46
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…

A slightly different perspective. For the end user Go apps are by far the easiest to setup and use. Usually it's just a single binary to download. That is a huge advantage that can't be beat.

Other languages usually need a large number of dependencies, with Ruby and Node, often an entire build environment, with plenty of potential for dependency hell and hours wasted.

Some may advocate containers at this point, but it just hides the issue temporarily and may be too much for a certain category of end users. You now need to know how containers, ports, volumes and Linux systems work in far more detail when you actually just want to use an app.

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

#47
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.

Remember that Go is still a niche language, and the majority of programmers will never write a single line of Go.

There is a nice trend around Go nowadays, but most people are still writing PHP, Python or Java and Go isn't going to replace any of those.

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

#48
I have been writing Go, Node.js and PHP for quite a while now. I don't think golang is overhyped; nor it's a silver bullet. There are systems like Kubernetes, etcd, and so on that are implemented in Golang and they work really well. I think problem is people trying to use Golang for EVERYTHING! There are so many things I would disagree with in the article; but I won't disagree with the fact that if you want language with dynamic nature (Ruby, PHP, JS) and you expect to find those conveniences in Golang you are flat out wrong. Reading original article this is the exact feeling I get, somebody was like "look look a cool new toy" and the herd followed.

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

#49
post #33
post #4

I don't know why the author bothered to even respond to that Medium article. The Medium article starts with that Go shines as a systems programming language. He lost me right there: how can a language with a garbage collector and a runtime be called a "systems programming language"?

Go's "runtime" is just a library. Programs are still compiled to native machine code.

I think you are confusing the language runtime with the Go "runtime" package that provides an API to the Go runtime. Golang runtime is basically a program, that is running whenever your Go application is running. As a programmer, you do not have full control over the language runtime. It runs things like garbage collection, and serializes/deserializes data in the channels. True system languages like C do not have a runtime. Rust has a primitive automatic memory allocator/deallocator (not a garbage collector!), but I would not call it a full fledged runtime.

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

#50
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…

Go has many flaws (lack of generics is my biggest gripe) but I still manage to be productive in it and it's fun to write.

I think for many people, me included, it's flawed but good enough for the job and fun.

Post reply on HN