What is a Class vs What is an Object in Programming?

  Рет қаралды 95,738

iAmDev

iAmDev

Күн бұрын

Пікірлер
@Stevethesearcher
@Stevethesearcher 6 жыл бұрын
This was very well explained. Thank you for posting this. You could not have been any more clearer. A lot of people involved in computer programming are terrible at explaining things to beginners. They could make making a cup of tea sound complicated!
@IAmDevtube
@IAmDevtube 6 жыл бұрын
Glad it helped you!
@Stratus41298
@Stratus41298 6 жыл бұрын
Seriously though. You hit the nail on the head. It's like being back in high school math class: "1+1 = 2", "but, why?", "BECAUSE IT DOES. MOVING ON."
@itamar_da_god5651
@itamar_da_god5651 4 жыл бұрын
Boi that's what you learned in high school math class? jk lol
@dilsandhutalks
@dilsandhutalks Жыл бұрын
​@@IAmDevtubeLP LLP LPllppll
@shawndeprey
@shawndeprey 5 жыл бұрын
This is one of the more difficult concepts to teach to new programmers. This is a fantastic explanation. Well done.
@cristianjuarez1086
@cristianjuarez1086 2 жыл бұрын
is it appropiate terminology if i say "an object is an instance of a class"?
@jont7331
@jont7331 4 жыл бұрын
I dont know what it is about these videos, maybe it's the crappy drawings, or the way he explains stuff, but I feel like i've learned more in the past 3 hours than I have in the past year trying to learn programming. Thanks! Honestly man, you should monetize these videos. I'd be happy to watch a video and put some money in your pocket. Don't up the production quality at all, keep the videos coming just like this, because I tell you what, IT WORKS!
@SubterraneanChick
@SubterraneanChick 6 жыл бұрын
Mind. Blown. Wow. This was so perfect. I am a visual learner with a low-level imaginative though process. While the drawings were pretty terrible, I was able to create my own mental variants in realtime based on listening comprehension. I've looked up so many articles and forum posts, yet felt I could not grasp the basic concept. I found them too wordy & the out-of-tune voice of the author over-complicated a simple, definituve concept. Your analogy was perfect: brief, evenand concise. Thank you. Adding this to my playlist.
@IAmDevtube
@IAmDevtube 6 жыл бұрын
best comment I've ever received! Yeah, I need to improve my drawing but I had the same issues as you when I started - why were basic explanations so hard to follow?
@FIDEL_CASHFLOW_
@FIDEL_CASHFLOW_ 7 жыл бұрын
Wow, thanks. Took my Intro to Programming professor 45 minutes to explain what an object and a class is, and I walked out of the lecture more confused than when I walked in. You took 4 minutes and explained it better. Why do teachers insist on making things complicated?
@IAmDevtube
@IAmDevtube 7 жыл бұрын
tell me about it! I guess they've got to fill up the time?
@FIDEL_CASHFLOW_
@FIDEL_CASHFLOW_ 7 жыл бұрын
I Am Dev I don't even think it's that. This professor has been in the computer world ever since COBOL was a thing. In my opinion these Concepts just comes so naturally to him and are so engrained that he can't articulate them to people that don't already know them. He reminds me of a Spanish tutor I had in college, he was a native Latin American from El Salvador. He was a terrible tutor because he couldn't tell me why certain things in Spanish went together the way they did because it was just natural to him and he couldn't articulate why.
@rwewrwew625
@rwewrwew625 4 жыл бұрын
You explain things using concepts people already understand, e.g., blueprints and objects therefrom. Good job. It would be easier to explain tax law in terms of bicycles, which sounds crazy, but people already understand bicycles, so they have a concept they understand that can be used as a basis to understand an unknown concept.
@IAmDevtube
@IAmDevtube 4 жыл бұрын
Weirdly I really like reading tax law!
@christophersparacino
@christophersparacino 2 жыл бұрын
dude.... I've been trying to understand this since summer of 2022 in my class of Python, i never understood this at all and only passed the class because the final was open book, thank you!!! it took a little elbow grease on my part and extra time to get it!
@IAmDevtube
@IAmDevtube 2 жыл бұрын
It's staggers me how people can do a whole CS degree and yet have nothing explained to them simply!
@xstranglerdoofus3724
@xstranglerdoofus3724 4 жыл бұрын
Really man awesome explanation....I have watched many coding videos but the way you explained it is something i will never forget my whole life. Hats off
@timbradshaw5481
@timbradshaw5481 2 жыл бұрын
Amazing and I love the humour. Thank you
@righteousdivine
@righteousdivine 2 жыл бұрын
I appreciate the simplicity of the explanation! KUDOS!!!
@nonameneeded405
@nonameneeded405 5 жыл бұрын
Thank you. The blueprint analogy was very helpful.
@vasantnilkund2095
@vasantnilkund2095 2 жыл бұрын
Brilliant explanation. So well explained. Literally struggled with this for years and have grasped it like never before.
@puppergump4117
@puppergump4117 3 жыл бұрын
I work with C so my understanding is that a class is just a struct that can use struct-specific functions? And an object is just an instance of that struct? So basically, would this: typedef struct{ int a, b, c;}num; void add(num* numbers) {numbers->c = numbers->a + numbers->b}; num numbers; numbers.a = 1; numbers.b = 2; add(numbers); Be the same as this? class num{ int a, b, c; function add(num){ num.c = num.a + num.b; } } num number; number.a = 1; number.b = 2; Just making sure I got this right.
@hafsabatool8895
@hafsabatool8895 3 жыл бұрын
I was just thinking about this question and just watched a bunch of videos in this concept but it remained vague to me but this video just cleared this concept . Thanks a Lot!
@cc_silverheart
@cc_silverheart 7 ай бұрын
Immensely helpful! I wish it was easier to find clear and concise stuff like this, rather than just tutorials that fly way over my level of understanding 😅
@grazianocooper2061
@grazianocooper2061 10 ай бұрын
OOP is not a filing system, and though explained better than many, I didn't see the benefit over defined fields in a random access file. The way to learn OPP is to see how it saves you hours of programming time to accomplish data processing goals. A side by side with the old way vs the new would be helpful.
@AmnaTahir-h4h
@AmnaTahir-h4h Жыл бұрын
SO GOOD OMG!!! I was reading and re-reading my textbook... until I found this. Thank you!
@IAmDevtube
@IAmDevtube 11 ай бұрын
Glad it helped!
@subeg
@subeg 3 жыл бұрын
So, class is a fill-up form and objects are the details filled by multiple individuals.
@manishsoni7689
@manishsoni7689 3 жыл бұрын
hey man.. you are highly under rated.. a big thumbs up from me
@shantanumanapure8171
@shantanumanapure8171 7 жыл бұрын
So can we say that...Instance of class is the copy of class containing the state of Attributes or variables...???
@Myself6M
@Myself6M 5 жыл бұрын
Good explanation! I think the word you are looking for is analogous!
@tonykt
@tonykt 2 жыл бұрын
definitely wouldn't want to go to war with one of your warships but the explanation was great! Thanks!
@willh69
@willh69 2 жыл бұрын
Thanks for making this video it helped me understand the distinction!!
@Xo1ot1
@Xo1ot1 2 жыл бұрын
The explanation you get when googling this on the wiki is ridiculous. This made it very clear and I don't find it to be confusing at all...
@frankie4378
@frankie4378 2 жыл бұрын
Would you define a GET request as an object? I'm just thinking since the server sill goes through a process where information about the client is taken.
@PauJuanes
@PauJuanes 5 жыл бұрын
So... in your analogy, that "fire" action by the end, would it be a method? (thanks for the video, well explained :)
@IAmDevtube
@IAmDevtube 5 жыл бұрын
yes, because it 'does something' as opposed to holding some data
@ZootyTooter
@ZootyTooter 2 жыл бұрын
This video defines the relationship between objects and classes and doesn't actually define them
@reyjeep
@reyjeep 2 жыл бұрын
When you add more code in the class does it update every object related?
@dampish8403
@dampish8403 3 жыл бұрын
so a class is bascially a storage for methods meant to be executed later?
@Pfungwa74
@Pfungwa74 3 жыл бұрын
Thank you so much for that crystal clear explanation. You are a life saver!
@phye5063
@phye5063 5 жыл бұрын
Thanks man, now it makes sense
@krissicarsonart
@krissicarsonart 7 жыл бұрын
The word you were looking for is analogous. Also, this video is great! Made perfect sense to me as a beginning programmer.
@SteveRayDarrell
@SteveRayDarrell Жыл бұрын
So a class is just a new type, and an object is a variable of that type?
@abdullahbasit869
@abdullahbasit869 2 жыл бұрын
Like the concept of teaching, a little bit of fun aspect is required in order to get attention of your students , well done sir.👍
@akinseindeakindele3451
@akinseindeakindele3451 2 жыл бұрын
Thanks alot. It greatly helped. Very great explanation.
@olaoluwaodeyemi4059
@olaoluwaodeyemi4059 Жыл бұрын
Thanks so much, simple and easily understandable
@olli5542
@olli5542 5 жыл бұрын
Thank you so much for this!
@GoldenToothBrush
@GoldenToothBrush 5 жыл бұрын
So in the example given with the employee data would it be correct to call the names and email addresses objects? And in the example with the ship that can fire a cannon would that be done with a function inside of the class? Thanks in advance.
@ustazsamba17
@ustazsamba17 7 жыл бұрын
thanks for helping me to understand. it helps a lot
@aznmaster3k
@aznmaster3k 5 жыл бұрын
Really easy to understand. Thanks!
@ercm2393
@ercm2393 5 жыл бұрын
Thank you for this explanation!!!! Sooo clear andto the point!!
@Fabricio700_0
@Fabricio700_0 2 жыл бұрын
thanks!
@manasgoyal9899
@manasgoyal9899 2 жыл бұрын
very well and easy explaination very greattttt!!!!!!!
@biokult7828
@biokult7828 7 жыл бұрын
Would it be a good to use a 3d printer as an analogy to say.... Give the 3d printer a blueprint (a class, in other words) and it will make an object (a 3d printout) of that blueprint/class ?
@biokult7828
@biokult7828 7 жыл бұрын
These types of videos are essential btw, at least for those few of us who actually like to understand exactly what is happening at each stage. I'm often given links to documentation, containing "explanations" like the following: Which seems to be gobbledygook.. "Any object can be tested for truth value, for use in an if or while condition or as operand of the Boolean operations below." I looked up all necessary definitions within programing terminology, for words new to me and then i, firstly, added them in to the statement (in parenthesis) below. Any object can be tested for truth value (i.e.. Is it true or false)... . For use in an if or while condition (to use the true or false test on an object, within a while condition)(condition meaning, is it true or false) or as operand (operand is an object to be manipulated) of the Boolean (Boolean being a true or false value) operations below. I then wrote that out in "logical" terms, to get the following sentence..... Any object can be tested for a true or false value, to test for a true or false value of an object within an if true or if false loop test (or a while true or while false loop test) or as an object of the true or false value operations below.... Which is gobbledygook.... Would it not be better to just say something like the following? Any object can be either true or false. Further to this, any object can essentially be overridden to be true or false when it is acted upon by an "if" or "while" loop, or a Boolean command. Examples of this in practice are given below..... Or.. Any object can be tested for truth value, to determine its state (kinda like on or off) when it is within an if statement or while loop (see if true, while false examples below). Boolean commands can also be used to put an object in to a state of either true or false (see examples below).... I really don't get this open to interpretation, illogical/unclear way of documenting things...
@IAmDevtube
@IAmDevtube 7 жыл бұрын
+bio kult yep that's a good analogy too
@CalmedByNature
@CalmedByNature 7 жыл бұрын
Thank you that was helpful!
@DeShoujo
@DeShoujo 6 жыл бұрын
omg i got it now thank you very much
@nothanniballecktor9633
@nothanniballecktor9633 7 жыл бұрын
The class contains variables to be filled by object data? The Name and Email address would be variables to be later defined, right?
@IAmDevtube
@IAmDevtube 7 жыл бұрын
The class is always a blueprint - it doesn't contain anything until you "create an object from it". Then you can have anything you like, including variables!
@YusufSherakhmatov
@YusufSherakhmatov Жыл бұрын
Thanks bro 🤝
@ndehstanley1572
@ndehstanley1572 6 жыл бұрын
Thank you very much. Very informative and simple to understand.
@jackbennett6164
@jackbennett6164 4 жыл бұрын
Very well explained! Really easy for me to get what exactly is going on. Loved the drawings ;)
@zeeshanadil5886
@zeeshanadil5886 5 жыл бұрын
Brother you have explained it the best way ❤
@redmatrix
@redmatrix 8 жыл бұрын
Question: Could one add code to a class after using that class to create an object? Or, could some code somewhere, modify a class in a way that all previous objects created, were created w/o that modification, and either: a) they exists as relics, or b) they get updated?
@IAmDevtube
@IAmDevtube 8 жыл бұрын
I think that's a bad way to do things - why not just modify the class before you release code? Or use inheritance?
@clever_developer
@clever_developer 3 жыл бұрын
thanks, best ever tutorial
@devinersoy
@devinersoy 6 жыл бұрын
Very nice explanation. Thanks man!
@devansh_m
@devansh_m 2 жыл бұрын
thankyou sooooo much i was very confused
@GodbornNoven
@GodbornNoven 2 жыл бұрын
the reason its confusing is because every one sucks at explaining it. Basically, classes contain instructions on how to do something, so objects are anything that uses the instructions present within classes.
@IAmDevtube
@IAmDevtube 2 жыл бұрын
Not totally true. You have to include an explanation of objects created from the blueprint of classes
@danielw9542
@danielw9542 6 жыл бұрын
If you had an object made from a class and then edited the class (say adding a surname part to the employee data example) then do the current object inherit this edit or does it depend on the language you are using?
@IAmDevtube
@IAmDevtube 6 жыл бұрын
No, because the class you made would have already been compiled. Ie, changes you make can’t be reflected in an existing and already running program.
@danielw9542
@danielw9542 6 жыл бұрын
@@IAmDevtube ok. Thanks
@sherlockholmes68
@sherlockholmes68 7 жыл бұрын
You've earned a subscription.. GOOD JOB
@IAmDevtube
@IAmDevtube 7 жыл бұрын
thanks Grover!
@oleiversen8736
@oleiversen8736 5 жыл бұрын
I very much disagree with the other comments. This got me nowhere from where I was previously. Your complete lack of actual coding examples bewilders me. I just started learning how to code and what you just spent 4 and a half minutes talking about and attempting to draw is explained in every textbook out there on something like 4 lines. It would be very good if you could make actual code that uses this. The language wouldn't really matter, but for us to see HOW it is used.
@6StringrBrewer
@6StringrBrewer 8 жыл бұрын
I kept thinking you were saying 'washer' and couldn't figure out what th hell you were drawing. Maybe you had funky washers in England. Good tutorial.
@IAmDevtube
@IAmDevtube 8 жыл бұрын
Haha! Thanks!
@JoshZenpai
@JoshZenpai 6 жыл бұрын
Every time I would hear someone say objects i was always so confusing I think I understand what an object is now. It is so confussing because wtf is an object is could be anything I think an object is a bad naming to be honest.
@IAmDevtube
@IAmDevtube 6 жыл бұрын
I can’t think of a better word for it though. Once you know though, it’s pretty obvious!
@Muruga7552
@Muruga7552 4 жыл бұрын
sir please explain the class and object ?? in like a paragraph sir pleasee................. give paragraph definition for a class and object sir please
@rakeshgitm
@rakeshgitm 5 жыл бұрын
Thank you very much sir 🙂
@InterviewDOT
@InterviewDOT 5 жыл бұрын
Nice presentation :)
@sandeepvk
@sandeepvk 7 жыл бұрын
what about ennums ?
@108ahah
@108ahah 5 жыл бұрын
i like this way of teaching.
@djsorbie
@djsorbie 6 жыл бұрын
Perfect video, thanks
@ananicholemolijon7106
@ananicholemolijon7106 3 жыл бұрын
thank you!❤️
@megastreethitz1210
@megastreethitz1210 5 жыл бұрын
BIG THANK YOU!!
@passportbro904
@passportbro904 2 жыл бұрын
The "class" is like the parent having kids "the object " and giving them traits of the parent? 👀 lol I dunno im learning, oh and the class can have as many kids "objects "as she likes, they'll all inherit the same traits as her, and even there own traits.
@dowdyster1
@dowdyster1 6 жыл бұрын
Excellent! Thank you
@user-lb9ew4hr4z
@user-lb9ew4hr4z 6 жыл бұрын
its *analogous* ; nice video!
@MAJ741
@MAJ741 6 жыл бұрын
Thanks bro
@brendansullivan4872
@brendansullivan4872 4 жыл бұрын
Clear as day
@cristianmateus5223
@cristianmateus5223 7 жыл бұрын
Love you c:
@adityarohanik0
@adityarohanik0 6 жыл бұрын
Thank you!
@mohamedmire8646
@mohamedmire8646 4 жыл бұрын
Hays to you off sir. I lastly got it after so many vedios. Thanks endeed. You should all Subscribe to this channel.
@pritamsarkar3924
@pritamsarkar3924 5 жыл бұрын
Very nice
@GautamJr
@GautamJr 4 жыл бұрын
👌 class
@durrhurr55
@durrhurr55 6 жыл бұрын
So objects are values ?
@straight-up-shots
@straight-up-shots 4 жыл бұрын
No
@quantummassless
@quantummassless 6 жыл бұрын
Not "analogical." You mean't "analogous."
@thegreatestpotato6460
@thegreatestpotato6460 3 жыл бұрын
I feel patronized...how dare you human!
@honey5854
@honey5854 5 жыл бұрын
Yah thanks oh my God
@coquibunny8797
@coquibunny8797 2 жыл бұрын
👍👏🤟
@ms_1918
@ms_1918 5 жыл бұрын
1 like for the WARSHIP
@redmatrix
@redmatrix 8 жыл бұрын
Dude, you could slow down. This isn't a lesson on a napkin at Starbucks, where people only have 15 seconds per drawing. Go ahead and take an extra 20% of time and draw it better, we won't mind, promise.
@softwaredevelopment6564
@softwaredevelopment6564 8 жыл бұрын
If someone is taking the time out to explain something to you and free as well, you should be thankful rather than being sarcastic and an a*s
@IAmDevtube
@IAmDevtube 8 жыл бұрын
Problem is I cant draw...I can code a drawing though!
@IAmDevtube
@IAmDevtube 8 жыл бұрын
Thanks software development!
@dazza0987
@dazza0987 8 жыл бұрын
i really don't understand why you need good drawings to understand the instruction, its just a visual aid. i found this very helpful thanks!
What is inheritance in programming?
4:28
iAmDev
Рет қаралды 40 М.
Thank you mommy 😊💝 #shorts
0:24
5-Minute Crafts HOUSE
Рет қаралды 33 МЛН
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН
FP vs OOP | For Dummies
8:43
BasicOverflow
Рет қаралды 199 М.
The Ultimate Guide to Writing Classes in Python
25:39
ArjanCodes
Рет қаралды 124 М.
"Clean" Code, Horrible Performance
22:41
Molly Rocket
Рет қаралды 944 М.
the TRUTH about C++ (is it worth your time?)
3:17
Low Level
Рет қаралды 830 М.
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 997 М.
Learn Python Classes With a Text-Based Battle - OOP Tutorial
15:25
Ork Slayer Gamedev
Рет қаралды 162 М.
Functions vs Classes: When to Use Which and Why?
10:49
ArjanCodes
Рет қаралды 174 М.
you will never ask about pointers again after watching this video
8:03
The Absolute Best Intro to Monads For Software Engineers
15:12
Studying With Alex
Рет қаралды 681 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 913 М.