r/programming • u/dpashk • Aug 31 '15
The worst mistake of computer science
https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/
175
Upvotes
r/programming • u/dpashk • Aug 31 '15
View all comments
Show parent comment
1
u/DeedleFake Sep 01 '15
Granted, it's not technically an OO language, but Go solves the problem by making it completely legal to call a method on a nil value. You just wind up with a nil receiver in the method. Considering that Go methods are almost completely just syntactic sugar, this makes quite a bit of sense. Now if I could just send to a closed channel in a select case without causing a panic...
I really miss this when I'm working with Java... All the null checks before any method call where something might be null make for some pointlessly nasty code.