On Thu, Dec 31, 2020 at 9:27 PM Alex Besogonov <alex.besogo...@gmail.com> wrote:
> Moreover, Go has inheritance as well (struct embedding and interface > inheritance), making it a fairly typical example. > Interfaces yes (though I would use "subtyping", not "inheritance", but potato tomato), but struct embedding, no. Embedding a type doesn't make a struct usable as that type, so it's not subtyping (and notably, methods are still called on the embedded type). You're still correct that Go has subtyping though, yes :) > The only significant difference is that Go has structural typing, instead > of manually declaration of implemented interfaces. > > > But on the topic of generics, this entire thread seems alarmist. >> Generics will open a huge door for libraries to be written that will make >> our lives easier. I'm thinking specifically about data processing and >> machine learning. A lot of devs use Python right now for this which leads >> to duplication of code across languages. Complex algorithms will be able >> to be shared without hacky type conversions wrapping every function call. >> Who is "yours"? You talk about Python so just go ahead and use Python if >> it serves you, convince your team that Python is better, whatever. >> > You know that this argument can be applied to you as well? > > >> среда, 30 декабря 2020 г. в 22:46:12 UTC+3, nichol...@gmail.com: >> >>> OOP isn't specific about how inheritance is handled (or if it is even >>> supported). The basic definition is objects with fields and methods, and >>> being able to address the itself (typically using 'this' or 'self', but Go >>> is unique in that you define what to call the object). It does composition >>> differently than most languages, but the functional needs are met. >>> >>> But on the topic of generics, this entire thread seems alarmist. >>> Generics will open a huge door for libraries to be written that will make >>> our lives easier. I'm thinking specifically about data processing and >>> machine learning. A lot of devs use Python right now for this which leads >>> to duplication of code across languages. Complex algorithms will be able >>> to be shared without hacky type conversions wrapping every function call. >>> We'll be able to use things like trees as simply as we use maps or slices. >>> I don't think we'll see the language turn into the grossness that is Java >>> or C++ because of it. >>> >>> On Wednesday, December 30, 2020 at 4:27:15 AM UTC-8 Space A. wrote: >>> >>>> Go doesn't have classes and is not an OOP language. >>>> >>>> Classes (like in Java) vs structs (like in Go) is about inheritance vs >>>> composition, not about attaching fields and methods. Inheritance implies >>>> type hierarchy, child and parent, virtual functions, abstract and final >>>> implementations and so on so forth to keep this all of this manageable. >>>> >>>> >>>> >>>> вторник, 29 декабря 2020 г. в 23:27:45 UTC+3, Alex Besogonov: >>>> >>>>> Please, stop being so condescending to newcomers and non-professional >>>>> developers. Generics as uses by end-users will improve their experience, >>>>> not make it harder. >>>>> >>>>> (And what is this obsession with "classes"? Go has them - structs with >>>>> methods are 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/7b58c437-4507-4d75-b0a2-de7b0ba8b58dn%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/7b58c437-4507-4d75-b0a2-de7b0ba8b58dn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAEkBMfHeNF_ZtZEEUqNaNFPGX3TzH1jPC0FTeKXMmJ006Sa_qQ%40mail.gmail.com.