Object-oriented Programming in 7 minutes | Mosh
Video Statistics and Information
Channel: Programming with Mosh
Views: 2,382,015
Rating: 4.9171376 out of 5
Keywords: oop, object, object oriented programming, object-oriented programming, inheritance, encapsulation, abstraction, polymorphism, programming with mosh, code with mosh, oop concepts, oops concepts
Id: pTB0EiLXUC8
Channel Id: undefined
Length: 7min 34sec (454 seconds)
Published: Thu Mar 29 2018
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Good little refresher, makes me realize I should probably review these concepts in more detail
I wish there were more examples / discussions of non-trivial OOP code snippets.
Everyone groks the nice animal / car / employee object examples but in my experience once you get into real world production code examples the concrete-ness of objects used in tutorials like these gets lost and you end up with ControllerServices and ControllerManagers and AbstractThings.
Its like a kind of "homeopathic-programming by abstraction" where the more abstract we make the objects the less information they provide about the domain of the problem you're trying to solve. Like its easy to reason about an Employee object... Just by its name alone you can probably guess the properties it has and operations it can perform. But in the world of AbstractThings its impossible to reason about objects in the same blackbox manner that you can with more concrete objects.
/rant
I love his accent, seems french. Thanks for sharing
The encapsulation part was expained beautifully. so, after three years of procedural programming, today I've made the aha-moment thanks to this.
I was looking forward to an explanation in the same style for inheritance in a practical JS case, but I am happy with having grasped 100% the first part. (I'm a full Stack Designer for now and slowly dealing with more and more complex JS)
Also I'm still wondering about how those variables arrive to the object in the first encapsulated example.. via... Params? hope not.
Not sure if I agree with the quote: "The best functions are those with no parameters." - Uncle Bob Martin.
Functions, by their very definition, require inputs. A function takes in an input, does some calculation within itself, and returns an output. A function cannot perform any dynamic calculations if it cannot take inputs. So therefore these are not functions but indeed methods.
Granted, this is OOP and not functional programming and so the data these methods receive are from properties assigned within the object, whether they are assigned using constructors or other methods. However one of the problems attributed to OOP is tracking state because it can be difficult to determine what a method returns. In functional programming a function should always return the same output if given the same inputs.
Otherwise, good video. Succinct and addresses core OOP concepts.
informative
Cool vid
Super easy and practical examples. It's one of the best explanations I've seen on that topic.
Anyone notice this?
This can't possibly be valid syntax right?