Hacker News new | ask | show | jobs
by indulona 582 days ago
> Go is not object-oriented language

That is most definitely not true. Go just uses composition instead of inheritance. Still OOP, just the data flow is reversed from bottom to the top.

3 comments

>> Go is not object-oriented language

> That is most definitely not true.

I think at best, you could say that Go is a multi-paradigm language.

It's possible to write Go in an object oriented style.

It's also possible to write programs with no methods at all (although you'd probably have to call methods from the standard library).

That's in contrast to a language like Java or Ruby where it's actually impossible to avoid creating objects.

Unless you happen to want to warm up the CPU, there is very little Go code that is possible to write that does anything useful without OOP concepts, like interfaces, methods and dynamic dispatch.

Creating objects on the heap isn't the only defining feature how a language does OOP or not.

It goes like this:

1. Software development is a fashion industry.

2. OOP is currently uncool.

3. People who identify as Go programmers don’t want it to be thought of as connected to OOP at all, because then it is uncool by association.

Go has objects, but objects alone does not imply orientation. For that, you need message passing.