Live data from Hacker News

Why Go gets criticized so much

npf.io

181–190 of 251 posts

Re: Why Go gets criticized so much

#181

Disclaimer: I work at El Goog. I recently moved teams so that I could use Go exclusively. It's often been said that Go solves the problems Google developers have, and it's 110% true. It's much easier to get things working, and it's much easier to write things like Protocol Buffers. But the key for me is that Go isn't fun in the sense of "wow, I'm so smart that I managed to one line this thing", it's fun in the "wow I…

The reason Google's Java codebase is impossible to understand is not the language, it's mindless application of 'best practices' like dependency injection on an industrial scale. Guice is open source, anyone can go look at it. Just imagine a big complex server in which the "new" keyword wasn't used anywhere because everything was handled by the dependency injector. You get these things: 1. Things that should be compi…

You are predicting the future (of Go) based on the past (of Java).

Non-idiomatic Go (or as you call it "bizarre hacks disguised as cleverness") is frowned upon. One example that comes to mind is the Martini web framework[1], which, once pointed out, resulted in a rewrite[2].

[1] https://github.com/go-martini/martini [2] https://codegangsta.io/blog/2014/05/19/my-thoughts-on-martin...

Re: Why Go gets criticized so much

#182
post #181

Earlier quoted context omitted.

The reason Google's Java codebase is impossible to understand is not the language, it's mindless application of 'best practices' like dependency injection on an industrial scale. Guice is open source, anyone can go look at it. Just imagine a big complex server in which the "new" keyword wasn't used anywhere because everything was handled by the dependency injector. You get these things: 1. Things that should be compi…

You are predicting the future (of Go) based on the past (of Java). Non-idiomatic Go (or as you call it "bizarre hacks disguised as cleverness") is frowned upon. One example that comes to mind is the Martini web framework[1], which, once pointed out, resulted in a rewrite[2]. [1] https://github.com/go-martini/martini [2] https://codegangsta.io/blog/2014/05/19/my-thoughts-on-martin...

Non-idiomatic code is frowned on by all programmers working in every language.

The problems start when the "ma" is dropped from idiomatic. There's nothing in the design of any language that can stop people coming up with idioms and ideas that sound clever and become widely adopted but which actually cause problems down the line. Go is not immune to this. I'd argue Go is largely composed of such things to start with!

Re: Why Go gets criticized so much

#183

Disclaimer: I work at El Goog. I recently moved teams so that I could use Go exclusively. It's often been said that Go solves the problems Google developers have, and it's 110% true. It's much easier to get things working, and it's much easier to write things like Protocol Buffers. But the key for me is that Go isn't fun in the sense of "wow, I'm so smart that I managed to one line this thing", it's fun in the "wow I…

I have the feeling that golang is very focused on pulling code from github, but I've had a hard time packaging golang applications. I have succeeded with go-ipfs, which vendors all dependencies and includes them in their release tarballs, but I'm not sure how to do that with other applications which import dependencies from github.

Re: Why Go gets criticized so much

#184

I've been working in Go now for over a year and its honestly made my day-to-day life as a software engineer enjoyable. What gets me down about working in this industry is toiling away on products only to never see them released or being frustrated by absurd compile times, poorly tested components and abstract cathedral architectures. I worked on large C++ projects for around 7 years and i don't care for another flame…

> If someone creates a ML variant with a day-to-day experience as clarified as Go then I will gladly jump on board.

I think Kotlin and (eventually) Swift comes very close, but both have compatibility as a high priority, which complicates the languages a bit. But I'm hoping these languages will be able to serve as gateway drugs into the world of ML-style programming, and that we'll soon see a no-compromise ML-style focusing on the full experience.

Re: Why Go gets criticized so much

#185
post #161

Earlier quoted context omitted.

"The problem with handling everything right away is that it lacks flexibility to handle things in what could be the optimal manner." You can pass the error (or another) up the stack. The language is flexible.

"Passing up the stack" is fairly minimalistic in an environment where you could be running thousands of goroutines, some (many?) of which may share memory. If you do it that way, you seem to forego a lot of error encapsulation straight away and quickly find yourself into undefined territory.

doesn't matter whether no goroutines or thousands - you either handle errors or pass upwards. Anyhoo, just pointing out that it has the flexibility to do either.

Re: Why Go gets criticized so much

#186

Earlier quoted context omitted.

The reason Google's Java codebase is impossible to understand is not the language, it's mindless application of 'best practices' like dependency injection on an industrial scale. Guice is open source, anyone can go look at it. Just imagine a big complex server in which the "new" keyword wasn't used anywhere because everything was handled by the dependency injector. You get these things: 1. Things that should be compi…

