This video goes over a programming concept called "Encapsulation". If you're still confused about this, just do a youtube search for it and you'll learn more. Also, there tends to be confusion about Functions vs Methods. One naming terminology goes like this. If a Function is nested in a Class, it's called a Method. If it's not nested in a Class, it's just called a Function. The reason for these two names is that it makes it easier to talk about functions. If someone talks about a method, you know immediately that it's attached to a class and must be assigned an object to be used. On the other hand, if they talk about a function you know that you can just call it directly. I hope this isn't too confusing. =)
@rahulkhatri17485 жыл бұрын
it's wonderful, actually, thanks!
@alinpatricban97115 жыл бұрын
Sir, I love you.
@anthonysmith10265 жыл бұрын
very insightful thank you.
@theseangle4 жыл бұрын
Thanks!)
@cyclo94 жыл бұрын
Derek Root methods use dots ( . )
@Legendofmudkip8 жыл бұрын
.....everything makes sense now. I've made a new routine to watch your videos after my classes because the way you explain things makes more sense.
@KS-23178 жыл бұрын
+xdarkness22x you are lucky. Unfortunately i discovered this guy 6 days before my finals -_-
@Skorbeen8 жыл бұрын
+Khatia were the 6 days enough?:p
@steve1222888 жыл бұрын
+Khatia K ha try almost 12 years lol. Well i guess 5-12 if you count college. Tho most of this stuff i already knew by now but he definitely is clearing some stuff up for me; my experience having been limited and depressing.
@steve1222888 жыл бұрын
actually theres alot of stuff i always wondered that he doesnt explain. Like to what depth can the program function. Like this string library is needed in this video; makes you wonder where int and double ect come from and how it knows to utilize functions and stuff. I wonder if learning C wuld help. Tho i know that understanding computers and science in general more would also help, despite that I need to progress further in my projects lol... at least im learning science on way or another tho. This is always better then nothing.
@Legendofmudkip8 жыл бұрын
steve122288 There is actually a "don't know, don't care" rule-ish with programmers. My professors all follow this rule and Bucky does as well. How does the library work? Don't know, don't care. How does a program actually work? Don't know, don't care. I was taught this in my first CS class. It is a shame though because I sometimes wonder as well, how things work in C++.
@SmokeyMcHash8 жыл бұрын
I´m studying C++ from a school online and don´t get shit. After watching your tutorials however everything becomes so clear. You´r doing a better job than my own teachers in teaching me. Keep up the good work sir :)
@bluz18645 жыл бұрын
speak the truth
@onepiecebarca4 жыл бұрын
welcome to the internet
@realcomments3 жыл бұрын
10 years ago I learned programming from you and got a job! Now, 10 years later I am brushing up my programming skills with you again. How are you doing Bucky?
@wthrajat2 жыл бұрын
hey man. why are u brushing up your programming skills again? arent u using it in your job?
@LearnKuCode2 жыл бұрын
Same here, This wonderful man has given soo many of us great jobs lol
@penguin32452 жыл бұрын
10 years is a long time , i just got in college now I'm overwhelmed by the thought that where will I be in the next ten years 🥲
@yerimdiarra78232 жыл бұрын
Don't worry buddy, sure u will be fine Keeps your head up, and grind your way to the sun
@spicyshizz28502 жыл бұрын
WWWWW Bucky's videos helping me learn right now loll
@ChrisRenfro899 жыл бұрын
1 week left in my C++ class. Wish I found Bucky earlier in the semester.
@KS-23178 жыл бұрын
+Chris Renfro same here :((
@steve1222888 жыл бұрын
+Chris Renfro this world is so fucked.
@ClaudiuB7 жыл бұрын
We all say that, especially to women: Wish I found u earlier. But don't worry mate. It's never too late for learning! xD
@shutdahellup694206 жыл бұрын
lol tomorrow is my c++ exam and im starting this right now...he saved me bro...he's my hero lol also he helped me learn c and python too :)
@mobarakjama55706 жыл бұрын
Today is my C++ final exam after roughly 2 hrs i go to my university and take the final exam so yh yeay me.
@1matzeplayer14 жыл бұрын
9 Years Later and Bucky is still the MVP of my Semester!
@briandacallos42345 жыл бұрын
who's still watching our legendary bucky ? HAHAHA
@unknownguy20924 жыл бұрын
came from solo learn
@Somewhat_Sassy-Commentator4 жыл бұрын
I’m still here. @Israt Zjhan
@andrewkevins7794 жыл бұрын
Here
@johnstaples54584 жыл бұрын
Currently drowning in a C++ programming class and this guy is my personal flotation device.
@abdinasirahmed71503 жыл бұрын
imagine am starting his tutorials now hahaha
@2CloseShave11 жыл бұрын
Everyone: "Hey now brown cow" Bucky: "hey nwornown dow"
@s335214 жыл бұрын
Made me spit the water I was drinking 😂😂 after 6years 😁
@Vorazun4 жыл бұрын
1 month later
@lindahurley57113 жыл бұрын
@@s33521 BBC news
@IceFried10 жыл бұрын
one class to declare them all one class to find them one class to call them all and in the function define them.
@JusticeRetroHunter10 жыл бұрын
lmfao
@slayerq39 жыл бұрын
Hahahahaahaha xDDDD wow
@ibrahimsabe9915 жыл бұрын
you naild it :D
@nathanmulopo74905 жыл бұрын
I don't get this help me out ppl😥
@ibrahimsabe9915 жыл бұрын
@@nathanmulopo7490 If you saw The lord of the rings movie you'd get it :D
@Mechaghostman28 жыл бұрын
This was the hardest one to follow so far. After watching it like 6 times, and pausing it so I could see the full code, and writing it 2 or 3 times, I think I got it now. I think. Would have been better if you described in detail what each line and word or whatever was doing, though. I had to run it through my head a few different times before I was able to make sense of it. I'm still a bit of a noob, but here's my understanding of it: class DrunkMan{ public: void setName(string x){ name = x; } string getName(){ return name; } private: string name; }; int main() { DrunkMan object; object.setName("Lemmy!"); cout
@Aura10028 жыл бұрын
+Mechaghostman2 Dude we need you on every video... I understand this loads better than trying to write it down myself.
@yumi30888 жыл бұрын
I think it would take time and experience via coding till we can actually use this technique efficient. Hopefully we all can, coz it would be a great help to shorten the code.
@AndyU968 жыл бұрын
My initial problem was with the 'setName' and 'getName' thingies, after a while, I realized that these names could be changed.. When someone types things like 'set' and 'get', it just gives me the feeling that it's some specific code/type/something like that
@Sukidarkra17 жыл бұрын
thats not an object that is a second fuction in the buckysclass. String getName(){ is the same as the "int main ()" line of the main function all the fuction does is gives the main fuction the name so that it can be output in the last line of code.
@ClaudiuB7 жыл бұрын
Let me explain it to you better: He wanted to access the private variable in BuckysClass from outside the Class, and for doing this he made the variables above public(but put them in the same class aka body of the class)! The rest of the code is just the main program which simply create a string and print it out :D
@KillerPiplup7 жыл бұрын
I've been stuck for 2 weeks on classes! You're such a great teacher and you rarely assume we know everything about programming. Thank you so much!!! I can finally catch up and move on.
@mariomendoza75312 жыл бұрын
I've been struggling for 6 weeks in my C++ course and have just found your videos! I've never been so happy in my entire life.
@MrSimpleCF3 жыл бұрын
2021 and this tutorial is just the best on youtube or any other platform, and it's FREE!!!! god bless you bucky
@georgecristianiordan37125 жыл бұрын
Simple simple simple, a simple example that explains all, god i finaly understood a little bit of classes, thank you sir, i owe you a lot, you made my day, i was allways looking for classes tutorials and i couldnt understand them because everyone is giving a complicated example and everyone is putting too many new informations in a code. Thank you again.
@hefhef543218 жыл бұрын
I had to watch this twice to get what the "string" was all about. It's basically like "int" but for text variables...
@zoo23228 жыл бұрын
thx dude
@epicwhat0018 жыл бұрын
not really int is a primitive data type and string is an abstract data type think of string as an array of characters wrapped up in a class.
@zoo23228 жыл бұрын
Thx!
@cameronsluiter3237 жыл бұрын
Question: Why does he use string? Couldn't char work too?
@iantupiara8917 жыл бұрын
string is used for more than one character, while char is just for one character, so for example if you made a class of college classes, it would be correct to put string name (for instance Math), and char grade (A). I'm a student as well, not 100% sure that I explained it correctly.
@Shadowrose543217 жыл бұрын
Pointers 1)The compiler(What your putting the code in) Reads the entire Class before giving an error. So creating a set function Name first will not give you an error. 2) If you are having problems reading this code read it from bottom to top after he's done 3: String x is exactly like int x in the parameter videos. String = text. 4: Name = x is changing Private: String name; to Private: String X; 5: Return Name returns the name variable to you. So when you use getName in the main it will also allow you to display name. 6: Bo. Setname("Whatever you want here") you are now officiially using setname to change X(name) without accessing the private function 7: cout
@tinofilipino10 жыл бұрын
Hey guys! I'm 3 years old and I understand this tutorial perfectly. I don't know how you 12 year olds struggle with this. Yes, age is indeed relevant!
@arcanerstudios7 жыл бұрын
Proof that you are 3 years old.
@reapercreates7 жыл бұрын
suck it
@sophiesvanidze92076 жыл бұрын
I didn't know that 3 year olds could type :\
@AK-fn7ro6 жыл бұрын
and i'm just born 9.12 minutes before
@KovacicEhsan6 жыл бұрын
you are 6 y/o now?
@n3onis7 жыл бұрын
I've watched quite a few videos explaining the getter and setter functions and never seemed to understand completely. The way you explained it was crystal clear, though. I finally know what they are used for. Good job!
@elishakantor8 жыл бұрын
Just wanted to let you know you have made my life SO much easier with your tutorials!
@samflanagan777 жыл бұрын
Great refresher. I took "C" in the 90s. It's longevity has been truly amazing. Prior to "C", it seems like programming languages morphed every several years. I got thru vids 1-12, basically clicked thru them. This is new material but I recognize it from reviewing recreational programming material.
@MattWard8911 жыл бұрын
What other languages does he do videos on? When I take other classes I would LOVE to watch some of these videos as well!
@KobeCofini4 жыл бұрын
I checked out his playlists and he does videos for lots of frameworks like angular and django. Seems like he mostly focuses on tools for web development.
@anastasiatsigka23528 жыл бұрын
I just wanted to thank you so much! You "saved" my life with these courses! Finally I can understand C++. I'm in university right now studying IT and I have a C++ course and the professor is terrible, I don't understand anything. Thanks again! Excellent work! xoxo
@Chris0nF1re10 жыл бұрын
You teach much better than my tutor in college :)
@ItsRawrTopia6 жыл бұрын
He teaches better than the professors with PHDs
@Lancechingchong7 жыл бұрын
6 years later and this is still very helpful! Thankyou. I've been lost in my class at GaTech and this makes everything so much clearer. Great video!
@anthonyzhou48989 жыл бұрын
Took me a while to actually understand this
@xSabretoothx1511 жыл бұрын
Thank you for your excellent teaching! If someone only told me the proper way to access variables in classes, I would be totally confused. Explaining the simpler but improper way first is always a great move for a deeper understanding. I just wish you'd also included an explanation as to why class variables should be private.
@lolittashue24807 жыл бұрын
Can't we set and get the variable using one function instead of two? like: public: string SetGet (string x) { name = x; return name; }
@MrHarryGaming5 жыл бұрын
i was wondering the same
@crobes41554 жыл бұрын
@@MrHarryGaming You could in this case, but if you wanted later on to get the name without knowing it, then you wouldn't be able to find out what it is without changing it.
@RepaidSpade9 ай бұрын
Starting my c++ journey, and it’s amazing how these videos are making stuff from even python or Java click so much better haha
@zeustheboerboel37948 жыл бұрын
This was quite hard! Had to watch it a couple of times before I could fully get it!
@ItsRawrTopia6 жыл бұрын
I know java already, and i watched it once I already understand.
@HenrryWith2Rs3 жыл бұрын
what is it that makes his concepts so easily understood? you have a gift!
@nicholasgugunga25499 жыл бұрын
He had to go take a train and a plane and a bus just to avoid making a public variable... All just to get the program to print out a name...
@nicholasgugunga25499 жыл бұрын
Fair enough. Haven't made a program yet where It's needed this set up, but I'm not working on anything but basics right now. Good to know for the future at least.
@RealEyes249 жыл бұрын
do functions return strings ? as i remeber functions do not return strings or arrays...
@nicholasgugunga25499 жыл бұрын
functions return them if you program them to do so. In C++, AFAIK, they at no point do it automatically.
@lucasagua779 жыл бұрын
okay it was a video incredibly hard to follow. but if it says that public classes will mess up our programms i will willingly take the plane train and bus to do the private thingy. i have one doubt tho. is char and string the same thing? can someone explain to me what the heck is an array too?
@lucasagua779 жыл бұрын
Nicholas Vulcano what does the include does? this is the most important question haha please helppp
@jasontran818 жыл бұрын
Your simple explanations were very helpful for a beginner to quickly learn the fundamental. Keeping it simple here was key.
@jacobcorrie4 жыл бұрын
just had to flex the 80+ languages haha i love it!
@sakshiiikuthari10173 жыл бұрын
lmaoooo
@amandamthamalala7693 жыл бұрын
Also noticed that😂😂😂
@thesickbeat12 жыл бұрын
I'm not sure if you've already seen how property's work with events but once you got there you need to know that the big advantage you get is that you can set an event in the setter. So whenever a variable is changed the event fires. That should clear up alot.
@MattWard8911 жыл бұрын
Thanks!
@padoharaja45033 жыл бұрын
OK
@fizzahbatool75623 ай бұрын
The best C++ playlist on the KZbin for beginners❤️
@KeenanWoodall10 жыл бұрын
If a computer runs through the code top to bottom, how was he able to use the variable "name" in the function getName and setName before the variable was declared. Shouldn't he get an error?
@Raidom10 жыл бұрын
Maybe it reads class from private to public ?
@KeenanWoodall10 жыл бұрын
Thanks
@SrJusty10 жыл бұрын
I have the same doubt and I think Otto Ling didnt answer it. What I want to know is that in class buckysclass there are two functions that use the variable name, but name is declared later, how is that he doesnt get and error? How know the functions setName and getName what the variable name is?
@luisaverhoff488410 жыл бұрын
I know this is pretty late but in case you don't know, no it wouldn't get an error because Bucky executed each calling function in the proper order. When ever a program is executed, the main function is first called on, then it reads any variables there are initialized in the main function(very important). Next it reads each calling function( in this case setName, and then getName). In setName, he initializes the variable string x with Sir Bucky Wallace and then is stored in the string name variable and then is returned by the getName function. The name is then finally displayed on the console screen. This is order the program goes by. I hope this helps.
@KeenanWoodall10 жыл бұрын
Thanks. That makes since
@limit14854 жыл бұрын
I got to say,you are an excellent teacher.I wish you were my C++ teacher instead the one I have.Very detailed and understandable explanation .Thank you.
@DariHina9 жыл бұрын
lol turn on subtitle 0:02
@m.m.50498 жыл бұрын
+Dariush Firoozian "was going on guys is fuckin walking tours 13th C pas pas store oh and in "
@ThilebanTheEngineer7 жыл бұрын
it is changed now
@fckyo333ujhjjkrrrr6 жыл бұрын
No.
@xtinesilva4 жыл бұрын
I’m cramming all these good stuff one week before my exam. Glad I met Bucky! Learned a lot in a short amount of time. I was about to give up, but this gave me hope. Thanks a lot sir!
@vish45447 жыл бұрын
You set name=x before declaring it (you declared string name in private which is down) why no error???
@crads32917 жыл бұрын
name = x is the same as saying x = name. He declared x in "void setName(string x)"
@mohdkumail56297 жыл бұрын
You can use variables that are private in the the same class but not in main function.
@Sakuscribe7 жыл бұрын
+Jav Reborn if you say "name = x" then name contain the value of x. If you say "x = name" then x contains the value of name.
@Sakuscribe7 жыл бұрын
+Mohd Kumail He's asking the order of operation. Since he declared the variable name after he assigned it the value of x, why does it not give an error?
@mohdkumail56297 жыл бұрын
No there is no difference the computer knows that name variable exits in the same class as the function. As long as it is in the same class as the function there will be no error.
@Mila-w6d12 жыл бұрын
If you look up "encapsulation," youll be able to find more information on why this is important. But basically - if your class variables are public, they can be accessed from anywhere in your program, even accidentally by another class that uses the same variable name. Keeping class variables private helps to keep things organized. When you would like to change the value of an objects variable, main, or another object, passes the variable to the object, and the object sets its variable itself.
@БатоЖигжитжапов8 жыл бұрын
Programming drives me crazy!!! I'm sitting at 2 am, trying to create a programm like this, searching the video like 9 times and finally, find the problem! Just spelled the object wrong once!
@samesam158 жыл бұрын
doesn't it mark where you had your error in CodeBlocks?
@romel_storm7 жыл бұрын
Yeah but sometimes the errors carry through and cause other lines that didn't have errors to have errors because the line with the original error was wrong if that makes sense. The compiler just spits out everything that it found that was wrong
@Arthurk3465 жыл бұрын
When I was trying to figure out why my class is not working and it turned out I wrote the name of it not using CAPITAL LETTER I was like pffffffffffffffffffffffffffffffffffffffffffffffffffff
@rngnodal93164 жыл бұрын
Foster Brown Almost like a car.
@cl33757 жыл бұрын
omg THANK YOU yay, I watched 55 C tutorial vids by you and I am SO glad that your C++ videos are just as helpful!
@gavin85358 жыл бұрын
hello, what is the difference between setName and getName? i am confused about the two.
@KS-23178 жыл бұрын
+Peterolen why can't we use return name; In setName function ?
@juanbermudez96438 жыл бұрын
+Peterolen setName and getName are both functions, and Bucky made them public in order to have access to the variable "name" which he made private, and he wont be able to use it otherwise. so in the function setName, (which has a return type of void, void means the function will not return any value) Bucky passes a parameter x which is of type string, and in the statements after the {} he defines name = to x. void setName(string x) { name = x ; } So when bucky calls this function in main bo.setName("Sir Bucky Wallace"); the function will contain the string "Sir Bucky Wallace " In string getName() Bucky returns a string, which he placed before the function. string getName() { return name; } as you can see name = " Sir Bucky Wallace" In conclusion Bucky used the functions to access a private variable. So when he couts and calls on the function cout
@SuperYtc16 жыл бұрын
setName sets the name. getName gets the name.
@fatmaatta6 жыл бұрын
Uranus loll
@fatmaatta6 жыл бұрын
nelsitoxspace rofl
@RatIceCream2 жыл бұрын
This stuff is literally a life changer for me in college
@Atomicgamer3410 жыл бұрын
I'm 13 and this is helping me a lot!!! Thanks Bucky
@prateekgurjar165110 жыл бұрын
I am 13 too....duh
@SeptemberLF10 жыл бұрын
No one cares if you're 13 or 70.
@brianvodzi253410 жыл бұрын
it doesnt matter what age you are atomic....its good yr starting young though
@MrTypingsound10 жыл бұрын
that's brilliant to be starting so young! I wish I had started at your age, as I'm 29 now, so by now I'd be a programming genius! :D
@AlaaElrifaie10 жыл бұрын
I was at your age when I mastered C# .. Now I'm 17, and I have a lot of applications written in ( C# .. Java .. C++ ) all over Internet! Although I study medicine :P
@MrIUniQue5 жыл бұрын
Just wanna say that im so greatful for your videos. Im in university studying C & C++ and your videos are so easy to understand compared to my teachers.
@sigfridsixsis32556 жыл бұрын
“Sir William Wallace”==“Braveheart”
@prmchuk11 жыл бұрын
Now to get around this problem, you have to create a PUBLIC function that can be access outside of your class, in main. Because the function is usable outside BuckyClass, you then code the function so that it is able to change the PRIVATE variable you created earlier. By convention, a function that does this is called a setter. Every setter, by convention, has a getter function. The getter function is also public and all it does is retrieve the info that is contained by the PRIVATE variable
@wiredelectrosphere10 жыл бұрын
What's with all that "I am 5 - 12 years old and i am fluent in Java, C, and 100 other languages, including machine code" in every single programming tutorial on youtube? And not only programming tutorials, also in math tutorials but not as often as in programming tuts. And whenever i click on that kid, all a see is Minecraft and Call Of Duty videos, not so intelligent. I think they just want to look like they are geniuses.
@TheZeldoph9 жыл бұрын
I can drink to that.
@numinous5109 жыл бұрын
Boosting self confidence. Way too much.
@TheZeldoph9 жыл бұрын
If they are so good at programming why are they watching a tutorial that will teach them how to program.
@avi_mukesh9 жыл бұрын
Because the thing is, he DOES know other programming languages. He IS quite young (idk how old though) and he is more or less a life saviour and a God for so many people.
@azraeljallorina32959 жыл бұрын
+Hermann Bernzweig when i was 16 i designed a shitty ass turing machine, im a genius, PRAISE ME!
@Seikuu12 жыл бұрын
Okay first the "string" part is an identifier, like int or void, but since this is just for text, it's string. Then what it does is essentially like the usual return (x or whatever you want to return) in any function. The thing is it just returns name, which it already has access to since it's in the same class. Basically the function is there so you can use name from the class with just that after it's already been set some text,instead of going through a function where you need to add the text
@Lone_Rocket8 жыл бұрын
in class im learning python. But i'm here learning C++ instead. #rebel.
@Lone_Rocket8 жыл бұрын
***** Wait to you get to app inventor. You will wish you had scratch.
@rngnodal93164 жыл бұрын
Same
@nographite12 жыл бұрын
Just wanted to drop a comment on how great your tutorials are and how easy it is to understand. I never understood why I needed getter and setter methods until now. All universities should just link their programming courses to your KZbin channel
@thedillestpickle7 жыл бұрын
What happened? This says video 13 but I feel like he skipped a whole bunch of concepts.
@pluviophile84276 жыл бұрын
same.. i understood first 12 videos perfectly, but he tried to cover whole bunch of things together in this tutorial
@bredmond8125 жыл бұрын
@thedillestpickle yeah, ive watched all his videos on C, and C++, as well as the videos of other people, including videos on VBA. (what i mean is im no programmer, but i have some experience). Anyway, my conclusion is he went from regular old programming and then suddenly jumps into object-oriented programming and then back into the regular stuff.
@daheeallgood33274 жыл бұрын
it's so crazy, how he explains it so well in such short time. But the professors make it so complicated
@karanveersingh96348 жыл бұрын
how old are u bucky ,cause u know 80 languages
@kcnameit92533 жыл бұрын
You made my 2021 I learned a lot here than online school...
@jason_willis9 жыл бұрын
encapsulation
@samirgunic9 жыл бұрын
+SolomonSevens It's also a form of information hiding.
@ItsRawrTopia6 жыл бұрын
From Java
@rngnodal93164 жыл бұрын
Ohhh yesss!
@seanpaul3597 жыл бұрын
Thank you so much!! I had three 1 hour lectures last week. We started Object Oriented Programming and although my lecturer is really good, nothing seemed to make sense. It does now. Thanks again :)
@abdullahsiddiqui106510 жыл бұрын
this video was kind of hard to understand
@Quinten137 жыл бұрын
i let my dog fart on my face
@beri41387 жыл бұрын
+Quinten Salinas WISDOM
@Siterus7 жыл бұрын
compared to other people's videos not really
@abdullahsiddiqui10657 жыл бұрын
k, thanks G!
@A1babaU11 жыл бұрын
x is the string (he chosen) in which will be stored the name we want(or phrase). The way we do with strings it's the same we do with the integers (int) but strings, as bucky said, stores names and/or phrases and int stores numbers. PS: You can name a string how you want, they simply store words not number characters :) I'm sorry for my possible mistakes in english, I am not that friendly with this grammar.
@anren81627 жыл бұрын
"hey nwornown dow" cash me ousside how bow dah?
@letmecommentalready12 жыл бұрын
You deserve so much more credit just for the simple fact that you're 100x the teacher than most programming teachers I've had at university. You make things very clear and easy to understand! Thanks so much!
@brianvodzi253410 жыл бұрын
Hey guys im 14 and i....wait....what?.....no one cares?....really?.....ok.
@LGeefs10 жыл бұрын
Thank you
@harald92110 жыл бұрын
Hey guys I am 11 and I am watching a programming tutorial, please think I am cool.
@HHuynh201110 жыл бұрын
Harald Kanin NO WAY!!! You are the coolest guy I know!!!! XD
@harald92110 жыл бұрын
HHuynh2011 Yeah like. Because this tutorial I now rule the chickz in school. Im so cool.
@CipherA10 жыл бұрын
That's exactly like starting your sentence with: Well, I'm a Christian. Like we're supposed to think you're more morally upright than the rest of us.
@DavkasBr12 жыл бұрын
Seriously? I spent a whole semester on college to understand OOP and I got it with your tuts in 15 minutes!
@gunboundph110 жыл бұрын
i am 1 year old i code hello world
@santosh44719 жыл бұрын
You are really an awesome teacher. I respect you, man. Thank you so much for the tutorials. Tutorial 12 and 13 just cleared all the confusion I had about classes. Thank you again.
@user-hw1xy3sl5b8 жыл бұрын
This was hard to understand.
@THEedcbb33 жыл бұрын
So proud to be learning OOD from sir Bucky Wallace ask the way from Scotland, Boston....I even heard he shoots bolts of lightning from his arse
@itig129 жыл бұрын
everytime you should say s you say sh and most of the time I don't care but when you say shhhhhtring its really annoying
@fl3tching10111 жыл бұрын
A public string can be directly accessed by say typing bo.name, whereas a private string wouldn't be accessible, it's just good programming technique and saves you some trouble in the long run. Also makes it less likely to accidentally make syntax errors with the string.
@DaCurse08 жыл бұрын
i thought C++ is hard no. its not!
@ItsRawrTopia6 жыл бұрын
No it is hard, but it is easy when Bucky teaches
@oussamaalaoui259111 жыл бұрын
After watching this for 7 times, I finally understand how to use variables in classes. Thanks Bucky there goes new subscriber.
@jampk2411 жыл бұрын
Wow, this video and the one before were extremely helpful. I've been trying to wrap my head around classes for a while now and I think I'm getting it now.
@ThatGuyNamedBender11 жыл бұрын
I actually learned how to code by following good tutorials on how to make a certain type of program as they explained how it works. But what you advised is still good because still today (been programming for 6-7 years now) I put in comments to refresh myself on how the code works. :)
@mrninjaman9612 жыл бұрын
because if you can brake down some process in parts (function ) do it later on it's much easer so you can set name few times without returning it and when you want to return it you call get name so you don't need to set it again it will be clear when you get to more complex problems
@bishalshrestha142210 жыл бұрын
i had no hope in passing c++. But this tutorial made me class topper in weekly test. thanks bucky....
@ihr141413 жыл бұрын
@BarrieIsEpic Yes. C++ is a strongly typed language, meaning you need to define what kind of value will be held in each variable. It could be a bullion, word or number, but each one requires a different variable. Many newer languages, are weakly typed, which means that any value can be entered into a variable. Although it appears more difficult to name the type of every variable, it gives the programmer more control over the program and garentees every variable will serve what it is meant to do
@dangerface31718 жыл бұрын
I have had 4 people explain this to me, but only you made me get it! Thank you and keep up the good work.
@DTX_11 жыл бұрын
Hey bucky thanks a lot you dont know how much you help me ... each time im stuck i come here and search for yur tutorials :) one love
@gigahertzish11 жыл бұрын
decompilers can get it, making functions and variables private is done so that you can make two function of the same name. plus, it makes the code "feel" a bit more organized.
@registeelable6 жыл бұрын
HEY NOW YOUR AN ALL STAR !!!!!, jokes aside, thanks man , you are getting me through college!! Cheers to your hard work. You can see the difference from somebody who is just making videos on the side and then people who put a huge amount of effort into their work.
@RGDCaliber11 жыл бұрын
When we are programming these simple programs it may seem useless to have indirect access. But when you are making larger programs, you will have many many more variables and functions. Things may get confusing and muddled up. The last thing you want is other functions accessing and changing variables. This is why it is "better practice" to use get and set methods. It is not 'wrong' just tidier and gives less room for error. :D
@-mustang-93837 жыл бұрын
could you reexplain why it's become a bad Thing, when you didn't put the 'Private ' into the Code? i still didn't get that part clearly enough... would be there any examples between putting private and without private to clearly state the difference ? thank's
@NeilRoy10 жыл бұрын
Some of the reasons to do things this way is so you can say, check to make certain the length of the name string is valid, you can do this in the class without changing any other piece of code in your program! The *setName()* function is still the same, but now it could include code to check the length, other error checks etc. It can be modified at any time on how to handle setting names without you changing any other part of your code where it sets it, only the class itself needs to be changed. On tiny projects like this it doesn't make sense, but if you're working for a living at this, or even on your own on a large project with multiple files which could have a large number of calls to the same class, you want to be able to adjust these things by only changing one piece of code in the class and not have to search down every area in your code where you used it. It's also more secure this way, you can enforce limits in your class etc... just countless reasons to do it this way, the right way as he described. Oh, one other note, in a class, everything is public: by default, there is no need to actually enter *public:* in there, just put all your public functions first, and then put in the *private:* keyword along with your private variables etc... after it.
@williamhall23868 жыл бұрын
I've been following along with your tutorials and changing "Bucky" to "William" so I typed out "Sir William Wallace" and got a good laugh when you said it out as I was thinking it.
@stopmotiontacos11 жыл бұрын
I know it's tough, what helped me to internalize what he said was writing my own program that used the things I learned in the video, i.e. making an Object Oriented simple calculator.
@faizanbaber7 жыл бұрын
Bucky you beauty!!! Really appreciating your all these tutorials.. you just saved my ass in tomorrow's labtask
@tienhunglam2403 жыл бұрын
i'm a newbie from VietNam, what u teach is easy to understand. Thanks a lot
@Dooskta12311 жыл бұрын
x is just a random variable chose to represent a value. x in this case represents whatever string is inserted in bo.setName(); We decided that x would represent it when we said void setName(STRING X) and that is linked to the bo.setName() object.
@prmchuk11 жыл бұрын
The reason is because Bucky is showing a really simple program that uses a class. A class, really is used to do something really really really specific in your prorgam. And instead of writing the code for something that specific in your main, you create a class for it because its so specific. For example , you might have a program that compares Polygons and so you might create a Rectangle and Triangle class that sets and gets the length and width and a function to find the area and perimeter.
@fairyrarity695312 жыл бұрын
I wanted to say thanks! Your tutorials are pretty much carrying me through my C++ class.
@pinkhippie13511 жыл бұрын
If you use variables as public, it is very easy for some to use that same variable in another function, which would then change all the variables with the same name to the same thing. If each is set specific to their respective function, then you can reuse the variable name while it still being considered a different variable. Like declaring x as a variable in main and then in buckysClass, they are two different variables with the same name, which should hold different values
@asifkaka50528 жыл бұрын
Thanks to you bucky i got 91.5 Marks in my first semister.
@Moonz9712 жыл бұрын
because sometimes you dont want to change the name and you just want it to show up like : cout
@aikolt12178 жыл бұрын
Thank you very much Bucky,you made my learning very easier and i always learn from your videos and seems like i have attached to your videos and you made my life brighter ,you are Genius!
@Emsee886 жыл бұрын
Question: Why do you still need to keep the Private Class with String Name? If your cout
@aronreviour91649 жыл бұрын
keep it up. i dont know what i would do without your tutorials.
@moszczynskieng6 жыл бұрын
Excellent video. You have made so much code I have been looking at today make real sense! Thank you sir!