4 ms·
Golang is continuing to grow to serve this use case. Just like explicitly handling errors though- you'd be expected to explicitly handle null values if you want
by jonfw 4y ago
Golang is continuing to grow to serve this use case. Just like explicitly handling errors though- you'd be expected to explicitly handle null values if you want to be safe from them
- rowanG077 4y agoIn many ways Golang is much lower level then Rust. So I wouldn't say it handles this case.
- jonfw 4y agoI'm not very familiar with rust, would you be able to share an example?
- dfinninger 4y agoI’m not the parent poster, but I would assume they are referring to Go’s typical usage of for-loops over something like Streams/Iterators/Comprehensions. (And other cases where idiomatic Go uses the simpler option)
- losvedir 4y agoI like the idea of Go, except I don't think it quite has the type system that I like. I saw it got generics recently, but that actually wasn't very high on my priorities, compared to being able to say "this value is an integer and definitely not nil", OR, saying "this value is an integer OR it could be nil, and I want the compiler to make sure I'm considering the nil case." And I appreciate that it has the "errors as values" like I was asking about, though, the types don't really force you to handle them, I don't think?
- salmo 4y agoIIRC, you can't have a nil value, just a nil pointer. I like that because it makes you avoid using nil/null/none as a magic value as a habit (not completely, because yeah, pointers). But it's definitely no Rust. It's a very small language by comparison. That's a positive for me, but you can't have all the Rust things and that at the same time. I'm not a "1 language for everything" guy. I tend to choose for the task if given the choice or choose for the team so I'm not stuck being the only one that can maintain it. And for anything more than a toy for myself, I always pick something mainstream. If I'm slapping something together as a 1-off, I tend to go with Python. If I'm writing a CLI, I tend to use Go and I'm using it more for backend stuff. I'll use Java if I have to, because of the team thing. But I won't like it. For toy stuff, I'll pick a language out of a hat just to learn something new. Every few years I'll use a LISP/Scheme.