Home page

5 Tips For Object-Oriented Programming Done Well - In Python




Video quality The size Download

Information 5 Tips For Object-Oriented Programming Done Well - In Python


Title :  5 Tips For Object-Oriented Programming Done Well - In Python
Lasting :   16.08
Date of publication :  
Views :   154 rb


Frames 5 Tips For Object-Oriented Programming Done Well - In Python





Description 5 Tips For Object-Oriented Programming Done Well - In Python



Comments 5 Tips For Object-Oriented Programming Done Well - In Python



Roger Isaksson
Few people can write good software, even fewer object oriented software, and virtually zero can write good object oriented software
Comment from : Roger Isaksson


Ricardo Suarez del Valle
What I tend to do is when functional programming makes more sense I put all the functions into a class that kindof describes what the group of functions does and make them all static methods or class methods
Comment from : Ricardo Suarez del Valle


Chris M
Thank you for making this video Great advice
Comment from : Chris M


Three Legged Pig Studios
An hour video on proper compositional hierarchy programming for GUIs using Qt would be awesome Great vids
Comment from : Three Legged Pig Studios


YT feels like North Korea
all the fancy stuff is for the masturbators - guys who will 'learn' new fancy stuff or programming language every 6 months, insist on using it for EVERYTHING and abandon it 12 months later 'because new shiny thing' and leave their code for other people to maintain
Comment from : YT feels like North Korea


Italo Buitron
Are you 46yo?
Comment from : Italo Buitron


Hannes Baum
Step 1: Dont use Python
Comment from : Hannes Baum


Labret
Arjan I know why you like to talk about payment: You are dutch! :D
Comment from : Labret


Damian Games
quality content
Comment from : Damian Games


Sam Leheny
Tip #2 is one of the most helpful pieces of advice i've come across Applying that thinking to my classes has made my projects way more organized
Comment from : Sam Leheny


Bulelani Botman
The dependency injection topic was something new to me, so thank you!
Comment from : Bulelani Botman


MarleyDX
The only one of these tips that irked me was the separation of "behaviour classes" and "data classes" This irked me because that is a very close to C-style way of thinking, that is: procedural programming Right now, I'm forced to use Java, and I see this style in the code that my predecessors wrote It is hell to maintain as they had a "dto" obsession Every time I see a "data class" that isn't there to act as a projection of your business models or as a helper class because your function needs to return a value comprised of heterogeneous items, I cringe and start to worry about the maintainability of the code Yes, OOP isn't perfect, and Java is probably the worst way to implement OOP (*cough*C++*cough*), it feels like you're fighting an uphill battle when you go against these OOP principles Sure, it's "easy" and gets you some quick velocity, but the technical debt you accrue is so damn high It's insane
Comment from : MarleyDX


Sherif Ahmed
Awesome tutorial
Comment from : Sherif Ahmed


Raven Echo
ive been using classmethods as a way to lock down interfaces, rather than using config filesbrbrespecially when it comes to pipelines good idea or bad? how would one use class methods? are they a replacement for a singleton?
Comment from : Raven Echo


Mista T
Mid level engineer here Binge watching your videos like its netflix Hands down some of the best programming content on youtube Thank you!
Comment from : Mista T


Oluwabukola Owoeye
wow I loved every bit of this videofrom the introduction to the end, as a self taught software developer in the making vidoes like this helps a lot, I did not only like but i subscibedThank you
Comment from : Oluwabukola Owoeye


TsiGahn
You either want to do something well OR you do it in python
Comment from : TsiGahn


Magnus Anand
Great video!
Comment from : Magnus Anand


Jordan Mungo
This is a really good video Only thing I'd say I disagreed with is separating classes by data vs behavior In theory this sounds nice, but when I get into a larger project I almost always need some of my data focused classes to be able to do some various behaviors I think separating those out too much from each other could pose other problems All about balance though
Comment from : Jordan Mungo


Barry Kruyssen
code MUST be readable by humans first, has been my motto for years And what you're saying is along those lines The more I watch of your videos ,the more I like I'm trying to "bing" watch your videos but my head feels like it may explode 🙂 Keep up the good work
Comment from : Barry Kruyssen


Kathi
Isn't the Point of Objekt oriented programming to combine Data and methods? So that the class can stay consistent for the Data?
Comment from : Kathi


Bikes
algo boost comment thanks for all your help!
Comment from : Bikes


balbir chahal
tip 2 doesn't make any sense in terms of OOP By definition an object has state and behaviour So when the author is suggesting to keep the two separate, he is just better organising procedural/functional style code and it does not apply for OOP
Comment from : balbir chahal


Miguel Vásquez
I have a question about tip 2 If its not recommended to combine data and behavior classes, wouldnt we be against whath POO proposes about attributes and methods?
Comment from : Miguel Vásquez


