Java is the most distressing thing to happen to computing since MS-DOS. — Alan Kay
(I'm not sure if this is a real quote, but you can see it here: http://harmful.cat-v.org/software/java . There is a different unverified version here: http://c2.com/cgi/wiki?AlanKayQuotes )
- Lack of generics (this will be resolved in the future)
- nil exists
- interface{} is a *void style type safety loophole
These are all very minor issues, but the Go haters just love to harp on them. 99% of the time, I find they hold up ml-style languages as some sort of Holy Perfection. (lulz)
With most of the rest of the criticisms it's not necessarily clear how to fix Go (that is, it may be fixable but there's no one obvious solution that just works), but that's not the case for non-nullable types. They were always possible, have been for decades, and there's just no reason not to have them and use them as much as possible in the standard lib.
Also, I'm not a hater... unless your definition of "hater" is "doesn't like every last detail about Go", in which case, sure, under that degenerate definition I'm a "hater". You really shouldn't sling that term around in a preemptive attempt to marginalize your opponent like that, for a topic like programming languages. Save it for politics.
("Programming languages ARE politics." Well, they shouldn't be. Don't fall into that trap.)
I think the Go designers wanted the language to be approachable for people who habitually use null to indicate meaningful state. Multiple return values offer a way out, while still allowing newbies the option to abuse nil. (although, sum types would be nicer)
I think on balance, getting people from the 1970s to the 1980s who otherwise would not have gone there is a positive thing. Even if it's not the ideal thing.
It's not out of the question that Go will make your suggested fixes once it acquires enough mindshare.
C# even proves it can be profitably bolted on after the fact (contra pcwalton)... because that's how unobtrusive this change is. It's not like this is a complicated idea, unlike the other suggestions.
huh? Yeah, well. Newsflash: "nil" is nothing more than the zero-value for pointer types (and related other reference-semantics types).
Your point again? Should we rename nil with a new keyword "zero"? Fine by me.
Forced-nil pointers are a disaster.
Also, please re-read my last two paragraphs.
I don't know --- sounds like we would replace our current easy-to-grok, quick-to-fix "nil-pointer error" panics with obscure hard-to-debug non-panic-ing bugs because our code failed to check our now-in-every-struct custom "isInitialized bool" field?
Wouldn't you agree that the "special value nil", for pointers to complex struct types, is just as useful and essential as zero is for simple literal (non-struct) types, to represent that somewhat tricky but absolutely necessary concept of "non-existence"?
But they aren't. That's why they're the "billion dollar mistake": http://en.wikipedia.org/wiki/Tony_Hoare#Quotations If you think they're just easy quick problems, I find it doubtful you've ever worked in a significantly sized system.
Are you aware of the fact that there are plenty of languages that actually already have non-nullable values? Have you spent any time using them? Do you understand that such languages still support null values, but you have to call for them explicitly? Do you understand that we're calling for non-nullable values not out of some sort of abstract concept of correctness floating in space, but from concrete experience? I suspect you'll find that more experience correlates with a stronger belief in the need for non-nullable fields. It seems to me the people most vigorously defending the need for nulls have obviously never tried the alternative, as evidenced by their frequent belief that it's an all-or-nothing proposition, which is not true of any language, thus strongly implying a complete lack of experience. Also implied by you asking me whether nil should even exist, which is the wrong question, again implying you don't understand the alternative I'm advocating for here.
And again... it's soooo easy to add them, even to existing languages, and soooo easy to use them. It's not an overhaul, and it's an easy way to avoid the billion-dollar mistake. The cost/benefits are just so, so clearly in favor of defaulting to non-nullable values.
To me, one of the biggest issues is the lack of true exceptions. Exceptions that show the call stack (as in Java and .NET) take a lot of the mystery out of real-world troubleshooting an issue with a third-party library (for example). Panic or returning an error doesn't provide the same utility.
Go isn't going to break a lot of new ground (Hoare was talking about CSP back in the 70s), but that's fine. It's nice to have ML style languages as playgrounds for PL research, and languages like Go to help large teams be productive (the enforced style and simplicity of Go makes it relatively easy to find people who can contribute quickly to a project). Different languages have different goals, and that's great.