so we see still relevant or is it just an old has been that's on its way out let's talk about it [Music] welcome back everybody today's video is inspired by a lot of comments and questions that I've received both on this channel and also in my classes comments from people who love see or like C or people wonder why we have to learn C but in both cases people often wonder is he getting too old-fashioned is it on its way out are we still going to be using it in five years is there any point
in actually learning this language so I thought today we'd talk a little bit more about C some of the reasons to love it some of the reasons it can be frustrating for people and hopefully by the end of this video hopefully you'll have enough information to come to your own conclusion about whether or not C is a language that you should spend your time learning today I'm going to be talking mostly about C although a lot of the gripes and complaints and issues a lot of this stuff is relevant to C plus plus and I
have in other videos talked about the C versus C plus plus debate that's not really what this video is focused on so check those videos out if that is what you want to talk about as opposed to just these relevance and I also want to preface this video by saying that I'm not a language purist I do make a lot of C videos on this channel and I'll get to some other reasons later on in this video but I'm not a langit and I'm not even sure that's a word but I guess the point is
I've never really found one language that solves all of my problems or fits all of my needs I have a lot of different languages in my life and I love each of them just in different ways and for different reasons and of course as beginning programmers I encourage you to learn a bunch of different languages it will broaden your perspective it will help you understand how computers work better and make you more productive and just a better all-around programmer trust me now before we get too far into it I do just want to thank everybody
who helped support this Channel and a request that if you're finding this content to be useful please do support the channel in some way help out in some way and help me keep the cameras rolling it helps me keep doing what I'm doing so if you're liking the videos like subscribe by merch like this support the channel on patreon where you can get access to source code and my monthly office hour you can also check out my online course but anyway thank you for helping me do what I'm doing now let's get on with the
rest of this because this is a video about C and so let's first start talking about some of the reasons why people find seed to be frustrating or difficult basically what are the haters saying well basically the complaints are going to fall into three main categories the first is it's old the second is it doesn't have a particular feature or maybe multiple features that you want it doesn't have feature X whatever X happens to be and number three I hear people say it just takes me longer to do things in C than it does in
Ruby python JavaScript or some other language and every one of these concerns is true or at least partially true now I want to talk about the first one really quick because it is true but not very helpful I mean c is an old language by programming language standards but hating on something just because it's old well that seems kind of silly to me and interestingly this is actually the most common grape I hear students are they're basically saying isn't C just a little dated you know it's a little little out of date but it's interesting
a lot of times when I say well it is kind of old tell me what it is you think is out of date a lot of them then struggle to really put into words what it is that they don't like about C they're just concerned that something old might not be good and I think that's kind of lame so I'm not saying you gotta love C by by no means but let's get Beyond its age let's see if we can dig just a little bit deeper because let's face it there are a lot of things
in this world that are really old and really great but now if we do want to dig deeper and we want to engage let's let's look at some of the features that c is lacking so this is the second point and we see it's true there are a lot of things you don't get you don't get type safety you don't get classes inheritance generic data types language level exception handling garbage collection and all of these things are sometimes really nice to have there's a reason why other languages have added them and there are times where
we definitely miss them when they're not there and for a long time a lot of us used to say well that's just the price of being lean mean very efficient which C is but I don't even know if that's necessarily true because you do have new languages like rust and I know a lot of you are waiting for it I am going to at some point do some Rust videos I'm going to get to some of the rush content out there I just haven't found the time yet but rust is definitely trying to move in
in this space and trying to be a alien means systems language that is very close to Hardware very little overhead and also have things like type safety and personally I find Rust really exciting I'm interested to see where it goes and like I said future arrest content definitely in this Channel's future but yeah so there are future concerns there's definitely an issue that comes up a lot there are things that are just missing from the language and that can at times be annoying so now what about gripe number three and that is just that it
takes longer to do things in C than in other languages now this is not universally true all the time but it's often true and to illustrate this let's look at two different example programs this one is a network client that's implemented in C and this one's a network client implemented in Ruby and it doesn't take a lot of deep analysis to tell you which one of these took me less time to write so often this gripe is valid as well so okay so with these complaints why do I continue to make C content why do
I continue to use it in my classes what's the point and is the clock ticking on C is it on its way out okay so now let's talk about the upsides the first which I've kind I mentioned already is that it is fast and lean it's lightweight there's not a lot of junk that gets stuck in there there's not a lot of extra craft so your programs are going to be lightweight they run kind of everywhere they're super computers down to really really tiny microcontrollers C pretty much works everywhere it's fast and it uses very
few resources so when you're in a situation where that's important it's really important and it's a great tool for it it's not always going to be the case sometimes you're just like look I can spare a few Cycles if it saves me a lot of time and that's true but for example on my embedded microcontrollers often I'm dealing with very very slow very small memory footprint processors and often I really want to control everything that's going on and so I often stick with C or C plus plus and I know some of you rust enthusiasts
out there are going to be like yeah but you just wait at some point you're going to be doing all of this in Rust and maybe that's true maybe if we look forward a couple of decades or something maybe all of my embedded work is going to be done in Rust I look forward to finding out and who knows maybe as I get more experience with rust I'll start to migrate that way so there's definitely a familiarity aspect within this whole argument for me as you know see I'm more familiar with so naturally I gravitate
that way but as I dabble more in Rust I could definitely see maybe some of my work moving in that direction and that leads me to the second reason that I think C is really important and that is it is foundational and I know I know that's what old guys always say when they want to stay relevant is I'm not just old I'm foundational but seriously there is so much that is written in C and it's pretty much available everywhere I mean I may be using python today for some project but let's say that I
want to do something that has to be computationally really fast so maybe some kind of linear algebra stuff maybe I'm using the numpy library to compute some stuff to do you know a bunch of large matrix multiplication or whatever if we look under the hood all that really fast linear algebra stuff is implemented in C or C plus plus now of course that also could eventually change maybe 20 years from now all of the under the hood stuff all of these building blocks that have to be really fast maybe they're all going going to be
written in Rust and if that happens great but for now that Foundation is C and so understanding C and being good at C is actually really really valuable so that's reason number two now let's talk about the one that I actually think is probably the biggest reason that I really like C and that is that c has outstanding educational value in my opinion now why is it such a great education language well the first is that it is simple it's a simple language it doesn't have a lot of extra features a few of those features
like pointers especially function pointers do sometimes give new programmers a bit of a headache but the point is is as a language is pretty simple in fact you can learn the whole C language pretty quickly you may not be really great at using that language but you can learn it pretty quickly now on the other hand I find when I am using other languages regardless of what those languages are languages with a lot more features I spend a lot more time in the class helping students understand the language itself rather than the topic you know
architecture operating systems whatever that I'm trying to teach so if I use C I spend more time teaching the content for the course and less time explaining features of the language and I think that's a good thing for me and for my students and of course all those features that we talked about the C doesn't have well the fact that they're not there and you have to do a lot of these things yourself that helps you better understand how computers actually work I mean I can demonstrate things in C and you've seen some of those
on this channel that other languages simply won't let me get away with and all those demonstrations may not follow recommended best practices and they may not be something that you would want to stick into production code to an actual product but they are incredibly valuable teachers and I'm sure I'm leaving out some good ones please do drop down in the comments if there's something about C that you love or hate or whatever just let us know how you feel about C and I hope that helps you see that well I don't know the ultimate future
of the C programming language and while it is still old and well it's missing a bunch of features and while it might even take you a little bit longer to write something and see than in some other language I do think there's still a lot of value in learning C and using C in your classes I'm going to keep you using it in my classes where I teach about embedded systems and operating systems I think it's a great language for helping you understand how low-level software things work and in doing so to help you become
better programmers so I hope that helps I'll see you next week