13. How to program in C# - PROPERTIES - Beginner Tutorial

  Рет қаралды 189,401

Brackeys

Brackeys

Күн бұрын

Пікірлер: 256
@KodKahve
@KodKahve 9 жыл бұрын
I love BRACKEYS... better than professional education.. Thank you so much!!!
@Brackeys
@Brackeys 9 жыл бұрын
Thanks man! I'm glad I can help :)
@noblepredator9264
@noblepredator9264 2 жыл бұрын
A real life example from games makes your videos far more interesting and comprehensible than other videos out there on C#.
@paktofu123
@paktofu123 7 жыл бұрын
I like how you go through it one more time near the end unlike most tutorials that try and speed through it all. Thanks
@arcanaliberta75
@arcanaliberta75 7 жыл бұрын
Maybe now i'm just starter, but once i get success in my life i promise i'll never forget you. And i promise i'll support you as i can. Thank you very much for making such a helpful video.
@darrylwolfe7359
@darrylwolfe7359 5 жыл бұрын
So, its been 2 years. How have you been?
@subliminalcastillo2126
@subliminalcastillo2126 4 жыл бұрын
Success
@TheSorintist
@TheSorintist 3 жыл бұрын
So it's been 4 years, how's it going?
@jofrankyyoesman1335
@jofrankyyoesman1335 3 жыл бұрын
well what about now?
@arcanaliberta75
@arcanaliberta75 3 жыл бұрын
@@jofrankyyoesman1335 ngapain ikut2an woy.. tolong lah. wkwkwk
@TheNorthernRush
@TheNorthernRush 9 жыл бұрын
Been programming in my spare time and this is the first time using getters and setters has made sense in a scenario. Thank you for the vid. :)
@Brackeys
@Brackeys 9 жыл бұрын
Angelo Encarnacion You are welcome! :D
@mostsoul5818
@mostsoul5818 5 жыл бұрын
Bh
@rocketduck44
@rocketduck44 4 жыл бұрын
I know I'm a few years late, but you're a real lifesaver man! I got a OOP test tomorrow, and your videos are so much better than our course material.
@mrdankinator4782
@mrdankinator4782 4 жыл бұрын
epic
@federicobruno2378
@federicobruno2378 5 жыл бұрын
I studied a lot of programming languages at university, such as, C, python, php, android, html, xml javascript and Java, i think C# it's really similar to Java and i'm learning it very fast. I just want to thank you for this free lessons, you are a very good teacher. You got new sub!
@h0g_27
@h0g_27 5 жыл бұрын
This video is fantastic. I could not wrap my head around getters and setters, and after watching this video I finally understand it. Thank you so much.
@Jurdelol
@Jurdelol 7 жыл бұрын
Jesus christ dude, you're the first person to actually tell me what GET and SET actually frigging does! I need this in-depth information in order to understand it myself. Thank you!!
@psalt21
@psalt21 8 жыл бұрын
After watching multiple KZbin videos on this topic this is the absolute best video I've seen by FAR. Using the DateTime.Now example really helped me since I already had a certain amount of context going into this video. I am definitely subscribing to your channel! Thank you for stepping through the code again at the end - it really helped reinforce everything.
@CM-ng1ef
@CM-ng1ef 9 жыл бұрын
As always this was absolutely fantastic. I know you get this a lot but i think i speak for a lot of people when i say PLEASE bring back the challenges at the end. Anyway, fantastic job!
@websurfer5283
@websurfer5283 7 жыл бұрын
After trying to understand this from a book and a few other youtube videos I clicked on. This video has made it clear for me what getters and setters are all about. I understand them now. Thanks Brackeys.
@wasabifunyuns
@wasabifunyuns 7 жыл бұрын
Really, this by far the best explanation of using getters and setters that I've found. Even Msoft's documentation confuses the hell out of me. Mostly watching your videos to review C# since it's been almost half a year since I've done anything with it, but this video stands out to me among the rest. Phenomenal work with coming up with a very basic, yet amazingly explained way to show the use of get/set. I salute you, good sir.
@chrisogle001
@chrisogle001 5 жыл бұрын
I’ve been confused on Getters and Setters for 2 days. Your explanation is fantastic, thank you for making this video.
@Uz986
@Uz986 6 жыл бұрын
i dont normally comment but have to say you explain things really well you are not just explaining syntax or logic but even telling us how and when it is useful for us to use things. would love to see more videos of C# and unity from you.. great work
@cubemaster6707
@cubemaster6707 6 жыл бұрын
This is the best explanation of getters and setters I have ever seen. I finally understand! Thanks a lot!
@aminakbari73
@aminakbari73 7 жыл бұрын
the best way to teach a language , with realistic examples instead of math examples. thanks dude
@rodneyjenman8616
@rodneyjenman8616 4 жыл бұрын
until now i was unclear that get/set limitation is genuinely something i should bother with. you have managed to actually clarify to me why it is genuinely useful: your example that you need to make "set" conditions to stop problems such as colleagues "shortcutting" illegal values into your fields. Which may come from a place of inventiveness rather than clumsiness!
@northernpanda6953
@northernpanda6953 5 жыл бұрын
Det var godt å få en forfriskning på dette. Utrolig hvor fort en glemmer slike ting.
@rodneyjenman8616
@rodneyjenman8616 4 жыл бұрын
extremely clear, easy to watch, no bullshit, useful.
@dolphinextreme48
@dolphinextreme48 8 жыл бұрын
I didn't find the previous videos in the series as hard to understand, given my high school knowledge in programming, but this one I had to watch twice and actually write the code out, getting the errors, and now I kind of understand the concept, very well explained :D
@owencoopersfx
@owencoopersfx 4 жыл бұрын
Dude, thank you so much. I understand so much more about programming now just from going through these videos in the last week. Your explanations are clear and simple to understand and you give some great examples and exercises.
@speedyzolt
@speedyzolt 6 жыл бұрын
Thank you soooooo much! I really understand getters and setters. Very useful. You are so great at explaining in detail each line of code.
@sippinoolongtea
@sippinoolongtea 9 жыл бұрын
I love how he explains things so everyone can understand it. Thanks bro :D
@joaomanta8299
@joaomanta8299 6 жыл бұрын
You teached me in 18 min what my college teacher couldn´t teach i 6 months i think its safe to say he cant teach thank you so much
@bioblade87
@bioblade87 2 жыл бұрын
the first 5 mins of the health example was like a light bulb moment for me! thanks!
@sryndapled4565
@sryndapled4565 5 жыл бұрын
Why do you need to pay money for c# courses when you can find such a perfect tutorials and course in KZbin thank you Brackeys!
@mickcapsouto2270
@mickcapsouto2270 4 жыл бұрын
I love the way you explain things, very thorough. Great job.
@mrdankinator4782
@mrdankinator4782 4 жыл бұрын
yaaaa
@Altaranalt
@Altaranalt 8 жыл бұрын
I'm loving this series. Still struggling a little bit now and then, but the vids are solid.
@andrew3068
@andrew3068 3 жыл бұрын
clear and excellent explanation, 6 years later.
@jackytank
@jackytank 4 жыл бұрын
Honestly! I first come from Microsoft C# Doc and when I learn til the part Property, I have no idea until I got your video cover in, very easy to understand, ....
@mferreira1231
@mferreira1231 4 жыл бұрын
I'm migrating from Java and this are some important details ! Great video, 100% understandable and well explained! Cheers
@lukassrovnal9312
@lukassrovnal9312 3 жыл бұрын
Thank a lot Brackey!! You're the best teacher
@Daymanoahha
@Daymanoahha 2 жыл бұрын
Wow thank you. Been struggling with understanding this subject until now 🐻🐻🐻
@TheMitsosS
@TheMitsosS 6 жыл бұрын
Finally!!!!!! Someone to explain it simply!
@darrinhert9296
@darrinhert9296 9 жыл бұрын
Excellent tut as usual!
@Brackeys
@Brackeys 9 жыл бұрын
Darrin Hert Thank you :)
@marvinchaves1252
@marvinchaves1252 5 жыл бұрын
I been watching like dozens of videos explaining this without getting it..... and the only one who could make me get it was the one who explained in gamer terms XD... Simply genious XD
@BobrLovr
@BobrLovr 4 жыл бұрын
use unity tuts then
@braker37
@braker37 5 жыл бұрын
To me, the most crucial moment of this tutorial was at 06:30. I am new to C# and programming in general. The only language I am comfortable with right now is JavaScript, and after learning it, C# is a pain in the ass. I can't wait to become as comfortable in C# as I am in JS.
@mercuryc6669
@mercuryc6669 9 жыл бұрын
I love this series. It's been super helpful for me. Thanks!
@diliupg
@diliupg 3 жыл бұрын
Merry Christmas Brackeys! Your tutorials still going strong after 5 years. :)
@Alexander_Meyer
@Alexander_Meyer 4 жыл бұрын
Straight to the point and clear, thank you for the tutorial
@eeronat
@eeronat 4 жыл бұрын
Exceptional teaching skill. Subscribed before the end of my first video.
@minh5693
@minh5693 7 жыл бұрын
Thank you so much, i really love all of your videos
@CraigHinrichs
@CraigHinrichs 9 жыл бұрын
+Razvan Tanase It's just like Java in concept except they encapsulate the set and get inside brackets of the field allowing you to use unary operators on the field and get piped to the set and get brackets. These advantages are encapsulation, readability and comprehension than anything else that I know of.
@catleysama
@catleysama 9 жыл бұрын
Awesome to re-watch these!
@omarnazih8529
@omarnazih8529 7 жыл бұрын
I didn't get that from professors and i get it from you you are amazing man
@Eric-pg4ej
@Eric-pg4ej 4 жыл бұрын
thank u i searched a lot for it and didn t understand but i understood you ^^
@oggurk2097
@oggurk2097 8 жыл бұрын
best teacher ever
@deimon451
@deimon451 7 жыл бұрын
Finally! Now i get getters and setters! Don't know why, but, with your explication, it clicked instantly. There's an issue, though, that almost threw away that. Using += and -= proved really confusing to me in this context, because the variable it's actually being get and set "at the same time" here: tom.health += 50; ==> tom.health = tom.health + 50;
@salmankavishgmail
@salmankavishgmail 8 жыл бұрын
Thanks a lot, i was very confused about properties. Very helpful video...
@xxmehmetali1
@xxmehmetali1 4 жыл бұрын
Super duper excellently explained 👍🏼
@vaibhavborole373
@vaibhavborole373 6 жыл бұрын
It really helps alot to understand the concept
@marcusmorrow3900
@marcusmorrow3900 5 жыл бұрын
Excellent explaination. I was creating a game where i used a tutorial that involved using this on a healt bar and didint know why until now. Thanks.
@AHKCHANNEL
@AHKCHANNEL 7 жыл бұрын
plz consider making full programing tutorials ur videos are amazing the quality is unmatched by any other Channel on KZbin
@Karlponken
@Karlponken 8 жыл бұрын
Very good explanation using the health and player references, thanks alot!
@mrdankinator4782
@mrdankinator4782 4 жыл бұрын
yis
@Dippps
@Dippps 5 жыл бұрын
Thanks for free lessons! I wish you good luck.
@streetfighte6
@streetfighte6 Жыл бұрын
i am 7 years late, I found this still useful
@OddStare
@OddStare 6 жыл бұрын
Seriously thank you for existing
@wasp57sr
@wasp57sr 5 жыл бұрын
Thank you so much for all your videos, very helpful! (Better than most I've watched.)
@alvaromp1106
@alvaromp1106 4 жыл бұрын
Cristal clear, thanks!
@conorhorgan183
@conorhorgan183 9 жыл бұрын
The tutorials you make are great! i will definitely think of donating
@TheFlyguy31
@TheFlyguy31 7 жыл бұрын
This tutorial is brilliant.
@LetsTalkBM
@LetsTalkBM 7 жыл бұрын
Thank you, now i understood it, the idea why is well told by you.
@VillagerLifeCraft
@VillagerLifeCraft 6 жыл бұрын
Very useful and clearly explained . Thankyou Brackeys
@vaibhavborole373
@vaibhavborole373 6 жыл бұрын
Thank u sir u r explaining mind-blowing
@lohitpeesapati4423
@lohitpeesapati4423 6 жыл бұрын
Thank you! That made a lot of sense now.
@viktorlernt6063
@viktorlernt6063 4 жыл бұрын
Thanks for great explanation!
@Galluxi
@Galluxi 9 жыл бұрын
I needed this tutorial! Thank you really much :)
@Damjan25
@Damjan25 7 жыл бұрын
awesome tutorial! :)
@forerunners2966
@forerunners2966 5 жыл бұрын
i bought some courses on udemy......but youre explaining it so nicely that i have to donate money to you.
@ChickenSkit
@ChickenSkit 6 жыл бұрын
15:32 did you ment to say "how ever" but failed and said "how eweeee" xD
@raymk
@raymk 4 жыл бұрын
ehehehehehehe
@patricktuftestrand1246
@patricktuftestrand1246 9 жыл бұрын
Fantastic tutorials
@HingalshDealer
@HingalshDealer 3 жыл бұрын
nice Tutorial Brackeys,thanks
@Crisikos
@Crisikos 7 жыл бұрын
great video again, perfectly clear and usefull. thanks a lot
@BeatingStandards
@BeatingStandards 7 жыл бұрын
Awesome, thanks for the easy tutorial.
@arfast-xolotl
@arfast-xolotl 7 жыл бұрын
Incredible tutorials man, thank you very much for all of this
@razt3757
@razt3757 9 жыл бұрын
This might sound stupid but...why does these get and set properties exist? I mean you could just call/set that with a public int getHealth function (or setHealth) which will return _health, right?This is what other languages call "Encapsulation", that's what we are doing in this video, right? like this: private int health; public int getHealth(){ return this.health; } public void setHealth(int health){ this.health= health; } I'm coming from Java programming and this looks really odd to me.Is there some other purpose for these properties, like do they access the memory in a diverse way (perhaps it's faster for the cpu)?
@marijapizdarija7781
@marijapizdarija7781 7 жыл бұрын
Did you ever find out the answer? I'm wondering about the same thing at the moment. :D
@razt3757
@razt3757 7 жыл бұрын
Marija Pizdarija I'm not sure, I haven't been exploring this but to me it looks just like syntax sugar, probably the compiler does the job in your stead. Just like C used to introduce objects in its syntax, but they were just that: "syntax", objects didn't exist at a low level of compiling (ofc that's a different story today), the syntax helped you to write them. I think the same happens here, the compiler manages these properties in background for you and actually treats them as methods.
@prototypeinheritance515
@prototypeinheritance515 6 жыл бұрын
It removes the boilerplate code of the setters and getters. Faster to write
@michaelkennielsen1422
@michaelkennielsen1422 6 жыл бұрын
I am watching these videos as a supplement to my education and i'm basicly doing what you are saying. My teacher told me there are like 4-5 different ways of doing it but this is one of the easier ones to understand when you are starting out
@jvsnyc
@jvsnyc 6 жыл бұрын
The answer is that you aren't just saving boilerplate, but you are no longer guessing at what the names will be, also, yes, syntactic sugar, but it is one less thing to remember, or perhaps two fewer things. There is exactly one place that does verification of setting of the private instance variable, even from the rest of the class methods, you know exactly how to call it and don't need to remember what name you called it. Sure, you can do it "by convention" but there are as many conventions as there are teams...
@philippeleduc9464
@philippeleduc9464 7 жыл бұрын
Excellent tutorial! Subscribed.
@louis-etiennemessier7623
@louis-etiennemessier7623 6 жыл бұрын
Really awesome video !!
@skillshotbulgaria7353
@skillshotbulgaria7353 8 жыл бұрын
Pretty good tutorials! Helped me alot! You are awesome!
@adigunademola8360
@adigunademola8360 6 жыл бұрын
Thank you very much for this!
@MichelVilarino
@MichelVilarino 9 жыл бұрын
Great Video Brackey, looking forward to see the rest of the series, is there any chance you will release video more often?? would love to get to the needy-greedy parts of C# and get to the advanced topics of the C# language. And once again thanks.
@LanceGHall
@LanceGHall 7 жыл бұрын
You earned my subscription
@_noizmusic
@_noizmusic 7 жыл бұрын
Such amazing tutorials, man! Wish I found these earlier haha.
@maxhatfull3949
@maxhatfull3949 8 жыл бұрын
Do you have any videos explaining static methods/classes? Your videos make it all so much clearer
@eldanx
@eldanx 8 жыл бұрын
The getters and setters are definitely interesting when compared with Java or C++ where they are just conventional methods.
@bhupatirajusriramvarma8923
@bhupatirajusriramvarma8923 5 жыл бұрын
I kind of confused with when to use the parentheses , can you please clarify it for me?
@TheJaniable
@TheJaniable 7 жыл бұрын
Hi! Where should I continue? Do you have a series that continues this one? I want to make games, beginning with Snake :)
@roei922
@roei922 9 жыл бұрын
Thank you very much!
@hiderr6805
@hiderr6805 4 жыл бұрын
Just big THANK YOU!
@sumrandumGI
@sumrandumGI 9 жыл бұрын
great video! I'm ready for the next :D
@madhavgupta740
@madhavgupta740 2 жыл бұрын
Great Explanation!!! I've one question: Can we define "property" without associating it with any "field"? I mean inside getter or setter, can we write any logic without using any "field"?
@doozku450
@doozku450 8 жыл бұрын
Deserves more likes.
@Danyu91
@Danyu91 5 жыл бұрын
does _health specifically have to equal "value"? or can you use another word in substitute to "value""? and is there anything other than return that you can use in the get property?
@TheVictor119
@TheVictor119 8 жыл бұрын
YOU'RE THE BESTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
@trieuqtran
@trieuqtran 6 жыл бұрын
Amazing tutorial!!!
@flawlessflowerSky
@flawlessflowerSky 6 жыл бұрын
I hope u make a video on the stack stuff , linked list and so on , I need them soo much ....
@Lhoang1999
@Lhoang1999 9 жыл бұрын
In this example, the Player class is inside the MainClass class. I am a beginner and normally see two separate classes in other examples. Does it make a diff. if the Player class is inside or outside?
@leluong8743
@leluong8743 6 жыл бұрын
It doesn't make any difference as long as it inside the namespace.
@GBartz21
@GBartz21 3 жыл бұрын
"This might look a bit confusing to you" Actually it's the first time it makes a bit sense..
@The-cyber-imbiber
@The-cyber-imbiber 5 жыл бұрын
Brackeys are you shitting me? I hardly ever see anybody more clearly teach topics as complicated as this (save for the Khan Academy videos). Cheers.
14. How to program in C# - INTERFACES - Tutorial
27:17
Brackeys
Рет қаралды 241 М.
11. How to program in C# - INHERITANCE - Beginner Tutorial
14:08
When u fight over the armrest
00:41
Adam W
Рет қаралды 24 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
PIZZA or CHICKEN // Left or Right Challenge
00:18
Hungry FAM
Рет қаралды 15 МЛН
Getters & Setters | C# | Tutorial 28
12:09
Giraffe Academy
Рет қаралды 195 М.
Best Games from the Brackeys Game Jam 2024.2!
13:53
Brackeys
Рет қаралды 110 М.
How to Learn to Code FAST (Do This or Keep Struggling)
11:00
Andy Sterkowitz
Рет қаралды 716 М.
10. How to program in C# - CLASSES - Beginner Tutorial
18:58
Brackeys
Рет қаралды 314 М.
8. How to program in C# - METHODS - Beginner Tutorial
17:08
Brackeys
Рет қаралды 315 М.
the TRUTH about C++ (is it worth your time?)
3:17
Low Level
Рет қаралды 755 М.
What are Interfaces? (C# Basics)
13:54
Code Monkey
Рет қаралды 211 М.
BASH scripting will change your life
14:18
NetworkChuck
Рет қаралды 1 МЛН
Properties were getting even cleaner in C# 11
8:12
Nick Chapsas
Рет қаралды 57 М.
When u fight over the armrest
00:41
Adam W
Рет қаралды 24 МЛН