14. How to program in C# - INTERFACES - Tutorial

preview_player
Показать описание
Learn how to use interfaces to improve your code.

Difficulty of lesson: Intermediate.

····················································································

Want to make powerful games, Windows and Mac software or mobile applications? Then this course is a great place to start.

····················································································

········································­­·······································­·­····

► All content by Brackeys is 100% free. I believe that education should be freely available to everyone. Want to support me in my mission?

········································­­·······································­·­····

♪ Baby Plays Electro Games
Рекомендации по теме
Комментарии
Автор

For the people that don't understand the difference between Inheritance and Interfaces:

Inheritance(from Base-class to classes):
-Will just simply move Data and Methods from Baseclass to the classes.

Interfaces:
- Will set a certain structure that is mandatory with a set of Data and Methods that your classes that are marked with the interface will HAVE to contain.

We can only inherit from one base class but we can implement from several interfaces.

So that means with Interfaces we can be a lot more precise and instead of dumping all the information in just one base class which would become a mess and every class would have to contain that.

Hope I helped someone!

mauritshertog
Автор

This video was quite possibly, the best explained tutorial I have ever watched. I have had subscriptions to Pluralsight, Treehouse, Lynda, countless Udemy courses and Youtube channels and so much more and none of them compare to the quality of your teaching.

Much love from Australia.

whipsnchains
Автор

You're legit the best person i know that teaches code. I have been struggling with these concepts during my uni lectures but understand them a lot better when you explain them. Thank you for all that you do

jessicamaksoud
Автор

spent over an hour looking for books/videos to clarify why interfaces even exist. finally found your video and thoroughly enjoyed it.
very easy to watch, no bullshit, reasonable and step-by-step. unlike many others who pull you down upto an hour of "following them down a rabbit hole" of difficult/unclear drivel. when all i really need is a 5 minute video.

rodneyjenman
Автор

Im studing C# and don't understand s**t from teacher nor the book. It it was'nt for u and thenewboston I would never make it. Many many thanks for the turotials, It a huge life saver!

simonhansson
Автор

late to this video, but amazing how well you can explain this. There are countless books, articles, videos, courses that all try and explain interfaces, and they make it into this weird, super abstract thing with weird and useless examples, when in reality, interfaces are a really practical and useful thing. Your use of 'tags' helps reinforce the concept very well. Kudos.

trackhero
Автор

This is the first time Interfaces actually clicked with me, and I've tried multiple times over the years, I kinda got them, but was like "well why would I use them, I can do all this with inheritance" but this actually is cooler and more useful for my needs now.

rungeon
Автор

As an RPG-fan I must say this way of explenation really enlightened me. Great tutorial!

PelFox
Автор

This is the most broken RPG ever. First sell the sword and than hand it in :P

Creddiam
Автор

10$ is all I had but your basically teaching me the basics of my video game programing. keep It up

davidbardwell
Автор

Can you please make these ones a little oftener? You will make more money, we will learn faster, your channel grows faster, I get to listen to your beautiful voice and your channel will grow again. A steady stream of uploads is what you need.

asgeiralbretsen
Автор

This blew me away when you made an array of an interface! Thanks for this video!

frankbraker
Автор

Difficulty of lesson: Brackeys always makes it simple and understandable

KPEST
Автор

this is one of the best video about this topic
easy to understand with multiple of examples
and good explanation ..

denn
Автор

Not that Brakeys is not an excellent teacher, but I did not understand what interfaces were until I searched a bit left and right on the internets.
What I understood was - it's nothing really. only a contract like Brakeys says..
If the interface has a certain methods or properties inside it, then any class that has inheritance to that interface will not build if it does not contain that or those methods/properties specified in the interface. End of story.

it's simply keeping you or colleagues to do bad use of a certain class. Or put differently, it requires the user to respect "the contract" between the class and it's parent interface to build.

in laymans terms...

interface one {
void 1();
void 2();
}
class two : one {
// will not build unless class two contains void 1 AND void 2
}

that's all it does..

benjaminlavigne
Автор

5$ donated, you really deserve more than that i just don't have enough money to afford donating more :P

DGangstaVEVO
Автор

I always hear Interfaces described as useful for "can-do" relationships, and Inheritance for "is-a" relationships. In this case, would it be better to have the Item be a base class, and then continue having Quality and PartOfQuest as Interfaces? Or does it really even matter?

Delerat
Автор

Thanks for teaching. Youre the best. You made my concepts so good. C# is so easy for me now. keep it up...

yousaf
Автор

Very cool! Combing two great passions, gaming and programming.

lendial
Автор

Very Nicely told by conveying the correct essence of Interface usage...Thank You.

krantimadineni