Тёмный

C# Access Modifiers (beyond public and private) - what they are, how to use them, and best practices 

IAmTimCorey
Подписаться 422 тыс.
Просмотров 238 тыс.
50% 1

Опубликовано:

 

15 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 211   
@JDogB-tc3lx
@JDogB-tc3lx 6 месяцев назад
Tim you might not ever read this comment, but I just want to tell you how incredibly thankful I am that I found your channel about 3 years ago. You have helped me develop into a very good senior programmer, I have a better job now with more money and I can't begin to tell you how much better my life has become after going through all your courses. I truly mean it. You're an incredible teacher.
@IAmTimCorey
@IAmTimCorey 6 месяцев назад
I appreciate the kind words. I'm glad my content has been so helpful to you. Thanks for sharing!
@nilomartinezjr4108
@nilomartinezjr4108 13 часов назад
It is October 2024 and this video and many others you´ve made have been very helpful. I am migrating from C++ and Visual Basic .NET and this is the best content I´ve found so far in the internet. I truly appreciate it.
@mrterrbl8184
@mrterrbl8184 6 лет назад
Just... Thank you for existing.
@IAmTimCorey
@IAmTimCorey 6 лет назад
lol thanks.
@nacional8
@nacional8 6 лет назад
Lol, I'm going to start saying this
@podmars8016
@podmars8016 4 года назад
thank his parents
@shahzaibhassan2777
@shahzaibhassan2777 3 года назад
😂... Really!
@Noble_Savage
@Noble_Savage Год назад
I couldn't wrap my head around internals, but now I understand! So many people just say "assembly" and expect me to know what it means!
@IAmTimCorey
@IAmTimCorey Год назад
I am glad it was so helpful.
@ELENTE_
@ELENTE_ 3 года назад
Dude.. Im just 9 minutes into the video and I just discover you’re the best teacher of the universe.
@IamPali2024
@IamPali2024 3 года назад
I have been a c# dev for over 10 years and I still enjoy your content. Especially with interview questions I have proper answers for interviewers. Thanks man you’re the best
@IAmTimCorey
@IAmTimCorey 3 года назад
Great to hear!
@johnpulwers680
@johnpulwers680 4 года назад
31:32 - "Why not make everything public" I love the way Tim explains the same thing from different angles numerous times to solidify and crystalize the knowledge transfer so as to make it CONCRETE! This is a man who taught this stuff at the college level for more than 5 years. He's not only knowledgeable and understandable, but he really knows HOW TO TEACH. My only complaint is that he doesn't teach EVERYTHING.
@IAmTimCorey
@IAmTimCorey 4 года назад
I'm thinking about expanding into courses on hair styling.
@johnpulwers680
@johnpulwers680 4 года назад
@@IAmTimCorey It'd be HARD to practice on us.
@Pupiniasz
@Pupiniasz Год назад
That part is actually a lot of bullshit. Since when having the CC number as public is a security risk but having it private isn't? lol, I will easily get private stuff using reflection. The point of private stuff is to organize your code and your APIs, some stuff is too much implementation detail that it doesn't make sense to expose it, what it makes sense to expose you set it as public or internal, depending on what is your intention.
@vinodshanker3533
@vinodshanker3533 3 года назад
There are those who gives meaning, and there are those who gives people a chance at a career for better lives, you are both, thank you so much Tim Corey, thank you.
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 года назад
Thank you, that is very gracious and much appreciated.
@ShatteredSurface
@ShatteredSurface 4 года назад
Thanks for the vids, Tim! Whenever I google something specifically C# related I now add your name to it since you explain things so well. Thank you so much for providing amazing, clear, and useful explanations on these topics.
@IAmTimCorey
@IAmTimCorey 4 года назад
Awesome! I’m glad my content has been so helpful.
@STUPIDYOUTUBE_HIDINGMSGS
@STUPIDYOUTUBE_HIDINGMSGS 4 года назад
He's gladly sharing his knowledge and making good use of his Microsoft MVP status...
@anthonychurch1567
@anthonychurch1567 Год назад
Thanks Tim. I came back to this again as I felt confused about how it relates to Unit tests where the code m
@IAmTimCorey
@IAmTimCorey Год назад
You are welcome.
@sirgravacado4885
@sirgravacado4885 5 месяцев назад
Thank you for this explanation. I took C++ in college many years ago but never really pursued a developer type career. Recently I have been rethinking that choice and it's clear videos like this that make a big difference for me. This not only explains the What and How for scope, but continues to explain Why it's important.
@IAmTimCorey
@IAmTimCorey 5 месяцев назад
I am glad it was helpful.
@amnesia3490
@amnesia3490 4 года назад
Better than my half year part of university education about OOP . Makes more sense and clear thanks.
@IAmTimCorey
@IAmTimCorey 4 года назад
I am glad it was clear.
@danielgoss634
@danielgoss634 3 года назад
Best explanation of Access Modifiers I have ever come across ! Thank you Tim !
@IAmTimCorey
@IAmTimCorey 3 года назад
You are welcome.
@shentwty
@shentwty 4 года назад
Thanks Tim. Appreciate all the time and effort put into this video to explain the concept of modifiers. Like your pace, the simple examples that make your videos stand out. What I like more is you getting into details when needed, explaining the WHY and WHERE - a developers dream come true (saving my search on google).
@IAmTimCorey
@IAmTimCorey 4 года назад
I am glad you get that much value out of my content.
@suganthibaskaran5753
@suganthibaskaran5753 4 года назад
You are the best C# Tutor in the entire Planet
@IAmTimCorey
@IAmTimCorey 4 года назад
I appreciate the kind words.
@kopilkaiser8991
@kopilkaiser8991 Год назад
⭐️⭐️⭐️⭐️ star tutorial. You are the best in being capable to explain all the logic accurately and simply. This helps one to understand the complex logic easily and practicing helps a lot in consuming the knowledge better. Your approach in explaining first alongside showing it practically helps to visualise and consume the topic better. I'm more inclined to learn ideas and logics visually and this assited me to dive deep. Thank you for all your efforts. I will surely, go through all the topics in advanced C# playlist and expecting to evaluate and improve my existing skills.
@IAmTimCorey
@IAmTimCorey Год назад
You are welcome.
@jn10r72
@jn10r72 4 года назад
Best explanation of access modifiers, period. Thanks Tim, this video was massively helpful in helping me understand the use cases for each of these modifiers.
@IAmTimCorey
@IAmTimCorey 4 года назад
Glad it was helpful!
@stratman1234
@stratman1234 4 года назад
You're so right about forgetting to use 'internal'. I'm going to update my code today.
@IAmTimCorey
@IAmTimCorey 4 года назад
I am glad it was helpful.
@heradsinn
@heradsinn 4 года назад
Dude your tutorials are just amazing. Life saver for upcoming internship^^
@IAmTimCorey
@IAmTimCorey 4 года назад
Best wishes on your internship.
@danielwhitaker9021
@danielwhitaker9021 3 года назад
Tim, thank you for your videos and explanations. I've seen others who only explain the what and the how. You also explain the why with real world examples and I really appreciate that. Keep up the good work!
@IAmTimCorey
@IAmTimCorey 3 года назад
You are most welcome. Thanks for watching.
@kopilkaiser8991
@kopilkaiser8991 Год назад
Thank you for everything you do.❤ lot of love towards your hard work and dedication in teaching us (your pupils)
@IAmTimCorey
@IAmTimCorey Год назад
You are welcome.
@ZoidbergForPresident
@ZoidbergForPresident 6 лет назад
ProtectedInternal -> Protected OR Internal PrivateProtected -> Private AND Protected
@IAmTimCorey
@IAmTimCorey 6 лет назад
👍
@thomschery2800
@thomschery2800 4 года назад
PrivateProtected -> Private AND Protected - but only in the assembly in which it was declared
@torrvic1156
@torrvic1156 7 месяцев назад
Thank you so much for clarification Tim! It made it more clear. However I think that those private protected and protected internal are really exotic ones and I can’t imagine the case where one can need those access modifiers.
@IAmTimCorey
@IAmTimCorey 7 месяцев назад
They aren't as commonly used.
@kavishbamboli9457
@kavishbamboli9457 3 года назад
Such a great video. It cleared all of my confusions regarding access modifiers and I believe i can make effective use of it. Thank you.
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 года назад
That's great to hear, thanks for sharing.
@adamlasry5225
@adamlasry5225 2 года назад
Best teacher ever! Thank you.
@IAmTimCorey
@IAmTimCorey 2 года назад
You're very welcome!
@ffx178
@ffx178 2 года назад
Bro I just love your detailed explanation it helps a lot in building concepts
@IAmTimCorey
@IAmTimCorey 2 года назад
Thanks!
@0xbitbybit
@0xbitbybit 3 года назад
Awesome Tim, to be honest the hardest part for me is what you touched on at the end, piecing a project together and mapping things together, that's been one of the most confusing things in my journey to learn C# and .NET, can you recommend any vidoes that might help with this? Stuff like this one is great, where you have multiple assemblies and explain the modifiers and how they work in the different assemblies. Thought I'd ask if you have any videos on overall project structure and mapping things out, or the best practices for building different types of apps etc. especially web apps! Thanks for your help!
@simplelivinghighthinking5520
@simplelivinghighthinking5520 Месяц назад
Tim you can start the story telling by saying access modifiers are a sort of selectivity and visibility based on functional needs of a system and describe the modifiers by giving context domain like the components of a car. This will help c# developers visualize the use case.
@IAmTimCorey
@IAmTimCorey Месяц назад
Thanks for sharing.
@nagasudhirpulla
@nagasudhirpulla 4 года назад
I learnt using propfull from this video, thanks for a great video.
@IAmTimCorey
@IAmTimCorey 4 года назад
Excellent!
@JackNotJack
@JackNotJack Год назад
Another excellent and clearly explained video. Massive thumbs up! Thanks Tim.
@IAmTimCorey
@IAmTimCorey Год назад
You are welcome.
@themusic1609
@themusic1609 2 года назад
Awesome explanation Thanks! And Merry Christmas
@IAmTimCorey
@IAmTimCorey 2 года назад
You are welcome.
@raki1190-y7i
@raki1190-y7i 2 года назад
Comprehensive and best video on the topic ❤
@IAmTimCorey
@IAmTimCorey 2 года назад
Thanks!
@srinivaslagadasani5117
@srinivaslagadasani5117 3 года назад
Really an extraordinary explanation along with demos 🙏🙏🙏
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 года назад
Thanks for investing your time with Tim
@rus89
@rus89 3 года назад
Hey Tim, thanks a bunch for your comprehensive explanation about access modifiers, and for the time and effort you put into this 💪 I understood that the DRY principle is one of the most simple yet powerful principles to learn. What other principles do you recommend? Thanks in advance
@IAmTimCorey
@IAmTimCorey 3 года назад
I also recommend checking out SOLID: ru-vid.com/group/PLLWMQd6PeGY3ob0Ga6vn1czFZfW6e-FLr
@andrewshwets1316
@andrewshwets1316 4 года назад
Thank You Tim for sharing your experience with us!
@IAmTimCorey
@IAmTimCorey 4 года назад
My pleasure!
@AliMohammed-hr4te
@AliMohammed-hr4te 3 года назад
Thank you very much, Tim, very helpful and easy tutorial for a complex subject
@IAmTimCorey
@IAmTimCorey 3 года назад
Glad to hear it
@vishwasshukla4414
@vishwasshukla4414 3 года назад
This was a really good video. Thanks for the examples.
@IAmTimCorey
@IAmTimCorey 3 года назад
You are welcome.
@andyhair4665
@andyhair4665 3 года назад
Very useful. Clear and concise. Thanks Tim
@IAmTimCorey
@IAmTimCorey 3 года назад
Glad it was helpful!
@andyhair4665
@andyhair4665 3 года назад
@@IAmTimCorey It really was. Love your channel Tim, keep up the good work :)
@MiikaKontio
@MiikaKontio 3 года назад
Great and easy to understand explanations. Do u have tutorial about when to use static methods and variables and properties?
@IAmTimCorey
@IAmTimCorey 3 года назад
I don't believe so on RU-vid. I cover that in my Foundation in C# course series. Basically, use properties whenever you need to make the data available outside the class (no public variables). As for static methods, you use them in a few cases, but mainly when you don't need to use them only in a specific instance of a class.
@MiikaKontio
@MiikaKontio 3 года назад
@@IAmTimCorey sorry if I was bit of a ambiguous. What I meant to ask was when to use static methods, static variables and static properties? I see those sometimes in my company's code base and they are sometimes a pain in the ass. Like if some configurations area loaded from config (basically xml) file to a private static variable, in order to get those configs to change for the web application, I have to restart the whole damn application. Sometimes I change them to public static variables so that I can make them changeable from other places without restarting the whole app.
@MiikaKontio
@MiikaKontio 3 года назад
Which kind of defeats the whole purpose of configs that can be changed from the fly as the application is running.
@pawel89pawel
@pawel89pawel 3 года назад
Hi Tim. As all your videos this one is just amazing however I have a question about one more ?modifier? - static. How do I know where and when should I put it and what are the consequences of it? I don't know if You already covered it somewhere else - if so than sorry for asking in the wrong chapter. Thank You for the video once more.
@IAmTimCorey
@IAmTimCorey 3 года назад
I cover that in the Foundation in C# course series, but I don't think I have a specific video of it on RU-vid. Basically, static means you cannot instantiate the class. You get one copy that everyone uses instead of creating instances. Default to instantiation unless there is a really good reason to use static.
@florianfeith
@florianfeith Год назад
I just stumbled over your channel and so far really enjoy it. A thought about accesss modifyers: Would't event be an access modifyer which makes a field of a delegate type accessible externally with += and -= only? I at leas like to think about it that way.
@IAmTimCorey
@IAmTimCorey Год назад
Delegates/events have access modifiers of their own in order to control that.
@acidhauss7018
@acidhauss7018 5 лет назад
I used to think why bother I’m the only developer, who cares if it’s public or private or protected for a small app _ then my friend ripped apart my app showing me all my classes using reflection and a decompiler. Lesson learned!
@IAmTimCorey
@IAmTimCorey 5 лет назад
Yep, it can be a big problem.
@peterdumhart6337
@peterdumhart6337 3 года назад
I've only known your channel for a few days but I've already watched a lot of your videos. Thank you for your great videos, even after many years as a programmer I can still learn something from you. I have a question for which I haven't found a video from you yet, but maybe I just haven't watched the right video yet. I would be interested to know if you think it makes sense to use private properties instead of private fields? In the application framework in which I mainly work, it has become common practice that private fields are hardly ever used. And I still don't know whether that makes sense or not. Or whether it actually makes a difference. Many thanks and best regards Peter
@IAmTimCorey
@IAmTimCorey 3 года назад
There are only a couple of reasons I can see to use private properties: 1 - If you are expecting to make them public someday. 2 - If you want to limit the input/output of them. Otherwise, I do not see the benefits. I would ask them what benefits the private properties give them over private fields.
@peterdumhart6337
@peterdumhart6337 3 года назад
@@IAmTimCorey thanks a lot for your reply! It is so great that you take the time to answer all these questions. I will ask them because in most cases it really makes no sense to me - thanks!!
@nafisiancastle
@nafisiancastle 3 года назад
Thank you so much. You are a great teacher.
@IAmTimCorey
@IAmTimCorey 3 года назад
You are welcome.
@Robert723
@Robert723 Год назад
Cool video, thanks!
@IAmTimCorey
@IAmTimCorey Год назад
You are welcome.
@mikey803
@mikey803 4 года назад
Thanks for that. I have to confess that I was guilty about using "public" and creating "global public" variables. I am learning to rethink things and make the accessing more stricter. I am working on redoing access modifiers. There was one class that I saw that uses "Sealed". Is that a popularly used one or one that is being discontinued?
@IAmTimCorey
@IAmTimCorey 4 года назад
It is still used but it is a niche use. Sealed means other classes cannot inherit from the class.
@AvinashKumar-dr1nv
@AvinashKumar-dr1nv 2 года назад
Love you man!!
@IAmTimCorey
@IAmTimCorey 2 года назад
Thanks!
@Strrroke
@Strrroke 3 года назад
Amazing explanation. Thank you very much!
@IAmTimCorey
@IAmTimCorey 3 года назад
You are welcome!
@winnielWinnieLim
@winnielWinnieLim 3 года назад
thank you so much!! you clear all my confusion.
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 года назад
Tim loves to help folks be successful. Thanks for watching.
@AL-kn4yx
@AL-kn4yx Месяц назад
Very helpful. Thanks!
@IAmTimCorey
@IAmTimCorey Месяц назад
You're welcome!
@LuigiZambetti
@LuigiZambetti 6 лет назад
Hi Tim, what do you think of CQRS (Common Query Responsibility Segregation)? Could be a good topic for your upcoming videos?
@IAmTimCorey
@IAmTimCorey 6 лет назад
This is one of those edge patterns that is only useful in a few scenarios. The basic idea is that you separate out your database read code from your database write code (vast over-simplification). There are very few cases where this separation adds value to your application but there are a lot of cases where you would cause more complexity without added value. There is a case for it, but I shy away from things that people will watch and then try to implement. It is almost certain that they will be implementing it in the wrong situation if they try to do so with CQRS (it is valuable typically in a part of a large, complex application).
@LuigiZambetti
@LuigiZambetti 6 лет назад
I agree, and I don't understand why is so requested in job interviews.
@IAmTimCorey
@IAmTimCorey 6 лет назад
Job interviews are tough. The interviewer needs to identify the most skilled person for the job but that really is subjective. They try to make it objective but that gets you poor results at best.
@muhammadzeshawn3883
@muhammadzeshawn3883 6 лет назад
Hi tim please made a video on c# sockets.. RU-vid don't have any good videos on sockets topic .. So please consider this topic.
@IAmTimCorey
@IAmTimCorey 6 лет назад
I'll add it to the list of suggested topics.
@muhammadzeshawn3883
@muhammadzeshawn3883 6 лет назад
IAmTimCorey Thanku
@akshitdas2012
@akshitdas2012 3 года назад
Hey Tim... Just a question out of curiosity.... Is it rational to use "protected" along with some inheritance rather than using "public"?
@IMADETHISACCFORRAY
@IMADETHISACCFORRAY 5 лет назад
Tim, is your main language C#? I think you really put out some great content. I'm at UNI studying towards MS stack and using a lot of your insights as an addition is so good to me. Thanks for your hard work, I hope you make plenty of money on it.
@IAmTimCorey
@IAmTimCorey 5 лет назад
Right now, yes. However, that has fluctuated over the years depending on the needs of where I worked. It has almost always been a primary language of mine since it came out but I've worked heavily with JavaScript, SQL, C, C++, VB.NET, VB6, and more. Along the way, I've also worked in a bunch of secondary languages (Java, objectiveC, FoxPro, etc.) as well. The trick is to learn one language well and get really familiar with the concepts of development. Then you can much more easily switch languages because it is a similar expression of logic with just a change in syntax. The harder transitions are OOP to functional languages, but you still have a good base to work with.
@victorhht3722
@victorhht3722 2 года назад
Hi, Tim, when experimenting on my own in the Visual Studio, I notice that protected private also works, then I searched the web but no where to be found, could you explain a little? (I also realize that private internal equals internal, so there is no such thing) 🤠
@shareeftabakhi1545
@shareeftabakhi1545 3 года назад
I am so gonna watch all the videos
@IAmTimCorey
@IAmTimCorey 3 года назад
Best of luck. There's over 250 of them. 😂
@mrenjay5300
@mrenjay5300 4 года назад
Thanks so much Tim. God Bless You.
@IAmTimCorey
@IAmTimCorey 4 года назад
You are very welcome
@unlxck3255
@unlxck3255 2 года назад
So basically everything that is internal can be accessed in every other class as long as its in the same namespace?
@devilkiller13579
@devilkiller13579 2 года назад
Basically, yes
@andreja107
@andreja107 3 года назад
It's probably me who didn't fully understand this, but isn't he making a mistake at 21:40? Shouldn't protected internal behave as internal in its own assembly and as protected for any other assemblies? And not the other way around as he is saying?
@somethingdarkinside
@somethingdarkinside 3 года назад
yeah, who does inheritance in oop language anyway right?
@IAmTimCorey
@IAmTimCorey 3 года назад
It isn’t as common as people initially think , but it is still something that you do. Why?
@ahmadmohamad8416
@ahmadmohamad8416 3 года назад
thank you this was so helpful
@IAmTimCorey
@IAmTimCorey 3 года назад
You are welcome.
@nexthor2007
@nexthor2007 2 года назад
Thanks!
@IAmTimCorey
@IAmTimCorey 2 года назад
Thank you!
@jiangyz
@jiangyz 5 месяцев назад
I think it's very easy to understand these , but for beginners it's better to offter a nested scope graph to explain these keywords's functional scope.
@ezeewin6741
@ezeewin6741 4 года назад
Just out of interest, do internal classes have any added benefits to a "normal" class (i.e a non-public class), or are "normal" classes marked internal by default.
@IAmTimCorey
@IAmTimCorey 4 года назад
Nope. Internal is implied if you don’t specify something different.
@InsidiousRat
@InsidiousRat 5 лет назад
Great video, as always! But maybe you can help me figure out... What's the default access state of a class? It is not public, but also not private. I've noticed that a class without any access modifier can be used inside the project(assemly), but not outside of it. So it looks like all classes are internal by default (if they have no other modifiers). Am I right?
@IAmTimCorey
@IAmTimCorey 5 лет назад
Correct. A class is "internal" by default.
@adarsh902
@adarsh902 5 лет назад
@@IAmTimCorey But then nested classes can be private, right ? And what can be the use of it ? (Since it is allowed)
@wetshredder4962
@wetshredder4962 4 года назад
Never knew 40minutes could feel so short for a coding video
@IAmTimCorey
@IAmTimCorey 4 года назад
Thanks
@farrukhazad
@farrukhazad 3 года назад
nice work
@IAmTimCorey
@IAmTimCorey 3 года назад
Thank you!
@techmarcs
@techmarcs 5 лет назад
@Tim, Wondering if you have a video on Partial classes and structs. A video on those will be useful. Thanks.
@IAmTimCorey
@IAmTimCorey 5 лет назад
Not yet but I can add them to the list.
@techmarcs
@techmarcs 5 лет назад
@@IAmTimCorey thanks!
@emno-solodev5065
@emno-solodev5065 4 года назад
*private* (outer) *protected* (inner) -> It behaves as *private* from outside the assembly and *protected* from inside the assembly *protected* (outer) *internal* (inner) -> It behaves as *protected* from outside the assembly and *internal* from inside the assembly
@IAmTimCorey
@IAmTimCorey 4 года назад
Thanks for sharing.
@aaronmitcham8797
@aaronmitcham8797 3 года назад
If your the only developer on a project is the private mindset that important? I was under the impression that once compiled methods wouldn't be accessible.
@IAmTimCorey
@IAmTimCorey 3 года назад
They are accessible even after being compiled.
@aaronmitcham8797
@aaronmitcham8797 3 года назад
@@IAmTimCorey Ok, the added private mindset makes sense then. Thank you for the reply.
@tagfat
@tagfat 4 года назад
"An access modifier in C# specifies who can see and use a resource." Just what I was looking for. But nothing in the first part of video builds on this. What do I need to look for in order to find information about limiting access to private pages to the page owner?
@IAmTimCorey
@IAmTimCorey 4 года назад
Pages? Do you mean classes or are you talking ASP.NET? If the former, this video covers that. It walks through your options and which ones give who access. If the latter, that's a different technology.
@tagfat
@tagfat 4 года назад
@@IAmTimCorey No. I dont mean classes. And no, not ASP.NET. I need to let users create content and have them store that content and review it later. What kind of structure is less important, but i need to control the access. So pages, content, endpoints or what you want to call it, but data that I can "specify who can see and use".
@IAmTimCorey
@IAmTimCorey 4 года назад
So what you are looking for is authentication and authorization. I do have videos on that for ASP.NET MVC as well as the TimCo Retail Manager, which uses WebAPI and has auth on a WPF app.
@tagfat
@tagfat 4 года назад
@@IAmTimCorey Thank you! It is so hard to find the relevant information, if you dont know the right phrases to search for.
@khiladibabu
@khiladibabu 3 года назад
someone asked me how we can do calculation on numbers, which are beyond the limit of variable ? could you please suggest me from where can learn it
@_grzehotnik
@_grzehotnik 3 года назад
biginteger, bigrational
@khiladibabu
@khiladibabu 3 года назад
@@_grzehotnik thanks , will explore these topics, It would be really helpful for me If you make a video on it. Thanks
@drip888
@drip888 2 года назад
whats the difference between public string str; and public string str { get; set; }
@IAmTimCorey
@IAmTimCorey 2 года назад
The first is a field, the second is a property. You cannot bind to a field. You also cannot protect a field like you can with a property. Also, if you change a field in any way, it requires you to recompile all applications that depend on that field. This is not true with properties. The list goes on, but the basic answer is to not use public fields, only public properties.
@drip888
@drip888 2 года назад
@@IAmTimCorey oh wow. I love the detailed explanation. Thank you sir 🙂
@lilin3005
@lilin3005 2 года назад
Public and Private are definitely useful and necessary. Protect and Internal can be used to cover some edge cases, nice to have in real life. The other two are just dumb ideas in my opinion
@IAmTimCorey
@IAmTimCorey 2 года назад
They all have their uses. Some are just more common than others.
@christellannmataac559
@christellannmataac559 4 года назад
Thank you 👍
@IAmTimCorey
@IAmTimCorey 4 года назад
You are welcome
@kgravikumar
@kgravikumar 4 года назад
Very nice
@IAmTimCorey
@IAmTimCorey 4 года назад
Thanks
@mrx.2233
@mrx.2233 4 года назад
Hi Tim, why don't you create courses on Udemy. Create a full project. Windows first, ASP.NET MVC second and then with that introduce SOLID principles, also including good programming techniques, add then WCF, WEB API and spread out using these projects as a basis for another course on MicroServices. Just a suggestion. I always pay for courses on Udemy and they are affordable. Thanks for this video. Take care.
@IAmTimCorey
@IAmTimCorey 4 года назад
I did offer a course on Udemy: www.udemy.com/course/which-aspnet-core/?couponCode=MOVINGSALE The experiment did not go well, unfortunately, and I won't be offering more courses on the platform. I see about 16% of the income of what I see on my site and no, the number of people who buy my course does not make up for it. Total income is about 30% of what I would get on my site and I more than double my support needs.
@DeeArr
@DeeArr 4 месяца назад
I think a venn diagram is in order.
@yohannesyigezu1756
@yohannesyigezu1756 3 года назад
thanks
@IAmTimCorey
@IAmTimCorey 3 года назад
Welcome
@josephmarsh5031
@josephmarsh5031 6 лет назад
Is "readonly" not an access modifier?
@IAmTimCorey
@IAmTimCorey 6 лет назад
It is a modifier (like abstract, async, const, and more) but it is not an access modifier. Access modifiers determine who can see/use an item. Readonly doesn't restrict who can see it/use it but rather how it can be used.
@josephmarsh5031
@josephmarsh5031 6 лет назад
IAmTimCorey ah... thanks!
@saintmaloj
@saintmaloj 4 года назад
@@josephmarsh5031 the keyword "readonly" is used to declare an immutable variable. i.e. A variable whose value, once assigned, cannot be changed. It's a modifier but not an access modifier!)
@NAKIGOEORG
@NAKIGOEORG Год назад
I live in Russia private static Hell. Anyone inviting me to a public US class?
@torrvic1156
@torrvic1156 7 месяцев назад
Ha ha! Nice joke! It depends only on you if you can refactor this class to become public 😅It seems like US class is closed for modification already 😊
@harjeetguitar
@harjeetguitar 4 года назад
You missed Sealed
@IAmTimCorey
@IAmTimCorey 3 года назад
Yep.
@chakravarthye
@chakravarthye 4 года назад
You rockkkkk
@IAmTimCorey
@IAmTimCorey 4 года назад
I roll with it. LOL - Thanks.
@fredzimmerman142
@fredzimmerman142 4 месяца назад
You forgot the sealed class modifier.
@IAmTimCorey
@IAmTimCorey 4 месяца назад
Sealed is a keyword, but it is not considered an access modifier.
@al-omdaahmed3191
@al-omdaahmed3191 5 лет назад
god bless you
@IAmTimCorey
@IAmTimCorey 5 лет назад
Thank you!
@raulblotor9205
@raulblotor9205 4 года назад
22:00
@tytoeu7177
@tytoeu7177 4 года назад
You not explain first I don't understand 😐
@IAmTimCorey
@IAmTimCorey 4 года назад
If you have not already, please consider checking out this video - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-LUv20QxXjfw.html It is intended to help you assess where you are and the topics you need to add to your base skills. I hope it will help you fill in any gaps. My goal is to make becoming a developer easier and I hope I can help you be successful through your full journey!
@johnpulwers680
@johnpulwers680 4 года назад
Methods are inside Classes. Most people only use Public and Private Methods. Public and Private are Modifiers to Allow or Block Access to them. Tim shows how to use Methods that can share functionality and data. These are called ACCESS MODIFIERS. He talks about 13 different types.
@commandconquer5338
@commandconquer5338 Год назад
bro 46 minutes for one simple concept, no thanks. You made it as confusing as possible and as long winded as possible.
@IAmTimCorey
@IAmTimCorey Год назад
I'm curious if you actually watched the video fully or just assumed you know it. For instance, do you understand the difference between protected internal and private protected? That's a simple concept to you? If so, I'm not sure why you were watching the video in the first place. And by the way, it only took 22 minutes to cover access modifiers as concepts (private, public, protected, private protected, and protected internal). The rest of the video was on how to use these in the real world and why we don't just use public and private for everything.
@torrvic1156
@torrvic1156 7 месяцев назад
@@IAmTimCoreydon’t listen to such people Tim. You videos have an excellent length and explain things very thoroughly and I am sure that many people like me just like it that way.
@elhambeydaghi6458
@elhambeydaghi6458 Год назад
very helpful thanks
@IAmTimCorey
@IAmTimCorey Год назад
You are welcome.
@matt9897
@matt9897 2 года назад
I don’t understand why I don’t just make everything public so I don’t have to deal with this. I’m sure there’s a reason, I just don’t get it. This seems like extra work for nothing.
@matt9897
@matt9897 2 года назад
Oh. Here we go.
@IAmTimCorey
@IAmTimCorey 2 года назад
I am glad you figured it out
@matt9897
@matt9897 2 года назад
@@IAmTimCorey I am glad I had your help.
@AlmontasL
@AlmontasL 4 года назад
TO complicated explantaion
@IAmTimCorey
@IAmTimCorey 4 года назад
Have you found a simpler way to explain it? These are complicated topics.
@johnpulwers680
@johnpulwers680 4 года назад
I think you meant to say, "Too complicated explanation". "To" is a preposition, whereas, "Too" is a Modifier, like Tim explains so well. You would use "To" to explain a place you are going like the place you are going to be free. Now, go, be free.
@mensiuscho
@mensiuscho Год назад
Very nice, Thank you.
@IAmTimCorey
@IAmTimCorey Год назад
You are welcome.
Далее
Does Deno 2 really uncomplicate JavaScript?
8:55
Просмотров 289 тыс.
Why You Shouldn't Nest Your Code
8:30
Просмотров 2,7 млн
Learn JSON in 10 Minutes
12:00
Просмотров 3,2 млн
Go Pointers: When & How To Use Them Efficiently
14:09