Live data from Hacker News

Why I Don't Like Golang (2016)

teamten.com

201–210 of 237 posts

Re: Why I Don't Like Golang (2016)

#202

Earlier quoted context omitted.

Not that person, but I'll call out a few issues I've had with the go stdlib: First, it has a lot of useless packages you typically wouldn't use, like "log" and "flag" (which work, but are way worse than third party alternatives like logrus and pflag), but also like "syscall" (as it says 'deprecated, use 'golang.org/x/sys' instead), "image/draw" (nope, you wanted 'golang.org/x/image/draw' usually), "path" for working…

> interface for external packages to implement so I can plug in logging libraries without rewriting the world. Well, it's structural, so you don't need other packages to implement an interface rather you need them to accept an interface. That also makes it clear it's a bigger ask - you're not asking a dependency "please also do X" but instead asking "please never need to more than Y". > Want to figure out what errors…

> If you need multi-pathed error handling (usually people don't and are just making it out of habit!), worry about what things can do, not what they are.

When I'm looking at an error, it's typically for one of two reasons:

1. To set a correct status code, such as http 5xx (internal server error, our disk flaked) or a 4xx (user error, you gave us invalid input).

2. To provide a better error message, such as to localize it into an error string.

If you're building CLI tools for yourself, sure, every error is fatal and you can read english so you don't need either of those. For most go projects, both of those are relevant concerns for a large number of error paths.

Go's type-system does not help you at all.

Speaking of...

> Well, it's structural, so you don't need other packages to implement an interface rather you need them to accept an interface. That also makes it clear it's a bigger ask - you're not asking a dependency "please also do X" but instead asking "please never need to more than Y".

Yup. That is a big problem. That's the root of the error problem too, where every package returns the stdlib error interface, which is a tiny subset of what you usually want.

Re: Why I Don't Like Golang (2016)

#203

Earlier quoted context omitted.

Musicians and carpenters make far less than programmers, but they still buy their tools. Software people are too entitled. Even if you are not professional, you can still afford 54c a day ($200 a year). Even a programmer in India can.

How much would a carpenter pay for a fancy bench top for their workshop? I'm guessing not a lot, since they can make one themselves. Programmers are toolmakers, and are therefore harsh critics of tools they use; just like a carpenter will tell you everything that's wrong with the design, and choice of wood that went into a pricey, but ultimately-affordable-to-a-carpenter bench top. Having access to cheaper, good-enou…

A carpenter is not going to make his/her own table saw. A basic table saw costs $300ish.

I'm not writing my own IDE or my own database. I can, and I have, in times past. I do pay for tools that I need.

Re: Why I Don't Like Golang (2016)

#204

Earlier quoted context omitted.

Musicians and carpenters make far less than programmers, but they still buy their tools. Software people are too entitled. Even if you are not professional, you can still afford 54c a day ($200 a year). Even a programmer in India can.

1. A Musician has one tool. Ok, maybe a note-stand etc. But in software, there are thousands of "tools" you can buy. 2. Physical tools vs making copies of some bytes. No need to retread this here, but bottom line: Not comparable.

No semi-successful professional musician is so bare. Software engineers are not your average starving type of people (unless they are willingly doing intermittent fasting!)

Re: Why I Don't Like Golang (2016)

#205
post #107

Earlier quoted context omitted.

I literally don’t understand why so many people believe Go is a C replacement. Like it is by all means in the first camp of managed languages with a huge runtime.

Replacement for C in many areas it is used for != replacement for C in all areas it is used for

Sure, as long as Node, C#, Java, Haskell are all C replacements as well. Which I am okay with claiming, as GC has no considerable overhead for most use cases, but go is not unique in any way or shape.

Re: Why I Don't Like Golang (2016)

#206
post #99

Earlier quoted context omitted.

Another big area that is lacking is Go makes it so hard if you want to use something other than a primitive as a hash key (Rust is guilty of this as well, mind you). This is something that should come out of the box in any modern language in my opinion.

> Rust is guilty of this as well, mind you #[derive(Hash)] struct X{ ... } Seems easy enough to me? The only annoyance is if a third party type didn't implement Hash, but you can solve that with a manual implementation instead of a derive.

> you can solve that with a manual implementation instead of a derive.

How? I thought the orphan rule said you can only define trait implantations at struct definition or trait definition

Re: Why I Don't Like Golang (2016)

#207

Earlier quoted context omitted.

> Rust is guilty of this as well, mind you #[derive(Hash)] struct X{ ... } Seems easy enough to me? The only annoyance is if a third party type didn't implement Hash, but you can solve that with a manual implementation instead of a derive.

> you can solve that with a manual implementation instead of a derive. How? I thought the orphan rule said you can only define trait implantations at struct definition or trait definition

ding ding ding! This has been a problem for me a number of times. The quick workaround is pray that it implements Debug and in a reasonable way and take the hash of the string instead

Re: Why I Don't Like Golang (2016)

#208
post #83

Earlier quoted context omitted.

I dunno I've been in plenty of situations where a department head will literally beg me to buy things so they can reach the same budget spend as last year so their budget isn't slashed (DoD), and have seen the same situation in VC-backed startups looking to come up with tax write offs. Businesses for the most part love spending money and would rather do that than pay taxes, which is definitely a problem with corporat…

No sane business wants to spend $100 to save $15-30 in taxes.

Tell that to Amazon or any FANG company that doesn't pay taxes because their clever use of writeoffs and "losses"

Re: Why I Don't Like Golang (2016)

#209
post #86

Earlier quoted context omitted.

Musicians and carpenters make far less than programmers, but they still buy their tools. Software people are too entitled. Even if you are not professional, you can still afford 54c a day ($200 a year). Even a programmer in India can.

We pay $3500 every 2 years to have up-to-date hardware

And if we try to re-sell our equipment to try to recoup some of that cost, best you can get is like 1/4th the original price typically by the time it's time to sell

Re: Why I Don't Like Golang (2016)

#210
post #99

Earlier quoted context omitted.

Another big area that is lacking is Go makes it so hard if you want to use something other than a primitive as a hash key (Rust is guilty of this as well, mind you). This is something that should come out of the box in any modern language in my opinion.

Maybe I misunderstood you, but you can use structs as keys of a map.

not if it doesn't have equailty defined. Then you have to define it. Oh, and it's an AST node someone at X company wrote and there are 100+ node types. Have fun!

In crystal there is a reasonable data-based default hash implementation that you can just rely on.

Post reply on HN