Having spent over 100 hours across various paid and free resources, nothing matches the unique teaching style and enthusiasm of Professor David Malan. His passion and approach to teaching are truly remarkable. What makes this course unique is how he gradually sets the stage for different concepts. CS50 is absolutely the best course to learn Python.
Unbelievable. He still looks fresh at the end! He was surely taking breaks?!!! The level of teaching on this course is so high, really carefully guides and enthuses the viewer. Very grateful to have free access.
CS50 is best course out there. Malan is the best teacher I've seen . His understanding on OOP and python in general is outstanding. How lucky are these harvard students
@@mythbuster6126 I've completed like 7 or so 3 of them were related to programming and for me he is the best teacher tied with anither teacher but since they taught completely different things I can't quite compare them
I think I'm doing this course too late, however it made me believe that I can also do programming and start all over again after a big failure in my career, I thought I'm lost, but now I think, I can still do it. The ship has not sailed yet.. A huge thanks, respect, love and blessings from my side to Sir David Malan and The Team. Maybe one day I would love to be part of the in person class.
This was soooo good. This class took me longer than any other previous CS50P classes, but it was worth it. I love the metaphors, they are vivid and to the point. Having took CS50P for more than a month now, this course has certainly grown on me. Sometimes, when I feel down or upset in life, watching David's teaching just gives me a sense of order and inspiration. And the problem sets are equally fun, engaging and challenging. Just want to say a big thank you to the whole CS50 team.
Bro, i swear same here when I feel down or blue I watch david Malons course even though I don't hv a PC I'm trying to code in my phone for the last 5 yrs till now
Wow David got so passionate on this one that he almost had no voice to say "This was CS50". Such enthusiasm, im so glad this got to be my first programming course ever. Thank you thank you!
I nearly use about 6 hours to finish this OOP class. David malan explains so carefully and the example is well-designed. In some part of this video I watched it again and again. the best class in CS50P
extremely engaging way to teach programming. i wish all teachers are like this. very precise, articulate, consistent and masterful. especially at the end. the most difficult concepts to comprehend (on your own) were explained like they were nothing. this guy is my hero
Anither quality of him is hoe he teaches new information with an actual context like in the cs50x when he talked about sql, I've never understood the point of sql but the way he build up the lecture (talking about csv, how variables don't hold info etc) actually made me feel the need to use that, that's a huge deal in programming, you have to feel the need to use something for some problem if raw information is presented to you without a context you'll probably forget about it in no time
I've been using OOP and objects for years in Python. Still learned quite a lot. Great introductory video. So, thanks! For those who may feel a little discouraged about objects, don't worry. It's one of those things where a lightbulb has to go off and then you're like wow, now I understand. And you won't be able to control yourself, lol. Few suggestions to help out: • Focus on concepts, not syntax • Concepts are too simple, that's why it's hard, it just instances • Everything is an object including the space above your head, date/times, parking spots, lanes on a highway, a web page • Objects are responsible for their own methods which means it's not a mechanic that changes the oil on a car, it's the car itself that changes it's own oil • Objects are composed of other objects like a Car() which has 4x Wheel() • Extremely important, all the data & functionality travels with the object (known as encapsulation). So, you don't keep a separate birthday list for family members. You ask the instance of the Grandma() object directly if it's her birthday. She's responsible for knowing, not you. Fun example... Create 100x Casino() with 50x Table() with 1x Shoe() of 8x Deck() of 52x Card(). Randomly distribute the 40,000 deck of cards amongst the casinos and various tables. Shuffle the cards for each shoe. And oh ya, each card has a unique serial number. And card #888 of 2 million+ is defective and needs to be replaced. Find the casino and table where card #888 is located. Thats the power of OOP.
@@abdqasrawi self refers to the instance of the class you are in. self.name is the variable name that belongs to that instance. In a real OOP language classes define private name spaces that can not be accessed from the outside of the class. Python is not such a language. It does not (and probably can not by design) isolate variables and methods of a class. That makes OOP in Python basically useless from an architect's point of view. The language simply does not check for programming errors that may result from external modifications of class variables. In C++, Java etc. such checks happen, which can be useful if you are dealing with novice and undisciplined programmers. Python assumes that you are a grownup and that you don't need such nanny measures.
I started my computer science journey with watching CS50 videos over two years ago, nowadays I'm using them to quickly brush up on concepts. Either way, CS50 changed my life :')
@@yulana990 He is watching videos on UA-cam. That's not studying. Studying is when you are living it 24/7 at a university. I did teach CS as a grad student, by the way. You would not have passed our CS 101 exams with the materials that you can find online. Not even close.
Thank you so much Harvard for keeping this treasure trove for free on UA-cam available for everyone. Dear Sir David J.Malan , your energy and enthusiasm just flows like a Lava when you teach and you're the best instructor I have ever seen ❤.
FWIW, the problem that Dr. Malan fixes at 21:25 is no longer an issue. Python now treats quotes within curly braces in an f-string as independent of the quotes defining the string. So a line like print(f"{student["name"]} from {student["house"]}) now works despite the use of double quotes within the substitution strings. I know this is true in Python 3.12, but it may have been introduced in 3.11.
Dear David, I just watched your video on OOP and I finally understand it. Your clear explanation and examples made all the difference. Thank you so much for sharing your knowledge with us. Your teaching has made a big impact on my learning and I am grateful for it. Best regards, from tunisa
Just amazing, I’ve been trying to understand OOP for a while and here it is all explained brilliantly by David and his team. The learning cycle isn’t complete without some practice and application, so that’s what next with the assignments and my own programming needs. Many Thanks for the incredible generosity in sharing these lectures.
David is a world class educator who must surely be in the top 0.5% of python teachers on this Earth. Add that to the greatest practice labs of any python course on Earth and it becomes an undeniable fact that this is the best python course that exists anywhere on this planet.
its amazing to see some of the questions the students are coming up with. Very interesting questions raised towards the end that gave even David some pause. Perfect critical thinking on part of the students.
Thank you guys for delivering these awesome lectures and bringing knowledge to others. I'm so grateful that I was born into this era, where such precious knowledge is handed for free.
So passionate! even though it's my first time to learn programming formally when i am pursuing a master degree in other major, i am excited. Thanks for sharing. If possible, i will further my research next year in US. best wishes
I disagree, inheritance for example shouldn’t be mentioned like they way he describes it and will lead inexperienced people to create tight coupling, overly nested hierarchies and overlook some of the SOLID principles. They are better points to start from, not some contrived person example. Go study any respected GitHub repo and see how it’s used or not rather.
@@MrDante1947 lol and then he never replies again, that's what you get yo pay attention to people who always criticize others without showing proofs and yeah people with no programming experience will surely learn looking someone else's code used in specific context, and in fact when there's so many code samples from all different sources why bother watching a video right best advice nothing can go wrong
@@sayori3939 Yeah ikr, David J Malan is literally a harvard professor with decades of experience in Computer Science but some random guy that's been programming for 3 weeks always knows better somehow
I couldn't understand this lecture well at first but after earning through various online resources on and off within the past 2 months, I am trying to fill in any gaps I have
by far the hardest lecture week so far. I'm having difficulty trying to understand the concept of OOP. Probably will take a look at another sources on this OOP concept.
Note that from about 1h 14 minutes into the video, if you don't have Python 3.10 or higher, you'll get a "SyntaxError: invalid syntax" for the match self.patronus: line since Python 3.9 and below DOES NOT support the match/case syntax
man i have already watched it twice and it still feels equally hard 😥. Although i've watched the regex video in 2x speed and that was very easy, but this topic is something
@@abdou_belounissearch up Corey Schafer watch his videos of first class variables then closures then decorators then his playlist of 6 videos on object oriented programming . You'll gain a better understanding trust me
search up Corey Schafer watch his videos of first class variables then closures then decorators then his playlist of 6 videos on object oriented programming . You'll gain a better understanding trust me@@abdou_belounis
For the first time in this course, professor said “This was cs50”. It brings back memories from cs50x 2024 😭😭 they used to say it in every class 😭 really miss those golden days ❤
Hello friends, I hope you are at your best time ever. CS50 has been one of the best courses I have attended so far. 👍 unfortunately this part is very difficult for me, even though I have watched this video many times, but I still cannot solve the problems of this lesson. I don't know how to get through this part !!!🚑🚒🚑🚒🚑🚒
I feel like standing under a waterfall of his energy, knowledge and enthusiasm! So so so awesome!!! Thank you so much David! It's a kind of magic! Btw, what's David's patronus?
self is there because in reality the first thing that happens is __new__ constructs the object and then when __init__ runs, it takes the just instantiated object as the first argument, i.e. self.
This IS a lot of syntax in one shot. More of the step-by-step walking through what the code is supposed to be doing as in previous lectures would be helpful to encourage understanding. I'm sure that would add some time, but at 2:47, it's already almost worth breaking into two lectures.
CS50 team you aur doing great work Adding value in our life Iam a new subscriber in your channel and i will continue this searies after my MHTCET PCM This is a state level Exam and get admission in CSE it take around a month because my exam is in 11th August 2nd shift
I was so confused about @property and setter, so I tested it a little on my own: - basically, when we declared our property, we told python to treat an attribute now like read-only, so if we try to do any assignments without defining a setter, we get AttributeError: property 'name' of 'Student' object has no setter. that's why we have to declare a setter after getter. - We can name our property function however we want, and it'll work, for example: class Student: def __init__(self, name2, house2): self.name = name2 self.house = house2 # Getter for name @property def thing(self): return self.name print(student.name) print(student.thing) but in this case if we want to prevent incorrect inputs, we have to do it twice in our constructor and setter, and that doesn't seem like a good thing to do. I need some time to wrap my head around the lecture :D
The problem with suppressing "incorrect" inputs with a setter is that you are making it impossible to test your code from the outside against the case that the variable takes on an incorrect value. It's a naive strategy that sounds and looks good on the outside but causes nothing but grief for the programmer, the test team and the user later. It also requires that your are locating entry error recovery code inside a business function... which architecturally is an absolute no-no. That's something the frontend has to take care of. Don't do it.
Can someone help me undrestand a change in the code? At 1:15:20, david writes the "charm" method, using match to figure out which emoji to return. However a bit after that, while he shows the code, it's shown to have been changed to use a series of conditionals instead. There's probably been some editing of the video but I still wouldn't understand the reasoning by which to choose a specific path to code the method. Thanks in advance!
case is just an alternative way to check multiple cases for matching values. the long way would be chains of if/elif/else. explanation is in the first lecture here: ua-cam.com/video/_b6NgY_pMdw/v-deo.html the change in code here is due to editing of the video, there were unedited lectures on this channel where he corrects or modifies minor stuff on the go and then it is edited down
About the 93 min , when Mr.Malan is asked why isn't _house being used in the init, i think there is better answer . The thing is that self.house is not a field, it's the setter itself which return a self._house so house is the setter and _house is the field . Thank you cs50
could i make a suggestion? When students ask questions use an overlay in the upper right /lower right corner instead of blanking out the whole screen. It is a bit jarring when focusing on the code and listening. 🥰love the videos thank you.
i dont want to start a conspiracy theory.... but did you ever notice how the questions asked just tie right into the next topic david is about to get into?
0k usually its the exercises are the hard part, but ngl this lecture is more difficult to wrap my head around then any exercise so far. saying that I can't even imagine how hard the exercise is going to be😅
In my humble view, it is fine illustrating OOP concepts using a flexible language/syntax like python, but the real truth is, if one considers going OOP at full scale, C++ or Java would be the most relevant way to go... I'm no python expert but few weeks ago I've started prototyping a numerical model using python, I naively went on writing some code to overload "the default constructor", as can be done in C++ seamlessly, it was a nightmare, even on stackoverflow I've gotten to a point where it was all about workarounds and trick this or that, which gave me a very bad insecure feeling about the OOP implementation completeness in python. So OOP concepts implementation maturity and language completeness around these concepts are indeed of crucial importance when choosing which OOP language to use for problem solving.
I agree with mostly of what you said yeah, it’s about using OOP patterns to allow the code to evolve with problem so building In factories, decorators ( wrapper not python attribs !) and the occasional ABC as a pseudo interface helps a lot. Python can do it but yeah, better suited to web scripting than real engineering problems currently solved by oop languages.
Google: 1. Fragile Base Class syndrome 2. The definition of Monads Then avoid Object Oriented Programming and Functional Programming. They are both useless.
I really hate people who recommends some random language in a language specific course like what's the point? If a project is written in python that won't change also you can't change languages like clothes if you try to learn language for some and another for something else you won't make progress unless you're a genius or you already know at least one
Oh sorry i forgot to tell i tried some oop in c++ long ago, it felt like it all made sense, and in python it is a little weird but, yeah we're using python here so....
Such a great teacher and such a great course. I've learned so much watching the lectures and working through the problem sets. I'm so happy this is a thing.
Dictionary vs classes. Classes give you error checking abolity before you populate it. Code defensively so that the user cabt change the atrributes. Decorators define properties Use class methods when you don't need to create objects of a class. You only use the class as a container for some functions and variables (no init). you do not automatically inherit all of init. You must use super().__init(name)__. Thus the init method of the subclass calls the init methods of the super class Exception classes are hierarchical in nature. This is why you can you "with Excception" to capture almost all exceptions
Having spent over 100 hours across various paid and free resources, nothing matches the unique teaching style and enthusiasm of Professor David Malan. His passion and approach to teaching are truly remarkable. What makes this course unique is how he gradually sets the stage for different concepts. CS50 is absolutely the best course to learn Python.
Why would you pay for Python? It's free. ;-)
CS50P* (CS50 is a different course)
How does this man have so much energy and focus to shoot at 2 hour 50 minute lecture. Incredible.
it's more then that with the cuts and some edits
Unbelievable. He still looks fresh at the end! He was surely taking breaks?!!! The level of teaching on this course is so high, really carefully guides and enthuses the viewer. Very grateful to have free access.
CS50 is best course out there. Malan is the best teacher I've seen . His understanding on OOP and python in general is outstanding. How lucky are these harvard students
He is!
How lucky are we they put it online for free also. I love David!!
Malan in my language is called teacher. He is a really great Malan I learned a lot from him. Thanks 🙏
@@mythbuster6126 I've completed like 7 or so 3 of them were related to programming and for me he is the best teacher tied with anither teacher but since they taught completely different things I can't quite compare them
Thank you!
I think I'm doing this course too late, however it made me believe that I can also do programming and start all over again after a big failure in my career, I thought I'm lost, but now I think, I can still do it. The ship has not sailed yet.. A huge thanks, respect, love and blessings from my side to Sir David Malan and The Team. Maybe one day I would love to be part of the in person class.
The best day was yesterday, the next best day is today. It's never too late to learn something new and start over. You got this!
This was soooo good. This class took me longer than any other previous CS50P classes, but it was worth it. I love the metaphors, they are vivid and to the point. Having took CS50P for more than a month now, this course has certainly grown on me. Sometimes, when I feel down or upset in life, watching David's teaching just gives me a sense of order and inspiration. And the problem sets are equally fun, engaging and challenging. Just want to say a big thank you to the whole CS50 team.
Bro, i swear same here when I feel down or blue I watch david Malons course even though I don't hv a PC I'm trying to code in my phone for the last 5 yrs till now
The best thing that happened to me this year is CS50.
Glad you've joined us!
Wow David got so passionate on this one that he almost had no voice to say "This was CS50". Such enthusiasm, im so glad this got to be my first programming course ever. Thank you thank you!
I nearly use about 6 hours to finish this OOP class. David malan explains so carefully and the example is well-designed. In some part of this video I watched it again and again. the best class in CS50P
extremely engaging way to teach programming. i wish all teachers are like this. very precise, articulate, consistent and masterful. especially at the end. the most difficult concepts to comprehend (on your own) were explained like they were nothing. this guy is my hero
Anither quality of him is hoe he teaches new information with an actual context like in the cs50x when he talked about sql, I've never understood the point of sql but the way he build up the lecture (talking about csv, how variables don't hold info etc) actually made me feel the need to use that, that's a huge deal in programming, you have to feel the need to use something for some problem if raw information is presented to you without a context you'll probably forget about it in no time
I've been using OOP and objects for years in Python. Still learned quite a lot. Great introductory video. So, thanks!
For those who may feel a little discouraged about objects, don't worry. It's one of those things where a lightbulb has to go off and then you're like wow, now I understand. And you won't be able to control yourself, lol.
Few suggestions to help out:
• Focus on concepts, not syntax
• Concepts are too simple, that's why it's hard, it just instances
• Everything is an object including the space above your head, date/times, parking spots, lanes on a highway, a web page
• Objects are responsible for their own methods which means it's not a mechanic that changes the oil on a car, it's the car itself that changes it's own oil
• Objects are composed of other objects like a Car() which has 4x Wheel()
• Extremely important, all the data & functionality travels with the object (known as encapsulation). So, you don't keep a separate birthday list for family members. You ask the instance of the Grandma() object directly if it's her birthday. She's responsible for knowing, not you.
Fun example... Create 100x Casino() with 50x Table() with 1x Shoe() of 8x Deck() of 52x Card(). Randomly distribute the 40,000 deck of cards amongst the casinos and various tables. Shuffle the cards for each shoe. And oh ya, each card has a unique serial number. And card #888 of 2 million+ is defective and needs to be replaced. Find the casino and table where card #888 is located. Thats the power of OOP.
can you tell me what's the concept behind self?
and why to create instances like self.name = name instead of just name
@@abdqasrawi self refers to the instance of the class you are in. self.name is the variable name that belongs to that instance. In a real OOP language classes define private name spaces that can not be accessed from the outside of the class. Python is not such a language. It does not (and probably can not by design) isolate variables and methods of a class. That makes OOP in Python basically useless from an architect's point of view. The language simply does not check for programming errors that may result from external modifications of class variables. In C++, Java etc. such checks happen, which can be useful if you are dealing with novice and undisciplined programmers. Python assumes that you are a grownup and that you don't need such nanny measures.
Thanks for this excellent comment 🫡
I started my computer science journey with watching CS50 videos over two years ago, nowadays I'm using them to quickly brush up on concepts. Either way, CS50 changed my life :')
How is it going?
@@Safar_Galimzyanov He is still posting bullshit on the internet while working as a cab driver. How do you think it's going? ;-)
@@andoryus I am simply calling bullshit when I see bullshit. There is just an awful lot of bullshit on the internet. ;-)
@@lepidoptera9337 Someone who studies CS watching a free CS course from Harvard, is somehow ''bullshit''? Please, get a grip.
@@yulana990 He is watching videos on UA-cam. That's not studying. Studying is when you are living it 24/7 at a university. I did teach CS as a grad student, by the way. You would not have passed our CS 101 exams with the materials that you can find online. Not even close.
Thank you so much Harvard for keeping this treasure trove for free on UA-cam available for everyone. Dear Sir David J.Malan , your energy and enthusiasm just flows like a Lava when you teach and you're the best instructor I have ever seen ❤.
FWIW, the problem that Dr. Malan fixes at 21:25 is no longer an issue. Python now treats quotes within curly braces in an f-string as independent of the quotes defining the string. So a line like
print(f"{student["name"]} from {student["house"]})
now works despite the use of double quotes within the substitution strings. I know this is true in Python 3.12, but it may have been introduced in 3.11.
How did Mr. Malan manage to speak for 3 hours straight while giving us a thorough understanding of the topic? mind blowing
the magic is he's saying the same thing that a lot of youtubers do, but his expression somehow make it so easy to understand !!!!!!!! It's magic !
Woww ! I'm doing mentally high five. I'm glad I found CS50. The teaching skill is exceptional ! Thank you so much !!
Dear David,
I just watched your video on OOP and I finally understand it. Your clear explanation and examples made all the difference. Thank you so much for sharing your knowledge with us. Your teaching has made a big impact on my learning and I am grateful for it.
Best regards, from tunisa
So glad you found the material helpful!
Just amazing, I’ve been trying to understand OOP for a while and here it is all explained brilliantly by David and his team. The learning cycle isn’t complete without some practice and application, so that’s what next with the assignments and my own programming needs. Many Thanks for the incredible generosity in sharing these lectures.
David is a world class educator who must surely be in the top 0.5% of python teachers on this Earth. Add that to the greatest practice labs of any python course on Earth and it becomes an undeniable fact that this is the best python course that exists anywhere on this planet.
Course you know exists
This world is large
CS50 rocks! The author of Harry Potter would never expected her story provide an perfect example for OOP.
З Днем викладача! Щирі побажання найкращому Вчителю.
David is such a legend as he is able to understand / decipher what his students are asking. i had a hard time understanding them :/
The best teacher I've seen so far.
3h of energy and passion. Obrigado David 💛💚
Huehuehuehuehue brbrbrbrbr Valeu!
Chama que chama chama
Bora rodar uns code brbrbrbrbrbrbrbr
I have been struggling to understand OOP for days now, but David just made my year! This Man is amazing
its amazing to see some of the questions the students are coming up with. Very interesting questions raised towards the end that gave even David some pause. Perfect critical thinking on part of the students.
This teacher is literally AMAZING!!!
this class was awesome! I did watch videos on OOP before but none of them explained it as clear and oral as you did, thank you david!
Thank you guys for delivering these awesome lectures and bringing knowledge to others. I'm so grateful that I was born into this era, where such precious knowledge is handed for free.
This one was so good. I feel like I am finally comfortable creating classes and implementing them in my code.
I'm super grateful for this class and it's availability for students online! His teaching is super inspiring :)
So passionate! even though it's my first time to learn programming formally when i am pursuing a master degree in other major, i am excited. Thanks for sharing. If possible, i will further my research next year in US. best wishes
Thank You, CS50P Team.
You guys are the best. I love you all.
The best explanation of the OOP out there. I like the way it has been structured. Thank you🙇 CS50P!
I disagree, inheritance for example shouldn’t be mentioned like they way he describes it and will lead inexperienced people to create tight coupling, overly nested hierarchies and overlook some of the SOLID principles. They are better points to start from, not some contrived person example. Go study any respected GitHub repo and see how it’s used or not rather.
@@coderider3022, sure I will take a look. Thanks for your reply!
@@coderider3022 Do you have any good GitHub Repo for recommandation
@@MrDante1947 lol and then he never replies again, that's what you get yo pay attention to people who always criticize others without showing proofs and yeah people with no programming experience will surely learn looking someone else's code used in specific context, and in fact when there's so many code samples from all different sources why bother watching a video right best advice nothing can go wrong
@@sayori3939 Yeah ikr, David J Malan is literally a harvard professor with decades of experience in Computer Science but some random guy that's been programming for 3 weeks always knows better somehow
this guy is a phenomenal instructor
Thank you Prof Malan for a detailed session on strong fundamentals. 👏
I couldn't understand this lecture well at first but after earning through various online resources on and off within the past 2 months, I am trying to fill in any gaps I have
Same
No joke 😥😥😥
I've understood basically everything before this vid, I'm really struggling with OOP
by far the hardest lecture week so far. I'm having difficulty trying to understand the concept of OOP. Probably will take a look at another sources on this OOP concept.
hes using too much vocabulary then showing the real stuff its not good to understand that way
Same
Note that from about 1h 14 minutes into the video, if you don't have Python 3.10 or higher, you'll get a "SyntaxError: invalid syntax" for the match self.patronus: line since Python 3.9 and below DOES NOT support the match/case syntax
Thank you, such a useful tip.
If you're scared of OOP, watch it from start to finish, you'll see how easy it is. One of the few teachers in the world. God bless you, David.
It's easy and it's the wrong way of looking at software, too. ;-)
@@lepidoptera9337 explain
cs50 is a game change
i really love it
Thanks David and team
I wish I could give more than one thumbs up, take my fingers and toes too... What a legend David is!!
Anybody else feel like this was the hardest lecture to understand to date?
man i have already watched it twice and it still feels equally hard 😥. Although i've watched the regex video in 2x speed and that was very easy, but this topic is something
Yeh v much so
Absolutely
@@abdou_belounissearch up Corey Schafer watch his videos of first class variables then closures then decorators then his playlist of 6 videos on object oriented programming . You'll gain a better understanding trust me
search up Corey Schafer watch his videos of first class variables then closures then decorators then his playlist of 6 videos on object oriented programming . You'll gain a better understanding trust me@@abdou_belounis
00:18:39 - Dictionaries
00:59:49 - Validating Attributes
1:34:00 day 3
2:03:00 day 4
He puts so much energy and effort in teaching ❤
For the first time in this course, professor said “This was cs50”. It brings back memories from cs50x 2024 😭😭 they used to say it in every class 😭 really miss those golden days ❤
This man knows how to teach! 👏
Hello friends, I hope you are at your best time ever.
CS50 has been one of the best courses I have attended so far. 👍
unfortunately this part is very difficult for me, even though I have watched this video many times, but I still cannot solve the problems of this lesson.
I don't know how to get through this part !!!🚑🚒🚑🚒🚑🚒
There is a community on discord and people are very helpful with each problem set. Check it out!
I feel like standing under a waterfall of his energy, knowledge and enthusiasm! So so so awesome!!! Thank you so much David! It's a kind of magic!
Btw, what's David's patronus?
Awesome lecture. Wonderful teacher & teaching!!
This course is amazing. thank you for this opportunity❤
self is there because in reality the first thing that happens is __new__ constructs the object and then when __init__ runs, it takes the just instantiated object as the first argument, i.e. self.
This IS a lot of syntax in one shot. More of the step-by-step walking through what the code is supposed to be doing as in previous lectures would be helpful to encourage understanding. I'm sure that would add some time, but at 2:47, it's already almost worth breaking into two lectures.
Let's have a brief silence for the folks who are still living in a world without this cs50.
Inheritance is the best and my personal favourite topic i leraned in cs50p
CS50 team you aur doing great work Adding value in our life
Iam a new subscriber in your channel and i will continue this searies after my MHTCET PCM This is a state level Exam and get admission in CSE it take around a month because my exam is in 11th August 2nd shift
Man needed OOP for exams ..the premiere came in clutch 😂💞💞
Learning python -> Super Class
Learning more_about_harrypotter -> Sub Class
I was so confused about @property and setter, so I tested it a little on my own:
- basically, when we declared our property, we told python to treat an attribute now like read-only, so if we try to do any assignments without defining a setter, we get AttributeError: property 'name' of 'Student' object has no setter. that's why we have to declare a setter after getter.
- We can name our property function however we want, and it'll work, for example:
class Student:
def __init__(self, name2, house2):
self.name = name2
self.house = house2
# Getter for name
@property
def thing(self):
return self.name
print(student.name)
print(student.thing)
but in this case if we want to prevent incorrect inputs, we have to do it twice in our constructor and setter, and that doesn't seem like a good thing to do.
I need some time to wrap my head around the lecture :D
The problem with suppressing "incorrect" inputs with a setter is that you are making it impossible to test your code from the outside against the case that the variable takes on an incorrect value. It's a naive strategy that sounds and looks good on the outside but causes nothing but grief for the programmer, the test team and the user later. It also requires that your are locating entry error recovery code inside a business function... which architecturally is an absolute no-no. That's something the frontend has to take care of. Don't do it.
so much free content thats amazing tysm. TY Malan for all your amazing lectures
Thank u a lot for sharing knowledge in a very interesting way!!!
Learned so much from Dr Malan's lecture!
Malan you are a great teacher.
this man has taught me so much
I loved this. I knew the theory, but it made me understand some concepts better.
Can someone help me undrestand a change in the code?
At 1:15:20, david writes the "charm" method, using match to figure out which emoji to return.
However a bit after that, while he shows the code, it's shown to have been changed to use a series of conditionals instead.
There's probably been some editing of the video but I still wouldn't understand the reasoning by which to choose a specific path to code the method.
Thanks in advance!
case is just an alternative way to check multiple cases for matching values. the long way would be chains of if/elif/else. explanation is in the first lecture here: ua-cam.com/video/_b6NgY_pMdw/v-deo.html
the change in code here is due to editing of the video, there were unedited lectures on this channel where he corrects or modifies minor stuff on the go and then it is edited down
@@nikitarasskazov4715 thanks a lot!
He made me to watch Harry Potter again! The best course for Python beginners
Nice tutorials is much more simple than I thought
We’re so lucky listening to the G.O.A.T.
About the 93 min , when Mr.Malan is asked why isn't _house being used in the init, i think there is better answer . The thing is that self.house is not a field, it's the setter itself which return a self._house so house is the setter and _house is the field . Thank you cs50
The greatest professor ever!
You are the best teacher
Здорово! Складна тема дуже доступно викладена
could i make a suggestion? When students ask questions use an overlay in the upper right /lower right corner instead of blanking out the whole screen.
It is a bit jarring when focusing on the code and listening.
🥰love the videos thank you.
Cs50 team you’re the best❤
Beautifully taught ❤impeccable
❤️ CS50 Lectures
I evolved from Pikachu to Raichu in the python world after this lecture . Thanks professor.
i dont want to start a conspiracy theory.... but did you ever notice how the questions asked just tie right into the next topic david is about to get into?
0k usually its the exercises are the hard part, but ngl this lecture is more difficult to wrap my head around then any exercise so far. saying that I can't even imagine how hard the exercise is going to be😅
I'm from Ethiopia Addis Ababa
In my humble view, it is fine illustrating OOP concepts using a flexible language/syntax like python, but the real truth is, if one considers going OOP at full scale, C++ or Java would be the most relevant way to go... I'm no python expert but few weeks ago I've started prototyping a numerical model using python, I naively went on writing some code to overload "the default constructor", as can be done in C++ seamlessly, it was a nightmare, even on stackoverflow I've gotten to a point where it was all about workarounds and trick this or that, which gave me a very bad insecure feeling about the OOP implementation completeness in python. So OOP concepts implementation maturity and language completeness around these concepts are indeed of crucial importance when choosing which OOP language to use for problem solving.
Python is more suitable for functional programming.
I agree with mostly of what you said yeah, it’s about using OOP patterns to allow the code to evolve with problem so building In factories, decorators ( wrapper not python attribs !) and the occasional ABC as a pseudo interface helps a lot. Python can do it but yeah, better suited to web scripting than real engineering problems currently solved by oop languages.
Google:
1. Fragile Base Class syndrome
2. The definition of Monads
Then avoid Object Oriented Programming and Functional Programming. They are both useless.
I really hate people who recommends some random language in a language specific course like what's the point? If a project is written in python that won't change also you can't change languages like clothes if you try to learn language for some and another for something else you won't make progress unless you're a genius or you already know at least one
Oh sorry i forgot to tell i tried some oop in c++ long ago, it felt like it all made sense, and in python it is a little weird but, yeah we're using python here so....
Such a great teacher and such a great course. I've learned so much watching the lectures and working through the problem sets. I'm so happy this is a thing.
21:16 da audio decrypting scene's incredible
Excellent course.
Dictionary vs classes. Classes give you error checking abolity before you populate it.
Code defensively so that the user cabt change the atrributes. Decorators define properties
Use class methods when you don't need to create objects of a class. You only use the class as a container for some functions and variables (no init).
you do not automatically inherit all of init. You must use super().__init(name)__. Thus the init method of the subclass calls the init methods of the super class
Exception classes are hierarchical in nature. This is why you can you "with Excception" to capture almost all exceptions
Sorry for writing so many comments it's bc i get excited, which is really rare when it comes to educational videos/classes
Glad to see someone as excited as me 😊
Think positively
I'd love Java classes taught by David
really really good course
So... Is David Bombal speaking at minute 2:47:53 ? :)
I took CS50X already, but I still found this lecture 8 is hard to understand for me 😭
Thank you Prof Malan❤
*Massively helpful👌*
Excellent Video Sir ..💜
Not even once did Harry get into Slytherin while using random.choice(). Magic indeed
David Malan is as awesome as always.
2:12:31 to 2:13:22 David always crack me up at this part
One question still remains: why light mode?
So that we can see clearly
This guy is amazing ❤