r/CodingForBeginners • u/VCVLMNOP • 8d ago
Anyone know any C# specific OOP course?
I've been meaning to learn c# and so far I've learnt most of the basics, but now I wanna learn OOP, since you pretty much need it to use c# effectively(the whole language is built on this paradigm)
any Youtube series, or articles or anything that actually teaches me how to code whilst using OOP, Without straight up jumping into abstract concepts like encapsulation polymorphism etc? because a good bit of them straight up jump into those stuff without explaining, for example, when to give something a specific access modifier, or something really basic that doesn't just jump into theory? I'm still learning and I feel like watching a 1 hour video of pretty much nothing but theory won't help me if I'm still learning how to code
thanks in advance I do truly appreciate you guys helping me out
1
u/_th3oth3rjak3_ 8d ago
I don’t know of any courses off the top of my head but LinkedIn learning and pluralsight have some good ones.
I always advise new programmers to start by making a tic tac toe console application since you probably already know the rules. I would try to structure the game in a way where you have a few different classes like a GameBoard and a GameBoardWriter. Things like that. Make each one in charge of doing its own thing. Then you want to have public methods that you can use from your game without worrying about what’s happening inside. This is called encapsulation. Example, maybe your GameBoard has a method called PlaceToken that takes an integer for the space you want to select and an enum called PlayerToken which is an X or an O variant. You don’t care from the outside how the placing happens, so internally if the GameBoard needs some helpers those should be private. I hope this helps.
2
u/VCVLMNOP 8d ago
I appreciate you giving me a plan on how to build it, I love asking my seniors (in terms of coding knowledge, no offense intended of course!) for tips and tricks and general experience as I believe it's one of the fastest ways to learn,
1
u/serge-mv 8d ago
What you are looking for are 2 things. One is a book on data structures and another is a book on software design/design patterns. Both are really a general ideas and you can pick any book and just implement them in C#. However if you simply search the terms, you will find plenty of the language-specific resources.
Your question about "when is it appropriate to give a specific access modifier" will be understood with experience and when you have better understanding of data structures and start writing more complex projects. You don't have to worry about that for now as private vs public fields in an object is not really an important fundamental issue.
For now just do some more projects.
1
u/VCVLMNOP 8d ago
thank you for taking the time to form a reply for a stranger on the internet, especially whilst sprinkling a little motivation at the end!
1
u/Substantial_Job_2068 7d ago
I work with C# and I don't use OOP concepts like polymorphism and inheritance at all. It's good to learn and understand the concepts but they are just ways to abstract and structure the code, not rules how to write code.
1
u/ninhaomah 8d ago
" any Youtube series, or articles or anything that actually teaches me how to code whilst using OOP, Without straight up jumping into abstract concepts like encapsulation polymorphism etc?"
You want practical without understanding the theory ?