6 ms·
that's true, but realize that golang is largely shepherded forward by a company with a legacy of C++ (maybe lesser C/java) heritage. you aren't getting legacy C
by maximente 7y ago
that's true, but realize that golang is largely shepherded forward by a company with a legacy of C++ (maybe lesser C/java) heritage. you aren't getting legacy C++ programmers on board with "optional" types: they'll riot and pull the purity card (this doesn't look like "my C++"). google is probably grateful these people are no longer returning -1, -2 etc. for errors from their functions.
consider things like the golang date formatting string. to anyone not well versed in a C++/C ecosystem, the golang date formatting string is absolutely nuts. it is complicated as hell and doesn't really make any sense. but consider the reaction of a C++/C developer: they're probably quite comfortable with it, because it's basically stolen from C. functions like itoa and atoi harken back to a """simpler""" time, despite being virtually nondescript for anyone who didn't start their careers with that stuff.
- steveklabnik 7y agoC++ has been adding things like optional types; std::optional was released in C++17, there's talk of maybe pattern matching coming soon...
- samatman 7y agoJava has Optional as well, but as you well know, you can't just bolt ADTs onto the side of a language and wash your hands of it. The whole system has to be designed around it to get the benefit of it. Java programmers will be checking for null until the last line of Java is written.
- steveklabnik 7y agoSure, but the argument was that folks would reject it, when they in fact have explicitly added it. Its effectiveness is another story; not only along the axis you were talking about, but also others, but that's a separate conversation.
- pron 7y ago> Java programmers will be checking for null until the last line of Java is written. Not necessarily. Adding nullability types to Java is a smaller undertaking than adding generics was.
- pjmlp 7y agoThe authors just happened to work at Google ,while having a manager that supported their work (check Go Time podcast), most of Google's relevant products keep being done in C++, Java and Python, and they are one of the biggest contributors to LLVM/clang, and ISO C++.
- rptr 7y agoIts podcast #100 for anyone who want to listen. https://changelog.com/gotime/100 https://changelog.com/gotime/100
- gameswithgo 7y agoYes, in fact Go's paradigm for errors is a clever half step towards option types.