3 ms·
Go is not object-oriented. Especially since Go does not have “private state”. Guess what does? C++ and Java. Specifically private member variables, and they w
by iraqmtpizza 2y ago
Go is not object-oriented.
Especially since Go does not have “private state”.
Guess what does? C++ and Java. Specifically private member variables, and they were inspired by Poops and Butts.
Does that make C++ and Java “Object Oriented” by the creator of the term. Not by itself, but it does make them considerably more “Object Oriented” than Go.
>Let us also ignore the fact that in the JVM you can not even implement Singleton correctly because by design the JVM can not guarantee that one and only one instance of a class is ever created.
It's called enum, t4rd. Released nineteen and a half years ago. Check it out. And let us rather ignore you while you do so.
- brunoborges 2y agoI once had an epic discussion with Brian Goetz regarding the use of Enums as an implementation of the Singleton pattern. Lesson learned, and the Twitter thread is now history: https://twitter.com/brunoborges/status/1068297236071747585 https://twitter.com/brunoborges/status/1068297236071747585 Goetz's reply: https://twitter.com/BrianGoetz/status/1068196389858017282 https://twitter.com/BrianGoetz/status/1068196389858017282