edgeeffect
Modula-2!!! Kudos from a Pascal lover!
Comment from : edgeeffect


D S
Thank you!
Comment from : D S


Neema Tsering
I can't believe your channel hit 100K+ subs I have learned a lot from you Arjan, thanks for all the quality videos (and free knowledge) You deserve more
Comment from : Neema Tsering


Noah Jones
Can you do a vid on import handling?
Comment from : Noah Jones


Embru
Excellent video about how to make the code cleaner and neat Thanks a lot!
Comment from : Embru


DdOS
Great video!
Comment from : DdOS


Daniel
"Object oriented programming is stupid" You should've stopped the video there 😂
Comment from : Daniel


Олег Чередниченко
nice background
Comment from : Олег Чередниченко


Slacquer
Good stuff Separating data and behavior concerns is forward thinking Not being worried about strictly adhering to a design paradigm is so refreshing to hear; let's be practical! This is your best video, yet!
Comment from : Slacquer


Colaholiker
I can see how Java gets a lot of heat for how things are done When I started studying computer science in 1999, no surprise, Java was all the rage Fortunately I had worked with Delphi before (a natural step up from my Turbo Pascal days in DOS), so I was able to tell apart what disadvantages are specific to Java and what to OOP in generalbrI have moved away to mostly working in C nowadays since I work as an embedded developer (never done C++), but I use Python for tools that make my life easier That's why I watch your videos When appropriate, I sometimes follow a semi-OOP approach in C, where I define a struct holding all data of that "object" and pass this (well, a pointer to it) to various functions that work on this data, much like the self parameter in an object's method in Python I even call the parameter "self" most of the time 😅
Comment from : Colaholiker


tir0__
Wow 🤩 luckily I landed on this channel and loving it Gonna go through each of the videos , amazing way of teaching
Comment from : tir0__


Justice Selasi Yevoo
I'm glad I found this channel
Comment from : Justice Selasi Yevoo


No Stromo
I'm making my way to senior and I would dare say you helped me a lot with getting to a whole different level of app design Thanks
Comment from : No Stromo


Carl Hunter-Roach
I enjoyed your video In your tip #2, it would be useful to add an explicit "Why you create separate data and behaviour classes" It sounds like you are transitioning to FP when you say that often the behaviour classes could be replaced by a module of functions Are you trying out any pure -FP languages?
Comment from : Carl Hunter-Roach


Iraj
great tips Arjans
Comment from : Iraj


digiryde
Its like arguing a hammer is always better than a screwdriver
Comment from : digiryde


Programming with John
O dear
Comment from : Programming with John


££l337
Thanks for sharing! What is the sound/track name at the end of the video ?
Comment from : ££l337


Davis Rogers
Thank You,brbrFrom the Functools to DataClassess and now blending (F and OOP)brbrI feel this could have been your 7 steps pdf for download, lolbrbrI had a question about assigning a index in lieu of self generated indexingbrbrThere are (Cluster, Multilevel, Sparse, Hash etc)brbrI have a establisd mathematical function I would like to use to assign a index to the database instead of building out table relationships brbrI believe your depth of understanding of how to remain scalable and dynamic in your approach to coding gives me a bit of confidence that I can do something along these lines brbrThank you for your valued insight in this field brbrMy question is how can we have a discussion ?brbrMy bread just came out of the toaster, and butter must be applied for the best Bread in the WORLD, lolbrbrPS also my thumbs are cramping from this texting I need to use VOIP more often
Comment from : Davis Rogers


Cheeba Digga
About inheritance: One more usage of it is for making C/C++ classes integrate better in a Python program Depending on how the C/C++ side is implemented, inheriting from these, or creating a class to wrap around them, might actually benefit the simplicity and readability of your code
Comment from : Cheeba Digga


The TopShottah
I like your explanations
Comment from : The TopShottah


Adnane EL KASMI
as someone who uses python for over 2 years now This is a huge added value for a 16 mins video
Comment from : Adnane EL KASMI


Nitin Punjabi
I've worked in crazy spaghetti codebases, and architecture astronaut code mazes After those experiences, I love this practical, real-world advice Thank you
Comment from : Nitin Punjabi


Tea Bunz
I don't think functional alone is conductive to clean code How do you group functions? How do you initialize data in a group of functions that share some state or configs? How do you decouple the functions' contract from its implementation, etc
Comment from : Tea Bunz


Good luck America
This video has a lot of boilerplate footage
Comment from : Good luck America


oglop
Thanks, I used the dictionary as a collection of functions/objects a lot but until this video, I did not realize that enums as keys can work really nice
Comment from : oglop


TechieGuy
Superb tips
Comment from : TechieGuy


Dino Dini
Writing object oriented code well is basically a process of mostly avoiding object oriented programming
Comment from : Dino Dini


