Asking "the definition of object oriented programming" seems a bad idea to
me. Alan Kay invented the term, and he was pretty clear that C++ was not
anything like what he had in mind, and yet, a lot of people think C++ is an
object oriented language. I don't, as it happens.

Inheritance used to be thought of as quite fundamental, but not so much any
more. I think that's probably right.

But here are some other things: object oriented languages are supposed to
have object ubiquity. I think Stroustrup probably did not understand the
point, and the designers of Java couldn't figure out how to make it
efficient. So much for them. C++ gets so much wrong it hardly matters. But
Java doesn't; it more or less regrets that it has non-object types. Go is
very different however: Go does not regard interfaces as something that
should be ubiquitous or feel bad when they aren't used. In fact, they are
discouraged except when actually required.

Late binding is another key feature, one which again C++ mostly didn't
understand the point of, and Java couldn't figure out how to implement
efficiently, so everyone does "final" instead. Go does have late binding
for interface method calls, but only on-demand.

Object oriented languages are generally either class-based or
prototype-based. Go is neither, having nothing like classes and nothing
like prototypes. For me, this is the most salient thing to keep in mind.

On Tue, Nov 22, 2022 at 10:56 AM Jan Mercl <0xj...@gmail.com> wrote:

> On Tue, Nov 22, 2022 at 4:43 PM Robert Engels <reng...@ix.netcom.com>
> wrote:
>
> > Go is not listed as an OO language on Wikipedia.
>
> Check https://en.wikipedia.org/wiki/Go_(programming_language):
> "ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"
>
> > Personally I think it is OO-like. OO typically has inheritance.
>
> Typically they may, but that's not the same as what a requirement
> would be, right?
>
> > There are also no “class variables” - only package level - which makes
> some encapsulation patterns harder (every class has to become a package).
>
> No class has to become a package because Go has no classes. You may
> think of what a "class" in Go means, but you have not defined that
> idea and the language specification is somehow silent about Go
> classes.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BYjuxt7BVNP22hy%2Bd9AoE56qssrhxUdu%2BSs9EwiqS7m8LGHCQ%40mail.gmail.com.

Reply via email to