Buckys C++ Programming Tutorials - 12 - Introduction to Classes and Objects

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ต.ค. 2024
  • Source Code: github.com/the...
    Core Deployment Guide (AWS): docs.google.co...

ความคิดเห็น • 1.6K

  • @grahamcracker-inc
    @grahamcracker-inc 9 ปีที่แล้ว +1261

    "You guys have no idea how important the information you just learned was"
    **Restarts video**

    • @sanantonionolimitrcracing
      @sanantonionolimitrcracing 9 ปีที่แล้ว +15

      I did the same thing xD

    • @shutdahellup69420
      @shutdahellup69420 6 ปีที่แล้ว +20

      rofl no joke i laughed pretty hard at that😂😂😂

    • @echobravo5488
      @echobravo5488 6 ปีที่แล้ว +5

      Yeah, pretty well the essence of OOP...

    • @youknowwhatimdonewithyou424
      @youknowwhatimdonewithyou424 5 ปีที่แล้ว +2

      @@echobravo5488 i think the essence of OOP would be more visible if he used public variables in the class

    • @echobravo5488
      @echobravo5488 5 ปีที่แล้ว

      Accessor variables fulfill that function.

  • @Legendofmudkip
    @Legendofmudkip 8 ปีที่แล้ว +1289

    I just understood classes better in 8 minutes versus my one hour 45 minute lecture class

    • @darn514nothing5
      @darn514nothing5 8 ปีที่แล้ว +2

      +xdarkness22x yeah damn right..

    • @bostic8683
      @bostic8683 8 ปีที่แล้ว +4

      +xdarkness22x i learned it in 2 cause of2*speed

    • @bostic8683
      @bostic8683 8 ปีที่แล้ว +4

      +xdarkness22x i meant 4 min

    • @nefyt278
      @nefyt278 8 ปีที่แล้ว +4

      Its easier! here

    • @leavethematrix9939
      @leavethematrix9939 8 ปีที่แล้ว +4

      +xdarkness22x If you think you understand classes from this vid, then you don't understand classes. He did not explain them accurately.

  • @EpochIsEpic
    @EpochIsEpic 4 ปีที่แล้ว +457

    I love how a random dude that sounds 15 years old has created arguably the greatest intro level c++ course of all time. And it's free.

  • @yalebass
    @yalebass 4 ปีที่แล้ว +22

    Mentioning how the object is the “key” to the class functions was really helpful. Thanks for the concise video!

  • @bufferoverload4709
    @bufferoverload4709 9 ปีที่แล้ว +521

    It seems like some people (or just a couple), are getting a little confused about why you need to have an Object before and a Class. Maybe this explanation will help:
    To start off a Class is what makes up the Object, the class gives the Object it's functions and tells the Object what it can do. For example, if you were building a house lets say, the class would be the blue print to that house. It would say where all of the infrastructure would be, the water pipes, etc... However, you cannot live in a blueprint, and that blue print is not actually a house. The actually Object would be the house, and that house's physical appearance would be based on the blueprint (Class). So once again, for example, lets say I wanted to make a Dog object, and this Object would essentially draw a 2D image of a dog on the screen. You would first have to create a Class and in that Class is where you would specify things like how tall the dog would be, what colour certain parts of the dog are, where on the screen the dog is located. Then, the actual process of making an Object would allow my dog Object to be created, and allow me to have a picture of a dog on my screen.
    So, one might still be asking, "Okay, but why did the people at Microsoft still make us create an Object? Why can't C++ just look at the class we made and think 'Well, that person made a class, so he obviously wants to use it as an Object, so I'll just create it into an Object' ". Here's the thing, the reason why you go about and type what you want to call you're object (The variable name of you're object), is because if you created more than 1 Object from the same class, you could differentiate between one or another. Imagine if I wanted to make 2 dogs appear on the screen, so I try using the Dog Object (as mentioned before) twice. And lets also assume that C++ will simply just make the class into an Object so we can just type out Dog.drawOnScreen, or something of the sort if you wanted to draw a dog on the screen. Well, here's the thing, you would essentially end up drawing those two dogs you wanted, on the exact same location of the screen. You probably couldn't make them different colours, couldn't give them each a different hight, so essentially, it would look like you just had one dog on the screen because they are virtually identical and are over lapping each other. Now, lets say that instead, we had to create our own Objects, so something like: Dog dogFred; and Dog dogAl (I'm creating 2 Dog Objects. One is called dogFred, the other dogAl (These are just some dog names)). Now, lets say that you wanted to call a function from one of the Dog Objects that would change its location to the upper-lefthand corner of the screen (In this case, dogAl). You could type dogAl.move(topLeftOfScreen) (Or something along those lines). In the past, if you tried to move you're second Dog Object, it would essentially affect both Object's location, but now, only the dogAl Object will move relocated and dogFred will stay put. Now imagine if you wanted 10 Dog Objects, you can now control each individuals location, colour, height, maybe even breed if you wanted to incorporate that.
    I hope that this was of some help, if any questions still arise, feel free to ask. If anyone else has any other good explanations, I'd love to hear them as well and I imagine the same for those learning.

    • @UjjwalKumarJha-raymando
      @UjjwalKumarJha-raymando 9 ปีที่แล้ว +14

      BufferOverload Thanks bruh. That DogFred and DogAl thing made the point way damn clear. Cheers mate.

    • @bufferoverload4709
      @bufferoverload4709 9 ปีที่แล้ว +3

      Ujjwal Kumar Jha No worries! I almost completely forgot about this post until you replied and it showed up in my alerts. Glad to have helped!

    • @ZoxxMedia
      @ZoxxMedia 9 ปีที่แล้ว

      tnx

    • @MrRappinelvis
      @MrRappinelvis 8 ปีที่แล้ว +4

      +BufferOverload Thanks for the post!! Just one thing...I have a javascript background and there are no classes in JS. Say I wanted to create two dogs like in your example- in JS I would create an object Dog, then create 2 instances of that object- dogAl and dogFred and I could use them individually. Comparing the 2, creating the object in JS is the same thing as creating the class in c++, and creating an instance of the object in JS is the same as reating the object itself in c++. Am I right or am I still confised about something??
      Any help would be very greatly appreciated!!

    • @justinek9461
      @justinek9461 8 ปีที่แล้ว +7

      +BufferOverload I feel as if you've read my mind and answered all my questions.

  • @abhipriyburman3909
    @abhipriyburman3909 8 ปีที่แล้ว +181

    DUDE !!!!! you are just awesome !
    you are too good ! seriously.
    your explanations are just so good and actually understandable that it just made c++ a lot easier for me ! cheers!

    • @MiikeLefebvre
      @MiikeLefebvre 8 ปีที่แล้ว +5

      yeah man, i totally agree, ive been using bucky's tutorials for about 2 years now. Its always a great refresher watching a couple of his vids.

    • @davidsvendsen4067
      @davidsvendsen4067 8 ปีที่แล้ว +17

      pretty cool huh?

    • @cabreram.4734
      @cabreram.4734 5 ปีที่แล้ว +1

      Yes, he's amazing, the utter best of the best!

  • @sbk1398
    @sbk1398 9 ปีที่แล้ว +743

    "Bam, wam, thank you ma'am" lolz

    • @willmaze4341
      @willmaze4341 9 ปีที่แล้ว +23

      Samuel Kajah put this crap in heor to access the crap meor...seems legit

    • @vipulmahawar
      @vipulmahawar 6 ปีที่แล้ว +19

      I am sure if Bucky didn't chose to be a programmer he would definitely be a comedian.

    • @bng4516
      @bng4516 6 ปีที่แล้ว

      Samuel Kajah nope

    • @Trueentertainer
      @Trueentertainer 5 ปีที่แล้ว +2

      @Snapchat Entertainment int main()
      {
      int a, b, c, d, e;
      int total;
      int average;
      cout a;
      cout b;
      cout c;
      cout d;
      cout e;
      total = a + b + c + d + e;
      average = total / 5;
      cout

    • @gloriousmoepya
      @gloriousmoepya 5 ปีที่แล้ว +3

      I was looking for this comment :p

  • @mrginn
    @mrginn 7 ปีที่แล้ว +1

    The man. The myth. The legend. Bucky.
    I always come back here for your tutorials. Simple and comprehensive.
    So much better than 3 hr long school lectures

  • @alecsymmonds959
    @alecsymmonds959 2 ปีที่แล้ว +3

    I've been following you since the early days when I was learning C. Now I'm in college and have a project to complete in c++. Once again, your tutorials are simple and to the point. I completely understand c++ classes in under 8 minutes. Shoutout to you Bucky!!

  • @lewisb8634
    @lewisb8634 9 ปีที่แล้ว +190

    "If my teacher asks you..." You are my teacher bucky! :P

    • @maximalgamingnl9954
      @maximalgamingnl9954 7 ปีที่แล้ว +4

      Lewis B hes trying to preparing you for HIS test

  • @powerfoolgame
    @powerfoolgame 10 ปีที่แล้ว +91

    I'm studying my first year of Games Programming at University and these tutorials are a damn lifesaver!

    • @Tomas69
      @Tomas69 9 ปีที่แล้ว +2

      8 months later.
      how's the studying going? you having fun?

    • @EXAKTHD1337
      @EXAKTHD1337 7 ปีที่แล้ว +3

      2years later hows the studying going?

    • @kayleeurwin9762
      @kayleeurwin9762 7 ปีที่แล้ว +20

      (This is Powerfool on an alternate account). Atually pretty good.. I have a first class honours degree in C++ Games programming now and I'm studying a masters in it which I've almost finished :p

    • @kassim6154
      @kassim6154 7 ปีที่แล้ว

      4 months later how's masters going? you having fun?

    • @SeyfatTheBoss
      @SeyfatTheBoss 7 ปีที่แล้ว +14

      Powerfool 3 years later , did u drop out yet?

  • @1996adis
    @1996adis 6 ปีที่แล้ว +1

    The first time I watched this video was during my first semester at university. I was taking an "Introduction to C++" course back then and I was regretting not working at McDonald's. It was difficult for me and I didnt get it. Now that I'm coming back to this nearly 2 years later it's just so easy and logical. If anyone's struggling with the language know it's shitty in the beginning but once you start to see how things work you'll come back to this and laugh at your past self. Just keep at it! :)

  • @surajanitha
    @surajanitha 11 ปีที่แล้ว +16

    Woah, that escalated quickly!!! But still, a very well done tutorial.
    My only suggestion would be that, after every tutorial, you could give us one or two exercises or programmes to do based on what you taught us in that part. That would be a lot more effective rather than just flipping through videos.

  • @mohammadais8191
    @mohammadais8191 4 ปีที่แล้ว +2

    It has been a decade and still these are the best tutorials on the whole internet

  • @mikehoward4856
    @mikehoward4856 9 ปีที่แล้ว +5

    Hi, @thenewboston , you just saved my programming career. I was stuck trying to understand classes and objects for a month. I was almost giving up until i accidentally ran into your course on c++. This is the best explanation of classes and objects ever!!!!!!!!!!!!! So simple and straight to the point. I think the number one reason people fail in programming is the absence of quality, simple to understand materials. Once again, thanks for this. You should write a book on c++. I would buy it. And i'd like to leave by saying ""Bam, wam, thank you ma'am" lolz

    • @wthrajat
      @wthrajat 2 ปีที่แล้ว +1

      how's life now sir?

    • @hameedahmadzai9768
      @hameedahmadzai9768 11 หลายเดือนก่อน

      where are you right now

  • @Immadeus
    @Immadeus ปีที่แล้ว +1

    This 8 and half minute TH-cam video just explained this concept better than a 90 minute class lecture, thank you Bucky

  • @KingGlove
    @KingGlove 12 ปีที่แล้ว +5

    Bucky has literally made a long, and boring process of learning into something fun. Learning requires a bit of flavor in order to actually learn, not some boring lecture for 2 hours+ on everything. I learned in 10 minutes what could have taken me weeks, Bucky saves time, lives, and money. +1 subscription :) Keep doing yo thing bro.

  • @BittiKit
    @BittiKit 6 ปีที่แล้ว +1

    I'm a junior in college now, and I've been watching your videos since freshman year for guidance and help. Your videos always crack me up at least once, and I love that. I learn because you're very clear in what you teach, and you also do it in a fun way. Thanks for all the helpful videos, Bucky! I appreciate it and have for the past three years :).

  • @abugslife2461
    @abugslife2461 5 ปีที่แล้ว +28

    Bucky: "Bam, Wham, Thank you Ma'am"
    Me: No, thank YOU!!! savin my life rn :))) blessed

  • @yaochen5058
    @yaochen5058 4 ปีที่แล้ว

    I always afraid to learn how to programming. My coworker gave this link to me. I am on the tutorial 12. these tutorials helped me to understand the C++ well without confusion . All you need is to follow the steps. Thank you so much to have these awesome tutorials. Bucky!

  • @MisterEnacy
    @MisterEnacy 4 ปีที่แล้ว +27

    "bam
    wam
    thank you maam
    we now have a full working program"
    damn i ain't know bucky had bars too

  • @GoldLegend
    @GoldLegend 10 ปีที่แล้ว +2

    Hey man I don't know if you will see this but I am truly thankful for these videos. I took my first computer science class last semester and did well up until we got to the "class" section. This video made the concept of a class so understandable in 8 minutes. Really, thanks.

  • @JackDaniels-sf6hs
    @JackDaniels-sf6hs 10 ปีที่แล้ว +25

    Forget what you know about java. LOL classes are super important. If you make a video game, you're gonna have a MonsterClass, CharacterClass, MapClass, SoundClass. This will enable you to quickly development any type of problem you want to make through Object Oriented Programming.

    • @BingtheLizard
      @BingtheLizard 10 ปีที่แล้ว +4

      Forget what you know about Java?
      Right, like the fact that Java is an OOP language, and uses classes and a syntax very much like C++.
      Doi.

    • @JackDaniels-sf6hs
      @JackDaniels-sf6hs 10 ปีที่แล้ว

      You are wrong and right. The syntax is completely different and the logic is basically the same except c is more extensive. Java is easier to use and it has built in features c++ does not. This means you have to provide extra logic in order to do the same things java does. Java is much easier than C++ in my opinion. When you get into inheritence and composition you will understand.

    • @BingtheLizard
      @BingtheLizard 10 ปีที่แล้ว

      I've done a fair bit of Java, but am really only embarking on C++. I'm aware of a number of fundamental differences, such as C++ allowing for multiple inheritance, pointers, no GC, etc. I do have an understanding of basic OOP concepts, hence, the reason I couldn't agree with your "forget what you know about Java" comment.

    • @JackDaniels-sf6hs
      @JackDaniels-sf6hs 10 ปีที่แล้ว +1

      You're talking about two way different things. Both use OOP, yes. You can compare a dog to a cat, but a cat is still not a dog. You'll confuse yourself, that's why you need learn C++ and stop trying to compare it to java, because that will make things harder for you. Of course do what you want, I don't really care.

    • @Auschwinz
      @Auschwinz 10 ปีที่แล้ว

      Jack Daniels Can you guys link me some stuff so I can understand what you're talking about better? It sounds like something I should know if I want to be a better programmer.

  • @Qwyst
    @Qwyst 11 ปีที่แล้ว +1

    These videos accelerate my learning at a level at least ten times faster than any book I've read or other tutorial I've watched. Keep up the good work, Bucky!

    • @addy7464
      @addy7464 3 ปีที่แล้ว

      Oldest comment i have seen on a video.

  • @zeustheboerboel3794
    @zeustheboerboel3794 8 ปีที่แล้ว +177

    bam wham, thank you mam!

  • @Intriguing444
    @Intriguing444 5 ปีที่แล้ว +2

    Dude I just wasted time watching a 40 min tutorial in my native language made by a guy with a sleepy voice, didn't get a thing. Your tutorial was simple, short and on point, I understood everything. Great job!

  • @zzHackedTutorialzz
    @zzHackedTutorialzz 9 ปีที่แล้ว +3

    What's the difference between a class and a namespace? Seems like they have a very similar function but namespaces are a lot less of a hassle. You could do this:
    namespace BuckysClass
    {
    void cooldSaying()
    {
    cout

    •  9 ปีที่แล้ว +3

      +Hacked Tutorials namespaces are also used as replacement of calling the class something came from.
      Like with:
      #include //standard io lib, iostream.h
      using namespace std;
      int main()
      {
      cout

    •  9 ปีที่แล้ว

      ***** dude, read my comment.. That's exactly what I said.. It is just replacing the std::

    •  9 ปีที่แล้ว

      Yeah, he's an idiot anyway.. He just repeated what I just said.. It replaces the std:: thingy or when using another namespace, ::

    • @DJSugarBoy1993
      @DJSugarBoy1993 8 ปีที่แล้ว

      +Gorzoid damn did kens comment get deleted ? i wanna see it !

    • @scottjennings2165
      @scottjennings2165 8 ปีที่แล้ว +1

      +Hacked Tutorials
      classes work fairly different than namespace. Classes allow you to create multiple objects, making the code very reusable and become extremely important when diving into more advanced OOP techniques like polymorphism. this is best explained with a simple example:
      //define the class
      class Student {
      //class constructor used to initialize object when called
      Student(std::string name, float gpa);
      //simple function to print student name
      void printName();
      private:
      std::string _name;
      float _gpa;
      };
      //define class functions
      Student::Student(std::string name, float gpa) {
      _name = name;
      _gpa = gpa;
      }
      void Student::printName() {
      printf("Student Name: %s", _name.c_str());
      }
      int main() {
      //here we will reuse class to create multiple objects
      Student student1("Jerry Garcia", 4.0f);
      //create second student
      Student student2("Sterling Archer", 3.2f);
      //here we call printName with both objects this well yield different results
      student1.printName();
      student2.printName();
      return 0;
      }
      student1.printName() will print "Jerry Garcia&"
      student2.printName() will print "Sterling Archer"
      as you can see by making student a Class we can create multiple and distinct instances of that class making some very reusable and readable code. very different from namespace!
      imagine i had 1000000 students all with different names and values.. classes make it easy to store that data into a vector and call specific objects (with their own values) any time i need it :
      ( std::vector students. student.push_back(Student("Jimmy Page", 3.4)); students[1].printName();)
      Hope this helped!

  • @GPTDavid
    @GPTDavid 7 ปีที่แล้ว

    The skill you posses to be able to make my brain understand this in just 8.25min is a divine gift!

  • @omegaindustry
    @omegaindustry 12 ปีที่แล้ว +16

    Bucky: "if your teacher ever asks you"
    Me: "you are my teacher o.0"

  • @rockoeasy9150
    @rockoeasy9150 9 ปีที่แล้ว

    Thanks Bucky, you have presented the information in an clear and concise manner to understand. It's a joy to listen to someone teach with excitement. You keep on leaving me wanting to learn more.

  • @GjerdanPeterson
    @GjerdanPeterson 10 ปีที่แล้ว +39

    BAM! WAM! THANK YOU MAM!! that's all i have to say ladies and gentleman

    • @teaMmMate
      @teaMmMate 9 ปีที่แล้ว +1

      Oh hey jinx, i didnt see you there

    • @GjerdanPeterson
      @GjerdanPeterson 9 ปีที่แล้ว +2

      Kamina
      ye i started coding after they nerfed me .

    • @geico105
      @geico105 7 ปีที่แล้ว

      Your username is so me.

  • @diggah
    @diggah 7 ปีที่แล้ว

    Thanks very much. A far far clearer way of explaining this than the last 2 hours of tutorials I've been following.

  • @thereyougoson
    @thereyougoson 6 ปีที่แล้ว +131

    *WHO IS HERE FOR FINALS*

  • @bredmond812
    @bredmond812 5 ปีที่แล้ว +1

    This is the second or third time i have watched this series. I get more each time i go through. Yay, Bucky.

  • @csandreas1
    @csandreas1 9 ปีที่แล้ว +14

    every single programmer on earth should know at least the basics of classes and objects they are really useful

  • @aiidub
    @aiidub 7 ปีที่แล้ว

    Watching your videos happens to be the sole reason that I am able to keep up with my coding class in college. I cannot completely describe how happy this series makes me. It's really easy to use as a supplement to the book we use in our class. Thank you so much for submitting these. You really are a stand up guy and the commentary is hilarious!

  • @adityabarve3722
    @adityabarve3722 8 ปีที่แล้ว +20

    Pretty cool huh !!

  • @reflectiveradiosity6664
    @reflectiveradiosity6664 8 ปีที่แล้ว

    This is my First Language I'm learning by myself. I thank you Bucky for explaining all this in such a Simple & Easy way to understand.

  • @Srky6P
    @Srky6P 10 ปีที่แล้ว +33

    Do his tutorials cover the whole C++? And if so how much of it, is it some deeper knowledge about C++ or just scratching the surface? Will it be enough to make smaller games after all 73 videos?

    • @Hopsonn
      @Hopsonn 7 ปีที่แล้ว +16

      Fuck no.

    • @jrod1144
      @jrod1144 7 ปีที่แล้ว +1

      Hi Matt, I love your videos

    • @abhinavshukla3295
      @abhinavshukla3295 7 ปีที่แล้ว

      Yes sort of. You'll know all the basics and can implant all of that info to create a game. But what do you mean by "smaller games"? I wouldn't recommend making games in cpp. Try using java for that.

    • @aasaaaaabsa3996
      @aasaaaaabsa3996 6 ปีที่แล้ว +2

      Not recommending to make games in C++ is stupid. What does C++ does better than any other language? GAMES ! Yes, the code is going to be hard to organize but how you plan on even being accepted as a game developer ? You need C++ video games development experience on your own. Around 4 years of game development in C++. Not 4 years of C++ of a random projects that has nothing to do with it and 4 years of Java..just no..

  • @juancarlosperez4222
    @juancarlosperez4222 7 ปีที่แล้ว

    Thank you, your explanation is so clear and simple that I finally understood something no one could explain me before to understand. Since last Saturday I am finally moving from VB6 to C++.

  • @rjjarecki
    @rjjarecki 9 ปีที่แล้ว +46

    In this example, @ 6:40 I don't understand the NEED for an object. Why not BuckysClass.coolSaying(); it seems like an unneeded step.
    Update: I'm asking about the design of the language, not how to use it.

    • @SeRbianPlayingGames
      @SeRbianPlayingGames 9 ปีที่แล้ว +54

      You cant open a locked door with your hand only. You need a key. Understand it like that :D That object is basically a key between your hand and the door. Without it, you just couldn't open the door.

    • @Hugo-pj4bm
      @Hugo-pj4bm 9 ปีที่แล้ว

      SeRPG thx I had the same problem.. not anymore ;P

    • @ThePositiev3x
      @ThePositiev3x 9 ปีที่แล้ว +8

      I was thinking just like you. Soulmate?

    • @aleksaurosevic7305
      @aleksaurosevic7305 9 ปีที่แล้ว

      We will probably understand it later :)

    • @mysterios29
      @mysterios29 9 ปีที่แล้ว +4

      big programme there are many classes, and each classes has same function, then there are objects too, for specific function we need to use specific object.

  • @ahmedifhaam7266
    @ahmedifhaam7266 3 ปีที่แล้ว +1

    No one is gonna read this, but.. I just want to point out that, last time I watched this video, was a decade ago, was in secondary school, excited about programming, for the most part of the next decade I was still passionate but went through so much, Today, I am going to be afresh graduate and creating my first games, Data models, Scripts etc still using the basics I learnt from this video, exactly a decade ago. Thank you Bucky, idk why but I really miss the good old days, Pre 2010-.

    • @dopesrk.368
      @dopesrk.368 3 ปีที่แล้ว +1

      I read you 👍 Do your besttttt!!

    • @ahmedifhaam7266
      @ahmedifhaam7266 3 ปีที่แล้ว

      @@dopesrk.368 Thanks mate ! I Appreciate the words ;) ;)

  • @Lone_Rocket
    @Lone_Rocket 8 ปีที่แล้ว +5

    Bucky you said episode one was going to be the hardest.

    • @Lone_Rocket
      @Lone_Rocket 8 ปีที่แล้ว

      ***** True very true.

    • @khaledel-zayat8277
      @khaledel-zayat8277 8 ปีที่แล้ว

      +T_alsomeGames If he told you the first episode was the easiest, you wouldn't be motivated :P

    • @Lone_Rocket
      @Lone_Rocket 8 ปีที่แล้ว

      Khaled EL-Zayat fair enough.

  • @thestarinthesky_
    @thestarinthesky_ 4 ปีที่แล้ว +2

    It is 2020 and you are by far the best and still amazing. I wish you could come back and could start making this channel alive again!

  • @ahmedbinhamad5407
    @ahmedbinhamad5407 8 ปีที่แล้ว +16

    I learn noting from my 2 hours lecture vs I learned everything in your 8 min Video , it's really unfair world , you should be teaching in colleges and they should pay you 4 times the regular salary

  • @tannerbarcelos6880
    @tannerbarcelos6880 5 ปีที่แล้ว

    This is so simple. Like, after watching a few times you finally understand the purpose and how to use this. This organizes your programs and makes them look way more professional for sure. I’m in my advanced intro to Comp sci class rn at my university and it’s in C++, I gotta say, knowing python, c++ has been an adjustment just for the fact that memory allocation and handling etc. is way more tedious but this is real programming for sure. It’s started to all really click for sure. I can’t wait to get to this chapter in the book so I can master this!

  • @SgMechanic
    @SgMechanic 8 ปีที่แล้ว +5

    Very good work, BUT I think that with classes and objects you must better use real examples to make the tutorials more understanding. With words like coolSayings, ect the tutorial can be confusing for some people... :)

  • @oldman713
    @oldman713 7 ปีที่แล้ว

    Your tutorials are lit. Something that i couldnt understand even after attending classes for an entire school year, i am getting everything now by watching this just once !

  • @grapegripe
    @grapegripe 9 ปีที่แล้ว +20

    This explanation completely misses the core reasoning behind classes and Object Orientated Programming. As confused commenters rightly ask, if classes just bunch together functions, why the hell would we bother using them? Why would we want the added annoyance of having to access functions through objects? But objects are way more useful than this explanation suggests. Far from the object being an annoying middle man, the object is the core of the entire class system: the functions in classes define what we can do to and with objects. For instance, suppose we were playing a video game. Then each player in the game might be represented as an object of type Player - that is, an instantiation of the Player class. As well as telling us everything about Players (such as their health, attack, equipment, and so on), the Player class tells us everything that Player objects can do and have done to them, for instance, there might be a Player.setHealth() function that allows us to change a particular player's health. Then we'd be able to say bob.setHealth(100) to set Bob's health to 100. Now that is a brilliantly simple and useful way of keeping track of each player, their attributes, and the things they can do and have done to them. Of course, that's just one illustration, and I recommend people look elsewhere for more explanation!

    • @wmacky
      @wmacky 9 ปีที่แล้ว +4

      Matthew Bird This! As a newbie I think the issue is the explanation in the video is way to simplistic, and caused me confusion. As described in the video, a Class appears nothing more than a folder full of functions. Therefore it is unclear as to why an "Object" is needed as a pointer when the class could be addressed directly. So far all the videos are great, but I think this one may need to be redone with a better example?

    • @rngnodal9316
      @rngnodal9316 4 ปีที่แล้ว

      wmacky I think it makes it easier and neater then declaring the names initially in the class. You can just change the object’s name without going into the class and changing it. I don’t know, I am a newbie :P

  • @oladehindebello7368
    @oladehindebello7368 11 ปีที่แล้ว

    I now understand my classes and objects better----for my past one and a half year in college.its great to watch this video..thanx thanx.

  • @infinitebuckets3147
    @infinitebuckets3147 10 ปีที่แล้ว +11

    I don't get it... If you have classOne, classTwo and a function called potato in each one then why can't you just write classOne.potato or classTwo.potato? Isn't the need for an object kind of redundant?

    • @psychotheo
      @psychotheo 10 ปีที่แล้ว +1

      Adam Rose me too

    • @infinitebuckets3147
      @infinitebuckets3147 10 ปีที่แล้ว

      I understand how it works. But it seems redundant.

    • @JrIcify
      @JrIcify 10 ปีที่แล้ว +2

      It feels like walking up to an open door, closing it, and then instantly opening it back up and walking through. Does anyone have examples of times when the real way is a better choice than the noob fantasy way?

    • @cyberchef8344
      @cyberchef8344 10 ปีที่แล้ว

      I have plenty of examples from Java, but i don't feel like typing them all. Just trust me, it's not redundant and it's necessary. You will see why later.

    • @JrIcify
      @JrIcify 10 ปีที่แล้ว

      Tyler Greer You don't need to type them all, just one.

  • @antertoby5406
    @antertoby5406 2 ปีที่แล้ว

    I love the short summary repeating everything that you would have taught, it makes me understand more...thanks Bucky

  • @KushChoudhary
    @KushChoudhary 7 ปีที่แล้ว +20

    who else in 2017?

    • @arandomdude1741
      @arandomdude1741 6 ปีที่แล้ว +1

      I am in 2018 (4 days left). HAPPY NEW YEAR + MERRY CHRISTMAS!

  • @Azulanosekai101
    @Azulanosekai101 5 ปีที่แล้ว

    This was in no way confusing! That is the most straight forward information I’ve received in years ! Thank you sir.

  • @YashDeshmukh
    @YashDeshmukh 6 ปีที่แล้ว +6

    2018 anyone?

  • @frumpypoptart6709
    @frumpypoptart6709 8 ปีที่แล้ว

    seriously, every single tutorial you make I understand it right away! I tried three sources to teach myself functions, didn't get it at all, then you explain it and I feel instantly stupid for not getting it.. It's just that so many people think they are teaching a beginner but they are using "programming lingo" left and right, and leaving out way too many details..

  • @BenjiShock
    @BenjiShock 8 ปีที่แล้ว +4

    So from my perspective I would ask myself:
    As the creator of C++ why wouldnt you just have to use it like this:
    BuckysClass.coolSaying();
    What is the reason to use the class through an object instead of using it directly?
    I mean you dont influence the class when you use it so why would you have to create a different medium for it?

    • @inanahsans6636
      @inanahsans6636 8 ปีที่แล้ว

      also wanted to know......following for answers

    • @justinpenny8172
      @justinpenny8172 8 ปีที่แล้ว +10

      It's better to think of a class as a data type. You are probably familiar with int and char, correct? The compiler will treat classes much the same way it treats those data types.
      For example: Let's say you want to use an int. First thing you would do is declare something as an int.
      int x ;
      The same thing goes for BuckysClass buckysObject.
      Just like you could have , int x, and int y, both of which are values of type int you could have
      BuckysClass firstObject;
      BuckysClass secondObject;
      Both are of type BuckysClass (meaning they are full of the same functions) , however you can fill the functions of firstObject and secondObject with different data.
      Once you see how classes are used on a larger scale this will all start to make more sense.
      Hope this helps!

    • @inanahsans6636
      @inanahsans6636 8 ปีที่แล้ว

      +justin penny 👍

    • @BenjiShock
      @BenjiShock 8 ปีที่แล้ว +1

      justin penny Yeah thanks mate.
      I kind of can make a lot more sense of it now.
      Its when you have to use that function very often in different occasions. I think if I rewatch the video one more time I'll be fine and I don't think I can understand everything immediatly because sometimes theres additional knowledge needed.

    • @Erick-wj4vq
      @Erick-wj4vq 8 ปีที่แล้ว +1

      "I mean you dont influence the class when you use it so why would you have to create a different medium for it?"
      I only saw the video up to the point of the void coolSaying(). But in that instance, it would just be for organization.
      Other times (I'd say most of the time in more complex programs) classes are used to create Objects so the dev doesn't have to rewrite code because they can use a class as a template of what they will be using it for.
      For example, I want to create a monster, by doing that, I create the Monster class.
      class Monster
      {
      private:
      int health;
      int armor;
      public:
      void setHealthPoints(int points)
      {
      health = points;
      }
      void setArmorPoints(int points)
      {
      armor = points;
      }
      }
      I include the variables such as health and armor inside that Monster class. Now that I have that set up, I can now create multiple monsters with different stats by creating different Objects from that Monster class (there is a better way of doing this but that's more advanced, eg Inheritance and also constructors). It would be like this
      Pseudocode (Not sure if its the right way of calling the object, I forgot atm)
      Monster monster1 = new Monster();
      Monster monster2 = new Monster();
      I can now have monster1 have 10 health points and monster2 have 5 health points by doing this:
      monster1.setHealthPoints(10);
      monster2.setHealthPoints(5);
      Now, both monsters have different health pools but they both come from the same class. They are just different objects.
      I didn't have to create two classes for two monsters, I just had to create objects which both use Monster class to save me some time and all I had to do was define what health each monster had.
      Hopefully, this is a decent explanation, the code probably isn't 100% c++ but as long as you understand the concept of what classes and objects are, you won't be so confused anymore.

  • @jadiskidimbu
    @jadiskidimbu 6 ปีที่แล้ว

    I've learned C++ at my university and one thing I realized is that the best way to learn programming is to pace yourself. Be comfortable on your own pace and practice and practice. The reason I say this is because in school you are under pressure and during an exam, it is a different story. But learning programming on your own pace is very productive. I had difficulties to learn classes but video like this one helped me a lot. Programming comes slowly and naturally when you keep practicing. Thanks for the video.

  • @AndyU96
    @AndyU96 8 ปีที่แล้ว +3

    But still, why even make an object? Just mention the class that you want to call your function from, and you should be done... I mean, could they not have come up with a way that let's you just mention the class and the function you want to call from that class?

    • @nextlevel7790
      @nextlevel7790 8 ปีที่แล้ว +1

      I had the same exact doubt . !

  • @rovierajumunaparsad3121
    @rovierajumunaparsad3121 3 ปีที่แล้ว +2

    I have an examination on Friday and this was the best explanation of all time 😭😍

  • @jordancrocker9015
    @jordancrocker9015 10 ปีที่แล้ว +7

    void coolSaying(){
    cout

  • @parzingtheasian
    @parzingtheasian 6 ปีที่แล้ว

    I just spent an hour watching this video over and over again instead of listening to the class i was in XD
    Learned the material a lot better then the lecture could of

  • @3ksal
    @3ksal 8 ปีที่แล้ว +6

    Why can`t directly use
    BuckysClass.coolSaying();
    Why we must have a new object name?
    Thank you for your hard work, this is a really good class, I learnt a lot from your classes.

    • @derpthehuman417
      @derpthehuman417 8 ปีที่แล้ว +1

      +colorpanda I think you will see in part 13

    • @holongwong6479
      @holongwong6479 8 ปีที่แล้ว +15

      +colorpanda class likes variable type. Object is a variable of class. Just like
      You cannot type
      int = 7;
      you need to type
      int i = 7;
      what you should do is
      (variable type) (variable name) ;
      (class) (object)

    • @3ksal
      @3ksal 8 ปีที่แล้ว +2

      Thank you very much!

    • @AmarCollection
      @AmarCollection 8 ปีที่แล้ว

      +ho long Wong tnx perfact explain
      but bro how come my given name be a variable type
      is there any rule of making it

  • @aronreviour9164
    @aronreviour9164 9 ปีที่แล้ว

    you do take a lot of effort to explain us these stuff. thats why even a 13 year old like me can understand these within the first glance. keep it up.

  • @MostRandomIsh
    @MostRandomIsh 7 ปีที่แล้ว +3

    94 college deans watched this video

  • @ei07subhajitdas95
    @ei07subhajitdas95 3 ปีที่แล้ว

    Best video I have ever found explaining class and object in an excellent way

  • @CosmicAstroDuck
    @CosmicAstroDuck 10 ปีที่แล้ว +10

    Though python is way simpler, C++ is way easier when it comes to Classes. That fucking __int__(self) shit is so annoying!

    • @MrEpicSpace
      @MrEpicSpace 10 ปีที่แล้ว

      The difficult programming languages are more logical, just like english.

    • @MRGHOSTsReviews
      @MRGHOSTsReviews 10 ปีที่แล้ว

      You cant really compare C++ and python because two are used in slightly different ways.

    • @DukeThatSpooks
      @DukeThatSpooks 10 ปีที่แล้ว +6

      ***** Id say English isnt that logical i think German is more logical than that cos English has a lot of exceptions

    • @TejrnarG
      @TejrnarG 7 ปีที่แล้ว +2

      English is probably one of the least logical languages that exist. Chinese I would say is one of the most logical.

  • @kaspa123321
    @kaspa123321 8 ปีที่แล้ว

    The fact that at the end he said "You guys have no idea how important the information you just learned is" means a lot to me. It tells me that this is what programming is all about etc

  • @oscareribo9352
    @oscareribo9352 6 ปีที่แล้ว +4

    nice tutorial but just a humble suggestion, next time can you avoid the using of the same name buckys class buckys object, function et. if you use different names is easier to understand its my opinion thank you

  • @geniushomwetv9793
    @geniushomwetv9793 6 ปีที่แล้ว

    On behalf of programmers in Zimbabwe I thank you for these videos (Java and C++) really helpful

  • @antiHUMANDesigns
    @antiHUMANDesigns 9 ปีที่แล้ว +3

    You've got to be shitting me. Your explanation for the reason why to make classes (a reasonable explanation, don't get me wrong) is in *direct* contradiction to your usage of "using namespace".
    Where is "cout"? Oh yes, it's in my "std" namespace. Oh, no, it's not, because I just put that, and hell knows what else, in the global scope, by writing "using namespace std".
    Why isn't my "swap" function working? Oh, it's because I've cluttered the entire scope with a bunch of functions and classes that I had no knowledge of, so now half of my functions are replaced by other functions.
    Seriously, it's like merging all the folders on your hardrive into one big folder, and now all the files with the same filenames have overwritten eachother.
    Stop teaching people to do that. Explicitly teach them *not* to do that.

    • @antiHUMANDesigns
      @antiHUMANDesigns 9 ปีที่แล้ว

      Sons_of_Liberty No, not unless the people who made those libraries allowed you to do it.
      See, when you "include" thing, you're simply dumping another file into your code. Everything in that file gets included where the include statement is. There is no way to include parts of files.
      But it's possible to make a file where things are optional.
      #ifdef INCLUDE_ALL
      // ... bunch of code
      #endif
      The part that says "bucnh of code" will be ignored if you haven't defined "INCLUDE_ALL".
      So you could write:
      #define INCLUDE_ALL
      #include
      So when that part comes, "INCLUDE_ALL" has been defined, therefore it won't ignore that part.
      I dunno, perhaps it sounds messy... those things are usually used to iclude things depending on operating system, for example.
      Anyways, it can be done.

  • @Frankthetank7329
    @Frankthetank7329 7 ปีที่แล้ว

    It took three weeks for my college professor to get this far in the introduction to C++ and cost me $750 in credits before I dropped out. Thank you for your service and for making this program. I only wish I found it sooner.

  • @sleepsleeper4466
    @sleepsleeper4466 11 ปีที่แล้ว +87

    21 people will never learn how to code lol.

    • @prateekgurjar1651
      @prateekgurjar1651 10 ปีที่แล้ว +2

      now they are 25....boy that escalated quickly

    • @Phastasmn
      @Phastasmn 10 ปีที่แล้ว +2

      ***** Update now 26 people. Maybe they don't have brain, which understand 010011101 xd.

    • @abhijaytyagi6808
      @abhijaytyagi6808 10 ปีที่แล้ว +5

      Phastasm n now its 27! -_- lets go on a nerd hunt!

    • @arildsela8185
      @arildsela8185 10 ปีที่แล้ว

      now it's 28

    • @Phastasmn
      @Phastasmn 10 ปีที่แล้ว +1

      abhijay tyagi Already done

  • @FreshaDenaMofo
    @FreshaDenaMofo 11 ปีที่แล้ว

    First time I watched this I didn't understand and gave up on video 12. I then went to his Java tutorials and watched those up to like 35, understood everything including the classes and objects, so I came back, and I completely understand now. JAVA MAKES C++ REALLY EASY.

  • @JohnnyProductionsOfficialTM
    @JohnnyProductionsOfficialTM 8 ปีที่แล้ว +4

    omg 666, 666 views when i wrote this comment!

  • @mcozrk
    @mcozrk 6 ปีที่แล้ว

    what i've been lost on for two lectures now, you've just taught me in under 10 minutes, thank you!!!!

  • @MrM-pr9ic
    @MrM-pr9ic 10 ปีที่แล้ว

    I have been trawling the net looking for a sensible illustration of classes. This is it. Thank you. The textbooks just don't introduce classes in a meaningful way. Having watched this, I am much better prepared to study classes further.

  • @am25deek
    @am25deek 10 ปีที่แล้ว +1

    I was suffering till this video. Thank you bro. Your videos have helped more people than you could ever imagine.

  • @corneliusdrogo1429
    @corneliusdrogo1429 10 ปีที่แล้ว

    I did not understand at first, But I watched it 3 times, then did some classes of my own and I now UNDERSTAND what is going on. THANK YOU BUCKY!!!!!

  • @siddheshdhuri7795
    @siddheshdhuri7795 3 ปีที่แล้ว

    these tutorials are still rocking even after a decade

  • @exxodus09
    @exxodus09 7 ปีที่แล้ว

    This has been one of my toughest concepts to grasp in C++ and all of your tutorials have been super helpful! Thanks so much!

  • @liubei86
    @liubei86 10 ปีที่แล้ว

    I feel like you deserve more than a thousand thank you's for making a tutorial of this. My professor is not a good speaker, he mumbles and jumbles his words and moves too quickly for his students to follow. You however explained classes better in 8 mins than he did in an hour.

  • @khawulamandisa3189
    @khawulamandisa3189 7 ปีที่แล้ว

    I cant believe this video was made years ago but it is still so very helpful. Bucky buddy you are the best!!!!!

  • @SinisterShrink
    @SinisterShrink 11 ปีที่แล้ว

    Wow... you explain this stuff so well, I don't think anybody could not understand this.

  • @p1skates
    @p1skates 10 ปีที่แล้ว

    Love it when it just clicks. Thanks for the tutorial.

  • @ahfilmingproductions
    @ahfilmingproductions 10 ปีที่แล้ว

    Bucky's explanation of classes in C++ is so much easier to understand than his explanation of classes in python.

  • @TropicalBrick
    @TropicalBrick 7 ปีที่แล้ว

    Im doing an online course at the moment and was kinda lost and in the space of this video it all makes sense! Thank you!

  • @gryf3817
    @gryf3817 5 ปีที่แล้ว

    Why is bucky so good at explaining things, an actual life saver

  • @luisquintana7044
    @luisquintana7044 3 ปีที่แล้ว

    This really helped me, you are very clear and soft spoken. Excellent video.

  • @jacobwilson7953
    @jacobwilson7953 10 ปีที่แล้ว

    I'm glad I'm not the only one who misspells everything the first time I type it.

  • @TheAugeX
    @TheAugeX 11 ปีที่แล้ว

    I subscribed this channel from 2010, cuz I saw so much great information, and now I'm learning in 2013 and this is just absolutely amazing work!!! keep going!!!! THANKS!

  • @catchthese
    @catchthese 11 ปีที่แล้ว

    Your videos are so easy to watch and teaching method makes it easier to learn C++ programming. I am also using your series to teach my 12 year old a few basics. great job. A++ (I feel like I just gave a ebay rating)

  • @Ravenex2
    @Ravenex2 6 ปีที่แล้ว +1

    Took my CS 280 final today, just these basics helped me out a great deal on a section that cost a lot of points! Thanks.

  • @shootermcgee8397
    @shootermcgee8397 5 ปีที่แล้ว

    People like you Bucky are picking up the slack from college professors all around the world. Thank you for what you do. Sincerely, another engineering student.

  • @Adsunt
    @Adsunt 8 ปีที่แล้ว

    thanks so much for explaining it without making it unnecessarily complicated!

  • @Shah90022
    @Shah90022 11 ปีที่แล้ว

    Bucky's awesome! First time I've been able to follow through and understand a programming language. I'm really enjoying C++. Thanks.

  • @CIPHERJAY
    @CIPHERJAY 11 ปีที่แล้ว

    Its just makes it neater for reading the code in a class rather than in main

  • @serene-illusion
    @serene-illusion 2 ปีที่แล้ว

    holy shit I wish I learned this 2 months ago early into my trimester. Mans taught me about classes way more effectively than me having to rewatch my google meet lecture recordings multiple times

  • @casperhadez8941
    @casperhadez8941 9 ปีที่แล้ว

    Just wanted to give you shoutout Bucky. I have been following your tutorials for a couple weeks now and also referencing them with a book I am almost done studying from called: (Jumping Into C++ By Alex Allain),. I must tell you I thought this would be a lot harder to learn. I have had no issues understanding the fundamentals and logic of everything from the book and your teachings. My only issues revolve around forgetting how to right the code out at times. i.e. where to put the correct semi colons. So how I have learned around this is to just continuously type out the lines of code repeatedly and shuffle around the code with the new code i learn. If you really meant what you said in this video about this being one of the more confusing areas in C++. Im stoked. Bc this was cake. TY again!!! Its the way you teach the code Im sure. ;}

  • @ShuyanStoryTeller
    @ShuyanStoryTeller 7 ปีที่แล้ว

    Thank you so so much, Bucky. I watched it again again again...Now I fully understand it. wish you were my professor.