Back to Browse

From Object-Oriented Programming to Go

707 views
Oct 27, 2022
32:57

From Object-Oriented Programming (OOP) to Go/Golang. This tutorial will focus on Go’s relationship with inheritance. You'll gain deeper insight into Go’s alternatives to inheritance and have some practical tools to help you use them in your code. A Guide to Golang E-Commerce ☞ https://morioh.com/p/3d1f6febc8b4 Learn Go Programming - Golang Tutorial for Beginners ☞ https://morioh.com/p/1fd7a8edaf38 Object Oriented Programming (OOP) Tutorial for Beginners ☞ https://morioh.com/p/849abffce56b I’m guessing that Go wasn’t your first programming language. When you started to learn Go you probably thought to yourself that structs are like classes, and that embedding a struct is like inheriting from a class – I know that I did. Now, while that’s a good way to start learning Go’s concepts, using embedded structs as inheritance in Go code is problematic and may lead to design flaws, and, worse, to buggy code.On the other hand, there’s a reason almost all high level programming languages have inheritance – it’s a good way to reuse code and to extend the behavior of external libraries. So, what’s the right way to reach these goals in Go?In order to answer this question, we need to understand the difference between a struct in Go and a class in a high level language. This talk will focus on Go’s relationship with inheritance, but along the way we’ll also discuss our process of thought when designing a Go program, from what structs we create, to which interfaces they implement and the relationship between different types in our code. A good Go developer is not one that has perfected the syntax, but one that knows how to use the language’s mechanisms to improve their code. Hopefully, by the end of this talk, you will gain deeper insight into Go’s alternatives to inheritance and have some practical tools to help you use them in your code. PUBLICATION PERMISSIONS: Original video was published with the Creative Commons Attribution license (reuse allowed). Link: https://www.youtube.com/watch?v=9oVr7rrNZVI #OOP #Go #Morioh ------------------------------------------------------------------------------------ Social Network for Developers: http://bit.ly/2R1Lw31 Developer's Store: http://bit.ly/2L27JNR Fanpage: http://bit.ly/2LyM4fJ Twitter: http://bit.ly/2J7vCS0

Download

1 formats

Video Formats

360pmp440.8 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

From Object-Oriented Programming to Go | NatokHD