Noël D
For dataclasses, why don't we just use dictionaries?
Comment from : Noël D


Simon
#1 - Don't use OOP and prosper
Comment from : Simon


Ted Lerios
This kind of insight is quite rare for a you tube video Really well delivered on a topic that should be discussed more! brbrKey takeaway is mostly that your chosen method of programming doesn’t have to be right or wrong Is it useful? Is it readable to others in the team? brbrGreat work!
Comment from : Ted Lerios


Jeffrey Ralston
Arjan, I love all your videos You are a great teacher I know it's not the focus of your video, but can you tell us how you have your line numbering setup in VSCode?
Comment from : Jeffrey Ralston


grant williams
Data classes have brought way more OOP to my code A series of transformations on an object with predefined values is way easier to track compared to a dictionary
Comment from : grant williams


Dawid Dahl
Thank you! 🙏🏻
Comment from : Dawid Dahl


nathan ruben
I really hate python
Comment from : nathan ruben


Marco Tröster
I did all your tips in my last refactoring and it's working wonders 😂 A sane combination of functional and oop is actually great for writing well-structured code without crazy side-effects! 😄brbrOne thing about turning behavior-oriented classes into raw functions: If you wanna do dependency injection and duck typing via protocols, it's really essential to represent your set of functions as a class because it's way more cohesive than passing each function separately (really helps readabity) And moreover something like attributes is necessary to store the handle to each dependency instance But for the rest of the video, I totally agree 😁
Comment from : Marco Tröster


Rez
tip numebr one: don’t do it brtip numebr two: there is none
Comment from : Rez


O
Basically all big and popular Python libs are written in a OO manner OO and "Pythonic" is not contradictory IMHO, who believes that simply is a programming novice and has never worked on any bigger project in RL And sure: you CAN go even further and do everything using functional programming But than again: in RL good luck finding enough staff familiar with that to the required degree OO is here to stay for many more years to come because it maps relations in a manner how we associate things in our brains Easy to learn, hard to master
Comment from : O


Aerism
So you just use it how Rust is? Rust uses Structs for data and "Traits" for behavior Rust has no classes I do like to keep data and functionality separated in any kind of programming language Sometimes the data can have some kind of "interface" on top of it for lightweight functionality But even that interface or lightweight functions are mostly separated haha
Comment from : Aerism


Alberto Harres
this is quality content for senior devs; you're talking about abstract topics that matters on the big picture/decision making of big projects; I loved it, subscribed!
Comment from : Alberto Harres


zeki
I am confused what is the meaning of @dataclass and @property??
Comment from : zeki


Niall Tracey
Those look a lot more like procedures than functions to me
Comment from : Niall Tracey


D P
Hey ArjanbrMaybe you'll consider making a tutorial about creating python packages with setuptools etc? :)
Comment from : D P


Lud Orb
I noticed you sometimes use the UML class diagrams to explain some OOP patterns (eg adapter pattern) brI would love, if you would explain how to read those diagrams on some examples I can't follow them in other videos
Comment from : Lud Orb


Swadhikar C
Great topic indeed and looking forward for many such
Comment from : Swadhikar C


Will D
what is the -> operator?
Comment from : Will D


Jorge Escobar
The point of classes is to group up related behavior and data together If you create a class just to store data, there are dictionaries for that If you want to group up functions, that's why we have imports and functions in single files
Comment from : Jorge Escobar


Jacques Gerber
Classes to me are too repetitive and seems to nested, if that makes sense It’s on thing learning about students, and nr and subjects that fit into a class, and quite another to link duplicity name types with ’s
Comment from : Jacques Gerber


Ivaylo Bonev
1 Tip For Object-Oriented Programming Done Well - don't do it in python ;)
Comment from : Ivaylo Bonev


Demid Druganov
Its not functional, its procedural
Comment from : Demid Druganov


c greek
Now this crack, is just unreal! Thanks for that ;)
Comment from : c greek


#FREEZILLA
100 working THXs
Comment from : #FREEZILLA


Handsome_Hero
OOP sucks balls
Comment from : Handsome_Hero


Paulo Henrique
Amazing video Sir! Thank you very much for sharing your expertise with us! I always learn a lot from you!
Comment from : Paulo Henrique


Marcus Rehn
Step one, forget about inheritance
Comment from : Marcus Rehn


Vincent Rodriguez
You've failed at "object-oriented", there's no good way to run with a fridge strapped to your back xD
Comment from : Vincent Rodriguez


nccamsc
What the OP calls "functional" programming is actually procedural programming Writing stand alone functions does not mean you are using FP Full-blown FP is what languages like Haskell and F# do Python has limited FP capabilities
Comment from : nccamsc


sick000fight
you can use ide to navigate embedded classes, interfaces or abstract classes
Comment from : sick000fight


