logoalt Hacker News

pjmlp • today at 2:52 PM • 3 replies • view on HN

Languages like Go, is how you end up with what appears simple on the surface, while in reality is full of gotchas and boilerplate for what complex languages support out of the box.

That is how you get double nils, exception handling that pretends not to be one, url based imports that requires source code and rewrites when the host changes, generators by code patterns, generics that miss some language constructs,....


Replies

Thaxll • today at 7:31 PM

None of those are real problems in reality, I don't think Go has more gotchas than other languages.

bigwheels • today at 4:29 PM

Written a few hundred kloc of go and I'd never heard of double nil. Turns out it's nasty.

    var i interface{} // (Type: nil, Value: nil) -> i == nil is TRUE
    var p *int = nil  // p is nil
    i = p             // (Type: *int, Value: nil) -> i == nil is FALSE!
➕ show 1 reply
foldr • today at 5:03 PM

> url based imports that requires source code and rewrites when the host changes

This is not the case. It can be avoided quite easily with 'replace' directives and/or GOPROXY.

➕ show 1 reply