Live data from Hacker News

Re: Moving from PHP to Go and Back Again

blog.breakthru.solutions

101–110 of 281 posts

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

#101
post #45

Earlier quoted context omitted.

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

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

Not really. When I had a blogpost on the frontpage for the first time, I checked the monitoring and saw a CPU load of 6% of a single core and 1 megabit per second (that's bit, not byte). [1]

And it's simple, really. You just write some text on the page, add a small stylesheet. And then you just stop, resisting the urge to add any JS and tracking and hero images. You just stop. And instead of generating your HTML on the fly from a database, you just serve a static HTML file.

[1] Graphs: https://blog.bethselamin.de/posts/latency-matters-aftermath....

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

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

> five different gzip middlewares

At which point is it easier to put the app behind an nginx reverse proxy? Chances are that you have a reverse proxy anyway since one Go app is not nearly enough to saturate a server CPU.

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

#103
post #82
post #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…

If you look for an oop or fp language you are also out of luck. You are only happy if you look for a better C which most people aren't.

That is basically Go’s niche, the revival of Limbo, compiled instead of using the Dis VM.

Which took C’s place for user space applications on Inferno, the last Plan 9 iteration.

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

#104
post #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 i…

Aren’t JVM language equally simple? Just a fat JAR.

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

#105
post #79

I see no facts or genuine refutation in this article, just opinions. Therefore I can only assume that truth hurts because the article you are trying to argue with has a bunch of valid points. If you look at the history of Go you have to realize that it was created for the reason which is in the original article: to be a better C. If you come from C it is good, sure. And you can write big projects in it like in C (jus…

Okay, let's say I agree with your arguments:

1. Go "is still not as fast as Java can be" [1]

2. "Go lacks the most basic tools which any seasoned developer can expect from a language (like generics)"

3. "Go does not have a de facto build system and you can’t handle dependency management in an easy way" [2]

4. odd error handling

5. not a lot of libraries to choose from [3]

6. possibly more arguments that I missed when summarizing your post

The way you paint it, people would be stupid to use Go. However, thousands of very talented developers use Go everyday. How can you explain this disconnect?

[1] I like how you didn't say that Go "is not as fast as Java". That's a subtle, but important difference.

[2] `go install` is the build system and I have solved dependency management for myself with literally a small shell script [4], and an official solution is in the works [5].

[3] I never had trouble finding libraries for use-cases both common and obscure).

[4] https://github.com/holocm/golangvend

[5] https://github.com/golang/dep

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

#106
post #51

> These are hard issues to solve with PHP, so hard that Facebook hand crafted a SPECIALIZED VIRTUAL FREAKIN’ MACHINE to deal with the performance issues inherent in PHP. Does that really seem like an “easy” solution? It is worth noting that this was pre-PHP7. Post-PHP7 the out of the box performance is similar or better to what Facebook did with the HHVM.

Also, very few projects will ever end up at the scale (user base/metrics) that Facebook had. 99% of all PHP software will be fine with a quadcore server with 4GB RAM, running a LAMP stack. This can be scaled as needed (eg moving off mysql, adding a reverse proxy, real load balancing).

In cloud time performance is simply a matter of cost saving. No matter what your needs are, if you're able to serve more request per cpu cycle or Mo of memory, then you'll save on server costs.

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

#107
Perhaps it's characteristic of all language discussions, but Go articles seem to generate an extremely polarized set of comments. My other favored languages (Common Lisp, Nim, Rust, Smalltalk) tend to do the same thing, but in Go's case the passion seems so... misguided.

In my opinion, Go is just such a bland-in-a-good-way language. And I enjoy writing it, for the record. Came back to it after a while not writing it and discovered warts I had missed before, but it's still pleasant. Can't help but think people just need to relax a bit when it comes to Go. Listen to Rob Pike speak about it compared to Rich speaking about Clojure: Go's not the language to get worked up about.

(Please put generics in Go 2!)

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

#108
post #46

Earlier quoted context omitted.

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 i…

Aren’t JVM language equally simple? Just a fat JAR.

You're forgetting Java.

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

#109
post #82

Earlier quoted context omitted.

If you look for an oop or fp language you are also out of luck. You are only happy if you look for a better C which most people aren't.

Even then you can go wrong. I've learned that first hand while trying to write some lower level networking stuff in Go. Also OOP in Go is perfectly fine.. it's just by composition only and without inheritance.

Many people were taught OOP the UML and Java way†, to which the concept of prototype-based inheritance is completely alien, while composition is not even on their radar.

† Although they have their fair share of issues, this is not a jab at UML nor Java themselves, but the way things have been taught, terribly, for so many.

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

#110
post #78
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

Java, C#, F#, C++, D, Rust, OCaml, Haskell, FreePascal, Ada, Swift, Nim look all pretty fine to me, and yes there are ways to compile Java and .NET languages to native code just like Go. As for libraries, what matters is if the desired use case is covered, not winning the App Store count.

I like go for most things more than all of those, though F# would be promising if I felt better about .net stuff and Linux.
Post reply on HN