4 ms·
If that was the goal then why not just use Java? It fits this goal description even better and offer superior tooling, infrastructure and mindshare.
by tut-urut-utut 5y ago
If that was the goal then why not just use Java? It fits this goal description even better and offer superior tooling, infrastructure and mindshare.
- jonahx 5y agoOne important reason: Because Java encourages inhertance-based designs, which are especially dangerous if your goal is to get inexperienced programmers to write simple, straightforward code. Go does not have inheritance.
- Koshkin 5y agoBut inheritance is thought to be a key to software reuse, and reusing the existing software is the safest path for inexperienced programmers to become productive.
- AnimalMuppet 5y agoInheritance is thought by some to be a key to software reuse. By others it is considered a huge mistake. Myself, I don't consider inheritance to be problematic when used wisely. But one shouldn't expect inexperienced programmers to act wisely. My main point, though: Don't act like the inheritance question has a consensus answer. It doesn't.
- deleted 5y ago[deleted]
- tptacek 5y agoIf this was true, it would be an argument that applies just as powerfully to Rust. Ironically: it's the argument you'd expect Java developers to deploy.
- orwin 5y agoWell... Inheritance have some use, sure. But productive code is code that is easily refactrorable, uncomplicated and easy to read. Inheriting, or rather subclassing too much will kill you code base (i'm currenctly working in a bank, writing mostly java and groovy, i think everybody agree except managment). A good alternative is composition, but you have to have a clear view of what you want. I alway try to make one function/method per action (when i have more then three indent level in a function, i'm prototyping), and that helps more than inheritance for code reuse (and i avoid comments inside functions). And i use a lot of interfaces and "default methods" to emulate "traits" which is imo superior to inheritance, in a lot of way. I still dislike java and groovy, when you spend hours depiling constructs to understand how to make a minor change on data collection, this is not a good language.
- thu2111 5y agoBut it does have goroutines and many other features which are easy to make a mess with. Also, the worst abuses of inheritance I've seen were all from supposedly senior engineers. And inheritance seems to be attacked a lot lately for questionable reasons. There are many places where it's a natural fit.
- hysan 5y agoTrue, but I would argue that a novice/mediocre programmer will tread more carefully when using goroutines because the subject itself is often taught as a more complex/high level topic. Meanwhile, inheritance is often taught as a basic concept which can deceive inexperienced programmers into thinking that they completely understand it. That invites more potential missteps.
- dekhn 5y agothe glib but mostly correct answer is "because rob and others didn't like public static void main." Rob and the other plan 9 folks hated C++ and Java with a passion because both took C and made it "complicated". They wanted something you could write servers, clients, and operating systems in.