| ▲ | stouset 5 hours ago | ||||||||||||||||||||||||||||||||||
Nil exists in C and is widely considered to be a massive mistake in the language. An understandable one at the time, but a mistake nonetheless. Thus “go borrowed it from C, therefore it can’t have been a mistake” is a pretty lame take. The whole point of a new language is to make improvements on what’s out there already. Go missed an opportunity to fix one of C’s most notorious mistakes. So yes, they kneecapped themselves by forcing all of the users of Go to continue dealing with this well-known footgun. Does it mean Go isn’t popular? Of course not. C was popular. PHP was popular. JavaScript is popular. Go is popular. This is always in spite of their faults. But Go could have been better. | |||||||||||||||||||||||||||||||||||
| ▲ | 9rx 5 hours ago | parent [-] | ||||||||||||||||||||||||||||||||||
> Nil exists in C and is widely considered to be a massive mistake in the language. You're almost there, but it is wildly considered to be massive mistake in context of arrays. C has weird array semantics that are confusing and hard to get right, even for seasoned developers. That is where NULL comes to bite people time and time again. Go did not inherit C's arrays. Neither did Javascript. They go out of their way to avoid what C did. In Go, you can come close to the same semantics if you use the unsafe package, but take note the name. Yes, they still have nil, but the scope is tightly constrained and while it is technically possible to misuse, you have to try pretty hard to do so. There are many other things that are more likely to end up being misused. Those would be the more massive mistakes. > But Go could have been better. Obviously. Every language ever created can be better. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||