Abhishek Srivastava
Rocking that shirt! And as always concise and wonderful video
Comment from : Abhishek Srivastava


Platin 21
Simply don’t do it python wasn’t made for it and it’s only there because it didn’t have structures
Comment from : Platin 21


Andrew Erwin
Here is your first tip abandon Python and use a real object oriented language Be definition, having to pass a reference to the class to each member of the class IS NOT object oriented It is just dependency injection There is no multiple inheritance (or inheritance at all to be honest), againdependency injection Python does not support actual polymorphism, at best it supports a weak version of overloading, but that really isn't the same thing
Comment from : Andrew Erwin


firefouuu
One thing I don't understand is why you see so rarely these tips applied, even in the python standard libary One recent exemple is the pathlib library It does everything you advise against like multiple inherentences and even the use of the fency i_new_/i to create an os dependant path instance So is it worth using this style of coding when not many people seem to use it ?
Comment from : firefouuu


DistortedV12
This guy does create a lot of object oriented code, sometimes importing a couple of functions in a python script is all you need
Comment from : DistortedV12


ananda putra doneva
brother thanks for share this best Crack
Comment from : ananda putra doneva


Prag & Senss diary
OOP can be done well? what? WHAT? I've always thinked that the right way to do OOP is ditch it and use Procedural
Comment from : Prag & Senss diary


RiptorForever
Best channel of advanced python OOP thanks!
Comment from : RiptorForever


Виталий Сергеев
With all due respect, the first example is not a combination of FP and OOP Here's an exemplification: "2" is an object in Python, and print() is a function But when we write "print(2 + 2)" we don't "combine FP and OOP" It is just old good imperative codebrbrWhen we put imperative code into a function, we don't do "functional programming" just because of that Functional programming is a quite special thing: it's a programming via function composition Likewise, when we put our code into a method, this doesn't make our code object-oriented OOP assumes certain specific principles (encapsulation, inheritance, polymorphism), without them it's all just using classes as C-like data structures
Comment from : Виталий Сергеев


hg
thanks for the tips
Comment from : hg


Alex D
you're using a wrong definition of functional programming It has nothing to do with using objects or not What you mean are stand-alone functions
Comment from : Alex D



Related 5 Tips For Object-Oriented Programming Done Well - In Python videos

Fundamental Concepts of Object Oriented Programming Fundamental Concepts of Object Oriented Programming
РѕС‚ : Computer Science
Download Full Episodes | The Most Watched videos of all time
Object-oriented Programming in 7 minutes | Mosh Object-oriented Programming in 7 minutes | Mosh
РѕС‚ : Programming with Mosh
Download Full Episodes | The Most Watched videos of all time
Object-oriented Programming Visually Explained for Data scientists Object-oriented Programming Visually Explained for Data scientists
РѕС‚ : Thu Vu data analytics
Download Full Episodes | The Most Watched videos of all time
Modular Object-Oriented Dynamic Learning Environment Modular Object-Oriented Dynamic Learning Environment
РѕС‚ : The Education Channel
Download Full Episodes | The Most Watched videos of all time
#TIK #13 Modular Object Oriented Dynamic Learning Environment #TIK #13 Modular Object Oriented Dynamic Learning Environment
РѕС‚ : Akademisi Muda
Download Full Episodes | The Most Watched videos of all time
Modular object-oriented dynamic learning environment LMS in Hindi Urdu LECTURE 19 Modular object-oriented dynamic learning environment LMS in Hindi Urdu LECTURE 19
РѕС‚ : Virtual Comsats
Download Full Episodes | The Most Watched videos of all time
Moodle|Modular object-oriented dynamic learning environment Lms in Hindi Urdu LECTURE 22 Moodle|Modular object-oriented dynamic learning environment Lms in Hindi Urdu LECTURE 22
РѕС‚ : Virtual Comsats
Download Full Episodes | The Most Watched videos of all time
Moodle มาจากคำว่า Modular Object-Oriented Dynamic Learning Environment Moodle มาจากคำว่า Modular Object-Oriented Dynamic Learning Environment
РѕС‚ : Ajan Pannavich Chanel (ช่องอาจารย์ปัณณวิชญ์)
Download Full Episodes | The Most Watched videos of all time
Moodle|Modular object-oriented dynamic learning environment in Hindi Urdu LMS in Hindi Urdu Moodle|Modular object-oriented dynamic learning environment in Hindi Urdu LMS in Hindi Urdu
РѕС‚ : Virtual Comsats
Download Full Episodes | The Most Watched videos of all time
Moodle|Modular object-oriented dynamic learning environment in Hindi Urdu LECTURE 23 Moodle|Modular object-oriented dynamic learning environment in Hindi Urdu LECTURE 23
РѕС‚ : Virtual Comsats
Download Full Episodes | The Most Watched videos of all time