Live data from Hacker News

Ask HN: Go programming language is over ten years old. What do you think of it?

news.ycombinator.com

121–130 of 310 posts

Re: Ask HN: Go programming language is over ten years old. What do you think of it?

#121

Great tool, two big negatives. First, checking result values is dumb. It adds 50% more code. Add exception handling. Second, the way imports work is obviously due to some internal google kitschy-ness. Remote import paths are so dumb. People set up entire domains and CDN's just to host some code. The import path has to have a specific format, you can't have three levels. github.com/me/sub1/module won't work, so everyo…

A super important principal for large code base is locality. I should be able to look at a function and understand everything about its possible code paths. Exceptions make this impossible (most of my experience with exceptions coming from C++ and Python). People that think like me would forbid exceptions every where.

Re: Ask HN: Go programming language is over ten years old. What do you think of it?

#122

Earlier quoted context omitted.

But...you are comparing a web framework with a Go's standard library. I mean, it's not a fair comparison. I'm pretty sure there are Go modules that support those handy things.

doesn't go stdlib contain an http server library "that you are supposed to use in prod"?

It does. It's rock solid and most people use it in production. But the parent is more concerned about quick and handy functions. IMHO, such functionality is usually part of third-party libraries and is certainly an option in Go. It's just idiomatic Go favors KISS principles, less external dependancies and a more self-contained software. The benefit is that pretty much all the Go source code is more-or-less identical, regardless of an author. It makes it super simple to understand and deep dive into a random complex piece of software.

Go is not about abstractions, Go is about solving problems here and now.

Re: Ask HN: Go programming language is over ten years old. What do you think of it?

#123

When a struct implements an interface one has to keep guessing that it really does so (unlike Java, C++ there is nothing in the syntax of go that would show interface inheritance as a fact), and that really doesn't help the poor guys who have to read/understand/maintain some code. Why did they do that to a language that is based on interfaces?

I often find it useful that implementing an interface is implicit. For example maybe I'm using a library that provides a struct A. I can make another struct B that mocks that functionality for testing, and then everywhere in my code use an interface C that encapsulates A and B. That wouldn't be possible if A had to explicitly declare that it implements C.

If you want to explicitly declare that you implement an interface.. just put it in the comments, or it's common to see a line like this after a struct declaration:

  var _ C = (*A)(nil);
It's a way of asserting that A satisfies C.

Re: Ask HN: Go programming language is over ten years old. What do you think of it?

#124

Earlier quoted context omitted.

Because every time I need to use a lock I know I am not smart enough to do so. Channels and go routines, I can reason about. (Tho they are slower - I have a runtime stats package that just stuff the numbers into a channel and then returns to the calling goroutine. I did an implementation using Atomic’s and it could sustain like 20x more calls per second before using all the callers CPU. But I still use the channel im…

Rust is ideal for this scenario: it lets you use the faster locks / atomics, and the compiler will check everything for you (assuming you can use a standard implementation rather than needing to implement your own - but there are well tested libraries for most common use cases).

It is on my list of things to learn but learning go made me so happy the urgency has decreased. Did they ever finish that rewrite of the core unix cmd line utils from C to Rust? Like find and if config etc. a rust busybox I guess.

Re: Ask HN: Go programming language is over ten years old. What do you think of it?

#125

Earlier quoted context omitted.

Rust is ideal for this scenario: it lets you use the faster locks / atomics, and the compiler will check everything for you (assuming you can use a standard implementation rather than needing to implement your own - but there are well tested libraries for most common use cases).

It is on my list of things to learn but learning go made me so happy the urgency has decreased. Did they ever finish that rewrite of the core unix cmd line utils from C to Rust? Like find and if config etc. a rust busybox I guess.

It's not finished, but a decent amount is implemented: https://github.com/uutils/coreutils

In general there has been more effort put into trying to improve on the default tools through projects like ripgrep (grep), bat (cat), lsd and exa (ls), and fd (find) rather than creating drop-in replacements that don't provide all that much over the battle tested originals.

Re: Ask HN: Go programming language is over ten years old. What do you think of it?

#126
Its a great programming language that is helpful to solve problems without wasting time.

I really appreciate the simplicity, I think it totally makes sense at work where not everyone wants to deal with weird code. I think maintaining old golang code will not be a major problem in the future for example. The garbage collector make things a lot simpler too.

The dependencies management is not great compared to npm/crates/rubygems/... but it's still better than the Java world and it exists and it's being used.

I wish generics were already there, and I'm not a fan of the interface{} keyword. I'm also sick of the if err!=nil everywhere, I wish it could have a better error management like Haskell/Elm/Rust/...

I use Rust in my latest personal projet and while I prefer Rust, it's a bit too complex quite often and I spend more time thinking about rust things than thinking about the problem I'm solving.

This is not the case with Golang. It's not a fun programming language but it does most jobs very well.

Re: Ask HN: Go programming language is over ten years old. What do you think of it?

#127

It's a real good Java

Java is actually better(faster runtime and less energy usage) than Go but where Go beats Java is memory usage. C beats all of course. https://greenlab.di.uminho.pt/wp-content/uploads/2017/09/pap...

Java might in theory be faster but I have never seen a real Java team put out code that was capable of doing 10k requests per CPU per second. Always hitting per thread limits or logging lock contention or GC issues etc. except one thing written by a genius with NIO. Ordinary people can hit those performance numbers with Go and without special smarts.

Re: Ask HN: Go programming language is over ten years old. What do you think of it?

#128
post #102

It’s a unique and different language that clearly hit some kind of niche. It’s great when a language has any users and this one has quite a bunch. That’s super cool! Personally I don’t like it. Not low level enough for when I need to go low level, not high level enough when I want to go high level. Also I would have wanted generics right from the start; that should be the norm for typed languages unless the types are…

Go has wide enough adoption that I don’t think you can call it niche anymore. It’s become somewhat of a de-facto systems/infrastructure programming language and is replacing Python in a lot of places where it was traditionally used for automation. The language is simple, performant and writing concurrent code is intuitive (although I feel Go developers tend to get carried away using channels/goroutines).

I did not mean niche in a small way. It is a big niche. Maybe I could have used a better word.

Re: Ask HN: Go programming language is over ten years old. What do you think of it?

#129
post #6

It is a great alternative for things that otherwise you would build with C++,C or Java. Not so much for things you would otherwise build with python, ruby, etc.

If you take a bit of time to think about the data flow, you can get it about as succinct as Python. And then you get to distribute a static binary that will be light on the CPU is needed and use all the CPUs if needed.

Re: Ask HN: Go programming language is over ten years old. What do you think of it?

#130
I have no interest in Go because it is so limited, more limited than other languages that I have already moved beyond, such as C#.

I am far more interested in cutting edge languages such as Rust (borrow checker) or Idris (dependent types) or even C++ 20 (template madness), since these will allow me to express things that I cannot express in other languages. What does Go bring to the table?

Note that my perspective is of someone who works in a small team of experienced programmers, not a large organisation with more junior ones.

Post reply on HN