I feel like there are a lot of inconsistencies in the language. Do we really need to distinguish between arrays and slices? I promise you that the differences between new() and make() will trip people up and have them allocating const nil values. I still don't see an easy way to do inheritance (since it's only kinda object oriented, and the interfaces don't let you inherit functionality), but perhaps I just haven't looked hard enough. I don't understand the rationale behind type assertions; it seems like it's casting everything to/from void*'s, which feels wrong given how type-safe the rest of it is.
I do like the concurrency primitives, though. and I agree that the multiple return values and _ are a huge step up from something like C++ (though they're certainly not novel).
Thanks for pointing me to that; it makes more sense now. I think the most succinct way to phrase my inheritance complaint is that it doesn't automatically build superclasses: you need to construct the superclass yourself and pass it into the subclass explicitly. and I guess that's not as bad as I had originally thought, since you've probably made factories for every struct you define (each of which can call the factory of its superstructs, and so on up the hierarchy).
So, I guess my "complaint" here is that it's just not anything I'm used to, rather than something really wrong with the language. :-P
Yesterday I started a project with Python and discovered that there the newline is the end-of-statement marker. *right pinky cries for lack of semicolons*
I remember thinking it was a little wierd for a few hours, but it grows on you very quickly, and now, a few years later, I find languages that use other delimiters unnatural. Also, I believe you can still put semi-colons in if you choose and the parser will just ignore them (just tried it; seems to work on basic examples).
I highly recommend setting your indentation level to something small so you don't end up out of screen real estate 3 levels in. The only mildly annoying bit about python using newline is that you may have to do some creative line-breaking to avoid hitting 80 char, if you care about that sort of thing.
Nothing nags at me so much as their dismissal of assertions. Used wrong, sure, they can be a crutch to avoid proper error handling, but they can be an invaluable debugging and documentation tool when used well.
Comments 10
I do like the concurrency primitives, though. and I agree that the multiple return values and _ are a huge step up from something like C++ (though they're certainly not novel).
Reply
Type assertions feel more to me like newtype in Haskell, but I'm not sure I remember them right at the moment.
For inheritance, see the Embedding section in the Effective Go doc for everything I've seen about that so far.
http://golang.org/doc/effective_go.html
Reply
So, I guess my "complaint" here is that it's just not anything I'm used to, rather than something really wrong with the language. :-P
Reply
Reply
Reply
Reply
I highly recommend setting your indentation level to something small so you don't end up out of screen real estate 3 levels in. The only mildly annoying bit about python using newline is that you may have to do some creative line-breaking to avoid hitting 80 char, if you care about that sort of thing.
Reply
Reply
Leave a comment