3 ms·
To me, Go is "masturbation prevention" language. Meaning that certain deliberate design choices were made to prevent precisely the types of endless unproductive
by m0zg 7y ago
To me, Go is "masturbation prevention" language. Meaning that certain deliberate design choices were made to prevent precisely the types of endless unproductive masturbation you see in some other languages. I.e. type masturbation in Haskell or OOP/IoC masturbation in Java (particularly egregious, Java is not a bad language otherwise), or metaprogramming mastrurbation in C++. The omission of these features is not a bug. It's a feature in itself.
- crimsonalucard 7y agoYeah, I get you. And I kinda agree. Still in my opinion, just the inclusion of parametric polymorphism and sum types won't make the language masturbatory. I feel what makes something like haskell "masturbatory" is really the monads, functors, operator overloading, function composition and a bunch of other advanced stuff. I'm not saying Go should have included those things... All I want are just parametric polymorphism and sum types.
- _ph_ 7y agoIndeed. More than once, I have seen program projects ruined by creating an overly elaborate class hierarchy, sometimes 10 layers deep. Just to express any theoretical aspect of the domain in the structure of the class hierarchy. Java programs often suffer from this. Which is especially sad, as Java has interfaces, which I think are the right way of representing abstract types for APIs for example. Interfaces don't force you to into a type inheritance just to fulfil a contract. But unfortunately, they are way to rarely used.
- m0zg 7y agoIf anything in Java they're overused. You often see only one class implementing an interface where the programmer can reasonably expect there will never be another implementation, and where it's not exposed outside the API boundary, so the interface is gratuitous.
- codygman 7y agoAfter a while typing `if err != nil` or reimplementing sorting for your custom data type pretty masturbatory in my experience. Is a language without generics plus "masturbation prevention" more economical than a language with generics where code review is used as "masturbation prevention"?