Very recently I have begun to work as programmer, and having to work with PHP I looked at phpunit and unit testing (first time I do it semi-seriously). The guidelines for mocking that I have found are about dependency injection (phpunit has some helpers, but I think that's it). What is the alternative to it?

The problem isn't with the idea of using mocks in testing. The problems start, as often the case, when people start religiously applying a design pattern and end up over using or abusing it.

The problematic thought process goes like this:

1. Gee, my tests are really slow and flaky and hard to run because they talk directly to a database. I know! I'll swap out my real database connection with an in memory database.

2. Things are better, but they're still slower than I'd like. Maybe I can just write a wrapper around my database code, make it implement an interface, and then provide a custom implementation just for my unit tests. Instead of having my class construct a database connection directly, I'll make it passed in as a parameter. Then they'll be nice and fast!

3. Whoa, now my tests run instantly! How great. This mocking pattern is awesome. I want to mock everything! But hmm, I have a lot of objects and they often depend on other objects, like services of some sort. And I was told in school that God Objects and global variables are bad. So I can't use those because I want to be a good programmer and good programmers don't use those. This is making my code kind of a mess because now every time I want to construct an object it takes lots of parameters when before it didn't.

4. Hm, this dependency injection library sounds like what I want. Instead of constructing my objects directly, I ask an "injector" to do it for me. And it will then consult a table of bindings, and then find or construct the dependencies, and then build the object I want, recursively. All I have to do is [insert long complicated process here].

5. Meanwhile, some other programmers look at what's going on. Interesting! They say. Those programmers know what they're doing and they're converting their whole codebase to use dependency injection. They claim it's a best practice to make testable code. We want our code to be testable too, we should do the same thing. Plus, we can call this refactoring and code maintenance and get paid for doing essentially brainless work, instead of having to take risks on developing new features or fixing bugs.

The story ends like this: pretty quickly this newfound "best practice" is spreading throughout your codebase like a fire, and now when you deploy your app, you get an error whilst the app is running. You then try to figure out what's causing the error but 25% of the time you try to follow a method call you end up looking at an interface instead of code, and when you try to figure out what implementation of that interface your app called you have to read and decipher tons of binding definitions.

The correct place to stop in the above story was at point two. And the reason is not just code readability. Once you start over-using mock objects, you can start to discover that your mock is implementing what you think that service does, not what it actually does, and you can end up with code that's actually buggier than code written with traditional fat test dependencies would have been. Fail.

Re: Why Go gets criticized so much

#187
post #177

Article didn't convince me to think following arguments are wrong: * Go is a language stuck in the 70’s. * Go ignores 40 years of programming language research. I tried to use Go and was shocked how they can use it without package manager, without generics, with so brittle concept of channels, with executable comments in code and with so authoritative model of taking decisions about language evolution. So I still thi…

What are executable comments?

https://news.ycombinator.com/item?id=9522973

Re: Why Go gets criticized so much

#188
post #72
post #28

I think there is a better explanation for why people dislike Go. All programming languages currently used for the web have gigantic downsides. They're slow. They have terrible package management. They have poor standard libraries. They have no static typing. They have no visual debuggers. They have no good IDE support. They don't integrate well with frontend code. Some programming languages are more flawed than other…

> Then Google announces Go. A cross-platform systems programming languages for high quality web services. Did they actually advertise it as a language for web services? I thought it was designed for command line tools mostly, not for serving HTTP/HTML.

I came here to say this. It's not fair to criticize Go as not optimal for web services if it wasn't designed to be optimal for web services.

Re: Why Go gets criticized so much

#189

Hate is a very strong word. I don't see a point in "hating". Strong dislike, however, I can see, and I think my reasons for not liking Go are "Go ignores 40 years of programming language research", "Go is a language for blue collar (mediocre) developers" and "that other people were falling for it." I guess I have a similar dislike for every technology which is primarily meant to make the life of the developer, rather…

> I guess I have a similar dislike for every technology which is primarily meant to make the life of the developer, rather than push the end product's quality.

I would suggest that this is short-sighted. After all, the end product is created by the developer. Making the developer's life easier and end product quality are not contradictory goals.

Re: Why Go gets criticized so much

#190

Earlier quoted context omitted.

I hate debugging someone else's code that has unused variables in it as much as this guy seems to hate the go compiler.

Any normal compiler usually allows overriding these options. I normally write Haskell and it has it all: unused variables, unused imports, name shadowing, non-exhaustive pattern matching, everything. But these things are warnings in my dev build and errors in the release build. That's a sane way to do it.

Except some people wouldn't enable -Werror, and the quality of Go code would suffer on average.

Plus, now your compiler has options.

Post reply on HN