Тёмный
No video :(

Why was OOP Invented? 

Stefan Mischook
Подписаться 260 тыс.
Просмотров 33 тыс.
50% 1

Why was object oriented programming invented? What are the advantages that programmers where looking for with OOP?
OOP is now the defacto standard in modern day development ... nearly all the most popular languages are based on object oriented programming. This is includes, Java, C++, C#, PHP, Python and sooo many others.
My popular courses:
Learn web development fast: shop.killervid...
Learn Python 3 fast: www.killervideo...
My business courses:
Complete Freelancer: www.killervide...
Complete Entrepreneur: www.killervide...
My social links:
Instagram: www.instagram....
Twitter: / killersites
Thanks!
Stef
#oop #objectorientedprogramming #php #java #python

Опубликовано:

 

15 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 100   
@thomashenry7218
@thomashenry7218 5 лет назад
Stefan, you communicate with us like a wise father or uncle would. I never notice any inflammatory, condescending remarks or undertones in your videos, or trying to put someone else down. This world needs more of that. Very positive, edifying channel!
@joshuakaufmann4081
@joshuakaufmann4081 5 лет назад
Ruby is an almost pure object oriented language. Thought that would be good to mention this on this chanel
@mitjed
@mitjed 5 лет назад
Stefan loves ruby
@taariqq
@taariqq 5 лет назад
lol
@joshuakaufmann4081
@joshuakaufmann4081 5 лет назад
@a 2345193 , True. I said almost pure because I was actually thinking of the other two examples. Ruby is the "objected enough" language to give someone a good feel for object oriented programming.
@bilaljamaludeen6535
@bilaljamaludeen6535 3 года назад
Python
@_________________404
@_________________404 3 года назад
I've been told that the main purpose of inheritance is not to "reuse code", rather than that it's purpose is to allow polymorphism. Which means that you can have multiple classes that inherit from a more generic superclass, all objects of these classes could then be used in a code that was programmed to be compatible with the superclass.
@llamasarus1
@llamasarus1 7 месяцев назад
People talk about OOP as if inheritance is all there is to it or is the most important aspect of it when there are so many other things that give it its identity.
@hattrickster33
@hattrickster33 5 лет назад
When I was first starting out I admit I'm one of those people who overused inheritance because every book and tutorial made it sound like the best thing every invented. As I started getting into more complex systems, I saw the weaknesses that you mentioned. You can end up with an unmaintainable system if you blindly use inheritance for the sake of reusability. I think the thing to remember is that inheritance does have its place. Obvious example: if you're writing any Java, you're automatically using inheritance because everything in Java inherits from Object by design. Also, I've used inheritance sparingly in the data layer where the app is interacting with the database. Basically the kind of logic that all the data classes will be using, like setting up the connection, closing connection, etc. That's one case where it makes sense.
@aoeu256
@aoeu256 5 лет назад
The big problem is that in schools Java, C++, and C# are sold as "industrial" languages where thats how the "big boys" code. However, the most reusable and least error prone code is actually purely functional code with immutability. You can create functional OOP in Java by instead of writing getters and setters you would create an alternate constructor that would return a new object based on an old object and new parameters you want. This allows your code to compose more. This is actually easier in JavaScript. var newvector = makeVector(oldVector, {z:5}) rather than oldVector.setZ(5). This makes it easier to nest your new objects, and you can't get data incoherence and NullPointerExceptions (caused by sequencing your code wrongly) this way. Sequencing errors are actually more common than all other forms of type errors found by Java combined.
@mrcrackerist
@mrcrackerist 5 лет назад
i would say that a mix of procedural and oop is the best just my opinion do. when you have lots of simllar stuff use oop. when you have function (not methods) that are used every where or the main function use procedural. doing pure procedural right now its really fun compered to oop.
@ili101
@ili101 5 лет назад
What is your opinion on functional languages like F# (advantages disadvantages vs OOP C#)
@siemik
@siemik 5 лет назад
"Technical reasons often time don't drive market adoption" ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QlHf8c6Ma7o.html
@caw25sha
@caw25sha 5 лет назад
I agree about excessive use of inheritance. I worked with .NET and C# for many years and everything inherits ultimately from Object but the number of classes in the chain is often ridiculous. The idea of OOP actually goes back to the 1950s when it was simulated in non OOP languages, FORTRAN I think. I actually like the Python paradigm where OOP is optional, and even if you do use it it's a fairly liberal version of OOP whereas some languages (cough C# cough) are so paranoid they almost make you feel like a criminal. "How dare you try to use that method, it's PRIVATE." Has anybody noticed that most of the mainstream OOP languages were created by Scandinavians? Simula, C++, C#?
@aker1993
@aker1993 Год назад
My problem of Java is that you must use OOP which its hard to track with.
@richardnicholas2957
@richardnicholas2957 5 лет назад
Which is the video describing using interfaces instead of inheritance? I can’t find it on your channel. Thanks.
@kyleaca5122
@kyleaca5122 4 года назад
I took a class on C# this year and it’s the first programming class I’ve ever taken and it wasn’t that hard to learn. (I only know the basics though)
@RetributionAnon
@RetributionAnon 5 лет назад
I don't know why, but I love your OOP and inheritance vlogs))
@Jollyprez
@Jollyprez 5 лет назад
If you think structures and procedural coding causes spaghetti code, wait until you start using OOP. I think the biggest problem with OOP are class libraries that try to do too much. Any particular library of the past - going back to Think Class Libraries ( TCL ) - from 1987, through MFC, through CodeWarrior, through Swing, through all kinds of other things - they just made them too generic and code bloat that makes the Hindenburg look like a drug store mylar balloon.
@cyrusol
@cyrusol 4 месяца назад
I've been told by people who earn twice as much money as me that polymorphism would be "exactly the OOP thing we all hate", and why Go's interfaces are so much better than whatever Java does. Everything comes full circle. First OOP was great and advocated for by smart people, then dumb people misunderstood it, then smart people critizised it, then it survived and now dumb people continue to "critizise" it.
@MrSmith01
@MrSmith01 5 лет назад
@Stefan, can you please comment Fred Brook's quote: "What one programmer can do in one month, two programmers can do in two months"
@StefanMischook
@StefanMischook 5 лет назад
Yea ... this is an issue I have dealt with a lot in the past ... and recently! To summaries: adding more programmers, many times, won't speed up the production time. I've found that after you have 3 developers on a project, the law of 'diminishing returns', kicks in viciously. To the point, that I don't have more than 3 on a project.
@MrSmith01
@MrSmith01 5 лет назад
@@StefanMischook Imo this subject deserves a separate video!
@caw25sha
@caw25sha 5 лет назад
That's because they need to spend half their time discussing what needs to be done, how to split the workload and how to get their code to work together.
@pixelmartyr8532
@pixelmartyr8532 5 лет назад
I'm now using SASS. Now I get why its beneficial. Maintainability!
@mikiallen7733
@mikiallen7733 Год назад
so does it mean that it is less secured / if its easily breakable as you mentioned relative to other inheritance-free style of programming ? your input is highly appreciated best
@StefanMischook
@StefanMischook Год назад
Not sure what you are asking? Can you restate?
@mikiallen7733
@mikiallen7733 Год назад
@@StefanMischook is oop more or less secure as style of coding / programming relative to say any well known functional programming language, which is tends to throw less errors in production environment?
@SajeelCodes
@SajeelCodes 5 лет назад
OOP was actually invented to confuse the new programmers. Lol
@SajeelCodes
@SajeelCodes 5 лет назад
@@lukevincent4397 can you tell me? What is meaning of LMAO? I have seen this much but don't know what does it mean
@jeffreysoto4833
@jeffreysoto4833 5 лет назад
@@SajeelCodes lol = lmao = lmfao = rofl
@SajeelCodes
@SajeelCodes 5 лет назад
@@lukevincent4397 ohk
@jsceo
@jsceo 5 лет назад
what is hard about oop? never get it
@SajeelCodes
@SajeelCodes 5 лет назад
@@jsceo hard thing is the confusion of beginner programmers when just starting out
@SaudBako
@SaudBako Год назад
I don't think of inheritance as code reuse. It's subtyping, and if code is reused, it is a lovely side-effect. Like, a book can be a physical book or an eBook.
@stewiegriffin6503
@stewiegriffin6503 2 года назад
you did not answer the question... you can write perfectly clean code with procedural language... OOP has todo with compiling external libs
@fredflintstone8048
@fredflintstone8048 5 лет назад
There are many environments we work in that are nothing but structures of objects. Dot net programming for example. Inheritance is integral to developing in that environment.
@kayakMike1000
@kayakMike1000 Год назад
Is it REALLY better organized? I dunno, man... Modularity you speak of in Classes could be emulated pretty well with opaque pointers in C. You do not need "classes" to break up your programs into reasonably sized chunks.
@szeredaiakos
@szeredaiakos Год назад
Polymorphism is by far the most important feature of OOP. But you are not the first one to get it wrong. Inheritance as it is, is like ... whatever ... sometimes useful. Encapsulation might be the other most important part. Also, I duplicate code all the time. It is mandatory across context boundaries.
@TurboXray
@TurboXray 8 месяцев назад
"But you are not the first one to get it wrong." One, that's subjective. What's not subjective, and very much objective.. is that the most important part, and fundamental to OO design is the idea of objects themselves; the encapsulation of methods to be closest to the data it needs to interactive with and perform operations on. *Everything* else is just a natural extension of this design concept; interfaces (inheritance), polymorphism (runtime or compile time), etc. But interfaces and polymorphism are not mutually exclusive to OOP.
@szeredaiakos
@szeredaiakos 8 месяцев назад
@@TurboXray Yes, but other paradigms have no issue with encapsulation. Punchcards, for example, have rubber bands and bookmarks. Encapsulation is very important, true, but not specific OOP. OOP offers probably the biggest set of tools to manage complexity. The magic comes alive when you have something like DataBase.update({some: data}) and you stop caring about the implementation of update() as long as it returns an "OK". You can have 100s of forms of update for different databases. Can you do that using other paradigms and principles? Yes, obviously. Will it still be maintainable after 10 years... Probably not. In OOP you can have it somewhat maintainable if you put some grease into it. And by maintainable I mostly focus on the ability to completely change the structure beyond the "update" call.
@Kricen
@Kricen 5 лет назад
In OOP inheritance is the first priority way to do things. It's one of the major ideas of OOP. If you can't for some reason get it, just don't use OOP language, but also don't try to downplay inheritance just because you don't understand it. "Avoid inheritance" is extremely bad advice to give and can in theory hold back people who try to learn OOP.
@krztix
@krztix 5 лет назад
how about you tell the reasons why you are saying that rather than blindly stating your opinion
@Kricen
@Kricen 5 лет назад
@@krztix Besides inheritance is not all about "reuse" of code. When I hear that term I'm like yeah, but no... With inheritance you are supposed to organize your code from simple low level classes (more like user defined "types") to more complex ones. You can and should organize your code in all programming styles, but in OOP it's much more important. The funny thing is that when you avoid inheritance in OOP code it's going to make things harder, not easier.
@caw25sha
@caw25sha 5 лет назад
OOP is fundamentally about tying together data and the code which works with that data, which at a practical level involves writing classes which contain both, and then instantiating objects of that class. It is often stated that the three core principles of OOP are inheritance, encapsulation and polymorphism. However, it would be possible to design a very useful OOP language without any of those three capabilities. Even in a language which has them you don't have to use them (aside from the fact that the language might implicitly inherit from some ultimate base class).
@widearchshark3981
@widearchshark3981 2 года назад
I'm with Paul on this. Just saying "don't use inheritance" is a pretty worthless view without any context imo When thinking of a real world example of a good use of inheritance, I always refer back to the java.sql classes. As a programmer, you know what methods you can call on it, regardless of the database provider (Oracle, Sybase etc). Because they all provide their own implementation of the interfaces. So it 100% has it's uses in the right situation.
@ovidiuc4
@ovidiuc4 5 лет назад
was that "Bob's your uncle"? ha ha
@ovidiuc4
@ovidiuc4 5 лет назад
@Peter Mortensen Thanks, I didn't know that expression, I thought he was referring to Robert C. Martin :)
@silversolver7809
@silversolver7809 5 лет назад
Is OOPs the plural?
@amirhosseinahmadi3706
@amirhosseinahmadi3706 5 лет назад
Well, OOPs actually means "Object-Oriented Programmings!", which doesn't make sense. So, you should probably say OOP languages instead, as Stef does.
@TraceyOsbornHR
@TraceyOsbornHR 5 лет назад
"oops" I see what you did there haha. "oops" I did it again.
@maheepthephenom
@maheepthephenom 5 лет назад
OOPS full form is Object Oriented programming System
@lukabiskupic4910
@lukabiskupic4910 5 лет назад
Can I use Symfony framework for small or medium size projects?
@iamreg1965
@iamreg1965 5 лет назад
Like all things in this world, everything in moderation and the application of the best tool for the job. The very basics of OOP, inheritance, encapsulation and polymorphism are all you really need. Everything else is just trendy bullshit, as the overuse of patterns and use of ORM's have shown. A well written program, in a language that allows it, will have elements of procedural (even modular), OOP and functional dotted through out. PHP is great for this. In the MVC paradigm, procedural code would normally dominate the controller scripts and the model will consist of one abstract class and many classes that derive the basic functionality from that, especially when writing database applications. Design the database first and add the business rules in the model on a per table basis. Functional elements are extremely handy for filtering, mapping and reducing data whilst keeping the original lists (arrays) intact. The view will invariably be HTML templates that accept data from the model. Things such as games programming are another kettle of fish entirely and I have no interest in those particularly. My knowledge of physics and calculus is not strong enough.
@phee3D
@phee3D 5 лет назад
hey stefan, you always say "learning 20 mins a day 5 days a week is better than learning 100 minutes a day once a week" but what about learning and practicing 3-5 hours a day? do you think that's a healthy amount of time per day and would an average brain retain the knowledge at this pace? provided that I keep going back to the basics often to get some refreshers as i inevitably forget some stuff
@AnDrU085
@AnDrU085 5 лет назад
Thats what i do. Try to dedícate between 4 and 6 hours a Day if i can. If im stuck with something i Just make a pause and do some other thing, play games, etc. Then you came back with a fresh mind.
@philadams9254
@philadams9254 5 лет назад
It's just a way of categorizing code. Just like namespaces or filesystem folders.
@MrSmith01
@MrSmith01 5 лет назад
you can categorize your code via 'including' files
@laughingvampire7555
@laughingvampire7555 Год назад
and with OO you can get into Macarrones code
@theteknologist9574
@theteknologist9574 5 лет назад
When it comes to cheese and bacon; why not choose both?
@MiketheCoder
@MiketheCoder 5 лет назад
Nope. You can search online. OOP originally was for message handling between computers. The guy wanted to mimic networks by having objects send messages to other objects.
@Acid31337
@Acid31337 2 года назад
People confuse benefits of languages like Java with benefits of OOP. No, code in Pascal or C is spaghetti not because its lack of OOP. There are no garbage collection, no built-in data types besides array of bytes, no rich libraries, no stacktraces when program crashes. You don't understand that there was a great problem even to return something from function bigger than single number. It also was different kind of problems and different IDEs and hardware... There was ton things that made life easier and code prettier. Not OOP. Just try write code today in modern language without OOP. It would much easier, because you will not face any problem you have told will be without OOP.
@mrmack678
@mrmack678 5 лет назад
how good is a Cs degree to get into AI
@immortalnub
@immortalnub 5 лет назад
Don't bother. I got a CS degree, didn't learn shit, and I cannot find a job. The professors will either just read off of slides like a high schooler or jump around in a labyrinth of code. RU-vidrs are far better teachers. I would say that college is nice if you need direction, but go to community college for that.
@mrmack678
@mrmack678 5 лет назад
you two are right and yes i m taking courses to improve my programming skills and later to dive into ML but in my country its really hard to get even an interview for a job without a degree to most part of me i do believe that self learnings and online resources are much better than spending 4 years at a university
@immortalnub
@immortalnub 5 лет назад
@@mrmack678 Keep your programming assignments for reference. I regret not keeping mine.
@andilerodney7215
@andilerodney7215 5 лет назад
More of these nuggets uncle Stef......i like.
@4everMatador
@4everMatador 5 лет назад
Who's Down with OOP!?
@kyleaca5122
@kyleaca5122 4 года назад
Yeah you know C.....#
@bigpod
@bigpod 3 года назад
i dont think i wrote a single interface or inheritance outside of educational environment
@zebnat
@zebnat 5 лет назад
We all made the mistake of inheriting everything creating a hierarchy mess then we learned about object composition.
@elbozo5723
@elbozo5723 3 года назад
y’all don’t stay for too long he gotta go to lunch
@LukePighetti
@LukePighetti 5 лет назад
Inheritance for interfaces only!
@zoommair
@zoommair 5 лет назад
Great explanation! Could you link us the Inheritance video?
@MR-gold-VR-b6j
@MR-gold-VR-b6j 5 лет назад
Cmon man... cheese all day everyday.
@toddboothbee1361
@toddboothbee1361 5 лет назад
Did you have a wedge of bacon cheese for lunch?
@Bm23CC
@Bm23CC 5 лет назад
GOTO
@mrswolls
@mrswolls 5 лет назад
Looking healthy your face looks much leaner
@PrivateSi
@PrivateSi 5 лет назад
Packaging..... The real world is so overloaded with wasteful packaging the virtual brainz followed suit..... How many layers of packaging before we even dig out the code... and then we get to the guts and find loads more boxes full of boxes full of different sweets in different wrappers.... Truly horrible in so many ways...
@NintendoGamer789
@NintendoGamer789 5 лет назад
OOPsie daisy
@tanushsathiyaseelan9428
@tanushsathiyaseelan9428 3 года назад
Watch it on 4x
@fludeo1307
@fludeo1307 2 года назад
try to scale a project without OOP , you can not. try to make a small project with OOP you can but is overkill.
@7p386
@7p386 5 лет назад
Sksksksksksksks and i oop
@sparrtonn6195
@sparrtonn6195 3 года назад
no
@howardthealienalien2494
@howardthealienalien2494 5 лет назад
The meme
@cd78
@cd78 5 лет назад
OOP is an overly abstracted mess.....
@aoeu256
@aoeu256 5 лет назад
OOP has its uses, but Java & C# are horrible languages IMO. Dynamic languages like Ruby, Python, SmallTalk don't have all of the complexities that require factories and all have some sort of form of "closures". Instead of using objects you can use functions with their closure property as long as your object only has only a single method, and you can put data inside the function (since a function is an object in true OOP languages) for static variables that should be shared between all function calls.
@4n0n25
@4n0n25 5 лет назад
Yeah I mean nobody needs it lets just put everything in one main function😂😂
@laughingvampire7555
@laughingvampire7555 Год назад
tell me a single feature of any programming language that is native to OO that hasn't been discredited or discarded or replaced by something better? NONE!!! ALL OO is history and that is why you have none of those features in Rust. Rust is safe and is 99.99% the performance of C/C++ so we are paying safety with 0.01% of performance, is worth it.
@immortalnub
@immortalnub 5 лет назад
Oop was invented because people got sick of functional xD
@alexkfridges
@alexkfridges 2 года назад
this video is utterly devoid of content
@StefanMischook
@StefanMischook 2 года назад
I’m like chips.
Далее
Object Oriented Programming vs Functional Programming
18:55
Object-Oriented Programming is Bad
44:35
Просмотров 2,3 млн
Sevinch Ismoilova - Xayollarim 18-Avgust 19:00 Premera
00:19
Why OOP inheritance sucks
7:54
Просмотров 48 тыс.
JVM in Rust?? |  | Prime Reacts
15:04
Просмотров 69 тыс.
Stef's Top 10 Programming Rules - MUST LEARN!!
12:00
Просмотров 129 тыс.
Pong & Object Oriented Programming - Computerphile
12:51
Sevinch Ismoilova - Xayollarim 18-Avgust 19:00 Premera
00:19