Having 2 semesters of pure C, learning how the memory works, implementing Data Structures and complex algorithms, helped me A LOT to understand programming in general, it's way easier to go to another language once you have done everything in C
Just a side note. I played around a little with C, about 2 months on my own. What I noticed C has a unique still when referencing int and strings. Recently I starting learning Golang and Go feels so much like C. Compared to other languages like JavaScript, Kotlin, Dart. Go in my personal opinion has the most similarities to C. If you are a C fan boy and would like to try another language which has a lot of similarities to C then I highly recommend GO. Go even has pointers but some what different.
@@stubbornexplorer Yes, you can. Not only you can learn right away C++, but you will see that if you had to decide later on to use C, you will notice how easy will be to work with it. They have a lot of similarities.
@@unperrier I learned assembly, C, C++, and all the way up to more modern languages in Python. I feel that knowing about registers, a bit of hardware, and the need to allocate and free memory (on stack or heap) really helps me understand what Python is doing for me. I think that helps to write code in Python which is more optimal for a CPU, giving greater performance. I've always felt that Python was something you "earned". It lets you do things which are not really great in practice but if you understand that you are doing it you have a bit of an excuse.
the things that C 'lacks' actually make you a better programmer since they force you to think and also use the language to its full extent so as to overcome the apparent weaknesses. after 50 years we can still claim that 'if C is good for UNIX it ought to be good for everything'.
Do restrictions and limitations really make a better programmer ? What if I wanna have namespaces, more generic programs with templates and compile-time evaluation ? Something that cannot be achieved because of language limitations is frustrating. C-strings could be built other way but they cannot be changed anymore
@@legacywolf443 I mean language features. Can you have destructors in C ? You can explicitly call functions, but this is not automatic destruction, so zero-cost automatic destruction cannot be achieved in C, so smart pointers are impossible. There are no namespaces - so I always have to manage global names. No templates - only macros, which is much harder to debug and harder choose the right names. Sure, we can write in assembly to achieve everything because that is our back-end. But we would not have many quality-of-life features because language compilers don't do that for us.
@@legacywolf443_"...because C++ is written in C."_ Not entirely sure what you mean by this, but chances are your C compiler is written in C++ actually. The three major ones certainly are. C++ at the very beginning started out as a transpiler to C, but that hasn't been the case for decades. C++ as a language mostly compiles valid C, though it isn't a perfect superset. Maybe one of those is what you meant. It's true that you can do anything in C, though at some point I think the simplistic nature of C hurts it. Personally I think if C added destructors and completely replaced the unsafe bits of the standard library with something much harder to shoot yourself in the foot with, it would be a lot nicer to work with while still being it's overly minimalistic self. Personally, I'd like stronger types, namespaces and templates/generics too.
Well, Pascal, Fortran and Cobol are great too and yet they aren't on the same level as C (disclaimer: I use all 3, not in production but still) so I'm not sure if your argument is 100% airtight
@@stefanalecu9532 what I mean by "stuck around" is that C is still in top 10 most used language according to GitHub. While Pascal, Fortran, and Cobol are nowhere near that in terms of current usage. So C is very old and still in the top 10 most popular, therefore it's a good language. Whereas Fortran is very old, but not in the top 10 most popular, therefore it's not a good language.
@@stefanalecu9532please don't compare between the real programming language and a scripting language. Anyway I am sure you are involved with user space application software production but not with kernel space system calls, device driver software development. C is the mother of all programming languages as OS, Compilers, loaders etc and last but the least interpreters are written in C language. Regards and blessings.
Learning C was the best thing I've ever done for my C++ programming. I get all of the benefits of a very fast workflow by being able to leveage C++'s standard library of features while being able to utilize the nitty gritty of C when I really need it. Learning C has pushed me into writing better C++ code because I'm now understanding what those abstracted C++ functions are doing under the hood and can make considerations for each.
Bro, I have started learning c.... But don't know how can I start my career after learning it. What will be the future after it, If you could tell me regarding this I will be grateful to you 🙏
What is the best source to learn C language? I am new to 42 school and i will have a 1 year programming projects with C language so I need to master the language what is the best sources?
I like C because it's predictable. I mean, there are not that many layers between C and me. I have a pretty good idea what code it pushes out and how that will work out. With languages like Python, Rust and Java I'm always wondering "Yeah, but what's *really* happening? What does this thing under the hood? How many bugs are hiding there that I don't know of?"
This is the cost of abstraction. The same way I could say I program in x86 assembly because I need to understand what a "for" do or a "malloc" do under the hood. That being said, I also agree with you that the predictability is important and should be a feature of any low level language
@@LucasGabriel-xz8nk The best C programmers have at least a hunch of what kind of assembly is pushed out. And they have a good idea of how the C runtime functions. One could argue that a "for" is an abstraction in itself, of course. Or even a malloc() - and they'd probably be right. Even if one did assembly, I guess one would introduce a few fancy macros to "abstract" the boring details out of a program. But see the difference - one is still very involved and *KNOWS* what these abstractions boil down to. Can you tell me you *WHY* a vanilla "for-next" in Python is dozens of times slower than its C equivalent? I thought so.. Too many magical layers. (I made plenty of C VMs that were much, much faster than Pythons VM - so it can be done). But it boils down to a simple preference. To some, fast is fast enough. And they don't bother about predictability as long as it gets the job done. But I'm not that kind of guy. If I have to hunt down a bug, it'd better be mine - and not someone elses. But I agree wholeheartedly I'm just voicing my personal opinion and preferences here - not stating an indisputable scientific fact.
I wouldn't call C predictable. Implicit conversions, UB literally everywhere, differences in implementations, etc. Also, thinking that the std library has bugs is.... outdated? (Rust btw has none of the issues above, and I would call it incredibly more predictable than C, would be happy if you could say why you think that it's unpredictable)
no, real engineering happens in publicly-owned organisations where there is no stack and people are developing new languages to replace pieces of shit like C/C++
I know someone who is a young software engineer who was just hired as a COBOL programmer. He never used and didn't know what it was before. His new company is teaching it to him.
I spoke to an engineering manager at Lockheed Martin a few weeks ago who hadn’t even heard of Rust. Expect C to be around for as long as it’s been here for government and military applications.
A bonus I want to add to this video: Because C is simple, there's usually only one way to do things, and alot of behavior isn't hidden from you, memory bugs are actually pretty easy to debug, especially when using any standard debugging tool out there. Honestly, the only bad thing about C's age is its standard library. It has alot of useful stuff you'll need but its not-so-good design is definitely showing.
@@samuraijosh1595 with experience you figure out ways to heavily reduce that. 1. NULL check your pointers. 2. Set pointers to NULL after freeing an allocated pointer. 3. Limit how much memory allocation you're doing. 4. Initialize any pointers to NULL if you're not immediately Initializing them to an address.
"there's usually only one way to do things" -- what? Looking at production code, all I see is idiosyncratic shenanigans, the same problem gets solved differently each and every time. Can you guess how a menu is implemented? Parallel shallow arrays, not an array of a certain struct. Mix in a ton of ifdefs, and now reorder the elements.
I'm not a C guy, however I ended up writing a thesis about web programming in C, just to realize by myself that there is not, and probably I wont ever know, any other language like this. It certainly rocks, it's certainly the winner at the poker table.
@@edgeeffect fortran has repeat dan while loop.. Example: INTEGER A(4,4), C, R ... C = 4 R = 1 DO WHILE ( C .GT. R ) A(C,R) = 1 C = C - 1 END DO Example
🎯 Key Takeaways for quick navigation: 00:00 📅 *Introduction to C's relevance* - Discussing the relevance of the C programming language in modern times. 02:26 🕰️ *Common complaints about C* - Addressing common complaints about C, including its age, lack of certain features, and perceived inefficiency. 05:16 🚀 *Advantages of C* - Highlighting the strengths of C, such as its speed, versatility, and foundational role in computing. 07:32 🎓 *Educational value of C* - Discussing the educational value of C due to its simplicity, hands-on nature, and ability to deepen understanding of computer systems. Made with HARPA AI
Beginner programmer here, I'd say C is a fantastic first language tbh. The fact that it doesn't have a lot of the pre-built functions in it's libraries compared to other languages really makes the learning worth it since you basically need to make them by yourself. The way that I had to comprehend how memory work really increased my understanding when coding as well as improving how I view my code. Although other languages like Python can serve as an easier and more beginner friendly, C is in a threshold that's still doable by a beginner as well as providing a solid thinking process that will help when learning other languages. Learning programming by starting with C was probably one of the best choices I've made.
I don't like python for begineers because it hides how types work (and yet has types). Types are foundational to coding in any language. A learning language should use strict types, imo.
@@jal051Hot take - all languages should use strict types. The amount of time you "save" by not having to type "int, string, etc..." is easily lost the instant you make one mistake with your types that only shows up at runtime rather than compile time. Plus the code is by far more readable on its own to other developers.
@@cyberchef8344 Absolutely agree! I don't even think I save any time not typing the type. One still has to make the decision of what type it is that variable you're declaring, so what's the point in not being explicit with it. You don't win anything. It's a fake simplification which only introduces troubles on the long end.
Bro, I have started learning c.... But don't know how can I start my career after learning it. What will be the future after it, If you could tell me regarding this I will be grateful to you 🙏
The first language I learned was C on crappy linux machine. It really forces me to learn how language, compiler, linker, os, hardware, build system, and libraries work together. That learning process really help me a lot later when I was learning other language and many aspects of computer programming in general.
@@hypnoz7871 Depends on what library you're using. If you need cross platform, go with GTK. If you're on Windows only, the base Win32 API isn't too bad, or at least wasn't for me back when I developed with Win98. Though, I would still argue for GTK if someone even wants to consider a transition to a good OS.
@@hypnoz7871 depends. if your program is simple, a simple GUI library like raygui works really well and isn't hard to work with at all. Very easy to modify too since its so simple, so if you know a bit of graphics programming you can add any feature you want
I was a programmer from 1994 to 2002. Graduated in computer science from university of Montreal. I moved to another field of work in 2003. I was a C programmer. I still remember a lot of things, and I believe I could pick up programming again very fast. I knew (and still know. I have not forgotten) C++ as well, but not using it very much. I did many things in C that I cannot imagine how I would have done them without the "low-levelness" of C (dynamic hashing tables (dynamic matrices, 2 dimensions, double pointers). I think it was a major pain the the ass, sometimes, because OOP programing would have made the code clearer. Good ol times...
Hi i am a up and coming C developer i just wanted to say i really appreciate this kind of content it helps me to better grasp things about my studies so ty so much!
From an educational perspective I find that C is a much better teacher of how a computer works behind the scenes, and I like that it forces learners to pay close attention to and understand what it is they are writing.
For systems / graphics / embedded programming it's a must. Also the syntax of many modern languages is basically a derivative of C. I recently worked with a code base that was written in pure C, not even C++. What a delight.
I just watched your video and had to smile at some of the "negative" aspects of C. I wrote my first C program in 1978 on a PDP-11/70 and am still using it. I have worked with embedded systems for quite some time ( a lot of WindRiver and Ada and C). I hear a lot about the need for garbage collection and think what it would be like if you vehicle was approaching a cliff and the garbage collection preempted the braking system. :)
Great video! I would just like to add that, in the realm of embedded Linux, if you have a C cross-compiler targeting your board, that's all you need to build a complete system: bootloader, kernel, libc, shell, editor, command-line tools, Perl and Python interpreters, etc.
I wrote a whole custom server and desktop provisioning system for a company over 15 years ago in C. It’s so good, that multiple attempts to replace it (because someone in management was being told by vendor salespersons that they should an commercially available product), but every attempt has failed because the custom solution works so well. Because I did not rely on any libs other than what is in the core OS, it doesn’t have fragile runtimes that require constant updates and releases, etc…. Anyway, my point is that C is powerful, it is fast, it is secure (if you know what you’re doing) and it can reduce the need for “framework update driven releases”.
Years ago, I worked for a company that "bought" old code (java and C/C++), and recompiled it, etc. I love C/C++. Love it. But old C and C++ code does not want to compile on new compilers. And to add insult to injury, there was not any work at all to converting the old java code. It all worked right out of the box. I have not used it much, but it did make you like java. The C/C++ code, when compiled on a new compiler, was sorta buggy. We spent a month compiling, and getting it to work, writing new make files, etc.
Bugs that pop out from moving from one compiler to another, are failure to initialize variables, and even small details in the language, like holding a string.c_ptr too long, and reusing when it left scope. Or worse. dereferencing null ptrs, is a feature in AIX xlc. so, they do memcmp's against NULL
This has been alluded to in the video and in the comments, but after 16 years in both software and embedded systems - the number one reason for C is “control”. As you’re writing, you can pretty much know exactly what instructions the compiler will generate and how data is accessed and moves throughout your system. I don’t know of many other popular languages where that is the case and it serves as a good and predictable intermediary between assembly and higher-level languages. (And as as aside, if you think developing in C is slow, try writing in pure assembly.) In most application software, you typically don’t need explicit control over both “what” and “how” the CPU works, but in certain subdomains it’s absolutely critical: high performance or tight memory requirements, finite timing (e.g. cryptography or hardware drivers), determinism (e.g. aerospace, controls, or other intrinsically-safe domain). So when I hear bunch of people complaining the language isn’t relevant, I hear people saying that it’s not relevant for the domains they’re familiar with
In an extreme situation, with little contact to outside word I would chose C and maybe Python. C is one of the few languages in which I can program without the need for online documentation. For all the other languages I know the path most traveled, but as soon as I wander outside of it I need some way to refresh my knowledge. I added Python because it's fast (not necessary safe) to code in it but you still need proper documentation for the used libraries.
As a CS student who has been touching C for at least two years, I think that besides its familiarity (syntax and awareness of it) with lean, mean execution, there are two other reasons. For the other points, I compare C programming to philosophy. You do it for enjoyment. And the more you get into it, you gain insights into how things work or why things are the way they are. Overall, the best thing anyone going into programming can do is to keep learning. My heart is big enough for Python and Java too.
As a former CS student currently working in industry... I don't see a place for Java, other than when required because it's already in use in a project. If you need to be fast/close to the hardware you have C, C++, and Rust. If you need fast prototyping you can use Python. If you want to be able to quickly (or even for production) throw together GUI applications you can use C#. Java's original pro was that it provided: object oriented design patterns, garbage collection, and portability. Object oriented design patterns are largely falling out of favor because they end up making the code more complex than it needs to be - not to mention it inevitably blows up into a non-maintainable mess the instant the goal of of the project changes. Garbage collection is implemented in other high level languages as well - plus you could just learn how to correctly manage memory and the whole thing becomes a non-issue. Portability... not really sure where this myth that other languages aren't portable came from. Sure the binaries don't transfer... but who cares. It's really not that hard to set up a few toolchains. For the most part you have Windows, Linux, and Mac OS -- and that's assuming you want to support all 3. I really just don't see how Java has a place.
@@cyberchef8344 Ah, I forgot to check replies earlier. As my update, I agree that Java felt sluggish to use even for leisure projects. The documentation was fine, but looking at all the extra OOP patterns tossed in along with the forced use of classes made me come to a similar conclusion. Java is clunky- development-wise and syntax-wise which made me grow tired of it. At this point I would only use Java for writing Minecraft plugins. With that being said, what are your thoughts on Kotlin in terms of the programming experience?
That's true but C could still get outdated. Like horses got replaced by cars, C could become similarly irrelevant. I personally love C but your point is weak
@@8292-d6nC stood the test of time, probably it wont be replaced at all, it has all the things you want. Although it takes time to create something, on the way you wrote your own libs and can probably be more productive
@@8292-d6nYeah, but what could replace C? Rust? Cmon it has a very ugly syntax. C is designed to be simple and efficient. It never wanted to be memory safe.
Forget any modern day application of C. The most thing is C will teach how becomes programmer in proper way. Yes other can also do that but C is low level languages and don't have any sefty feature of modern languages. It will force you write code right way It is mother of many modern programming languages so once you learn C. It will make you little easier if you try these languages.
Starting up with c as my first programming language in college makes learning java easier and our professor actually emphasize the important of c despite it being old. We are trained to build our logic while learning c and it really help, i think its a good start especially with someone studying IT or IS but have no background knowledge like me.
Absolutely worth it. It was my third language I learned 35 years ago. First was Basic language, then Z80 Assembly. If you know C well, it's very easy to learn mostly all other languages. For example, getting into Go or Rust is very fast. I learned it with K&R book but nowadays I recommend the book Head First C, it'll give you a very good idea of Linux inner workings too.
To be fair, when you program in C or C++, you program what the standard calls an "abstract machine". While it is a good model of a von Neumann computer, it certainly misses some parts of a modern system, like caches, branch predictors and SIMD, though SIMD is on the way to C++. Thus, code that looks fast can be slow depending on memory layout, any potential aliasing etc. Also, on some machines, floating point operations must be emulated in software. If the result becomes a subnormal number, many processors (even on servers and desktops), need software support.
I got to C from assemblers, programming close to the metal (as a physicist). That taught me a lot. 'The C Programming Language' - K&R - was a revelation. Now Rust is around; That might be the follower for close to the metal. But running the rust tools on a PDP-11 would not work unless you have a lot of spare time.
Probably both but I think porting the compiler to work within the limitations of the PDP-11 would be more difficult than simply writing a PDP-11 backend.
@@Burnr-hw6zs I meant the whole rust stack. A binary would work fine, at a guess, although you'd have to build a compiler; and that is a very clever and informative compiler. Squeezing that into a PDP would be a mite tricky.
@@Burnr-hw6zs That is why I used raw C. Better than assembler and close to the hardware. Now I can cross-compile Rust (or C, for that matter) to the little machines, microproccers, that I use to hit the hardware. Which is fun. (I'm mostly retired - my PDP era was getting on for 50 years ago, but the notion that 'os C useful?' is, I think, on the money, especially if you use it to get at hardware addresses. You learn a lot of what a computer has to do, without the nuisance of learning assembler)
I like c for learning but cannot endure it’s lack of generic programming that cpp has. Templates and concepts, constexpr, namespaces made me fully switch to cpp. But I am still looking for modern alternatives.
C doesn't have the best syntax for generic programming, but if you read the standard and play with some example code you can still do everything with it that you can in C++, just with less sugar. For reference, look up _Generic in the C standard.
The other nice thing about C for learning to code well is that with Python you can get away for a time with writing sloppy illegible code but C really forces you to pay attention to what you're writing, how you write it and how you structure it other wise it likely won't even run.
I’m currently taking Harvard’s CS50 and I have to say that it’s great for understanding what’s “going under the hood” plus that when we swap to python it will be definitely much more easier.
25 yr career. Started in C, then Java, then .Net, then NodeJS and have been in Go for several years. Rust syntax for complex tasks makes me want to throw the keyboard out the window (literally). Go and Rust were both originally written in C. Picking up videos on this channel due to something you may have not thought of: ClaudeAI. It does amazing job with code generation and only getting better. This can open the door where AI takes complex business problems and cranks out low level code (C or Assembly). Therefore negating the Cons mentioned in this video.
Using C since K&R first edition (1978). It is the underpinnig of almost everything (including C++). If I had to pick one language for the rst of my life it would be C. But every other language brings something else to the table. All languages that find a purpise have something to offer. Python is great for teaching and casual learning. In the old says we had to pay for languages, hunderds even thousands of dollars for a compiler. Now there seem to be free versions of everything. Sometimes the old days were NT as good as today. ;-)
I love the preprocessor. I can register functions in an array of function pointers to run as unity test one after another using the try and catch definitions using setjmp and longjmp
I think learning assembly (I learned Z80) and C gives you the low level understanding how a system works, how optimizations work and what performs best. C is usually the first high level language on any given new system as a bootstrap language. C is still used in many embedded systems, drivers, kernels, high performance applications etc. The number of languages that can rival c is increasing but can't still beat the maturity of tools for c yet. Imagine the carbon footprint of youtube, ai training, processing of big data using python or even C# and java. It's not only not performant, it's irresponible for our little homeworld!
Perhaps a good test for a programming language is to see how well you can work out what someone else's program is doing and how it is doing it. That said, I'm struggling to learn C as it seems to be the defacto language for embedded systems - which is what I need it for.
Fabless manufacturing and electronic design automation are two growth areas where the talents of someone skilled in C are essential. One could be picked up by companies such as Intel, Apple, NVIDIA, Google, AMD, Microsoft
In my opinion C has 2 unique things: it is one to one mapping to the von neumann machine execution model, so you program with the control data flow in mind AND has all the basic tools for algorithmic recursion,, stacks and so on. The example you gave about code lenght does not say the other one was calling a library. if you have a great library, you do the same with C. The last thing is memory access: you can teach how to write safe c, it is totally possible if you do well from the beginning and you know what arw you doing. A simole example: you can use pointers only on specific restricted and controlled part of your code, so every memory plays is there and the algorithms are in another place.
Could you make a guide about programming an embedded device/board from scratch? Considering an empty project, what datasheets do you need to study to get 1. the board and 2. the devices in the board to breathe? Where do you start with the board code and while going through these steps, explaining the registers and other relevant stuff in making the board come alive.
C is highly productive when you got to the point where you wrote lots of small libs to help on some low level stuff. Features in other languages can most of the time be adding as small libs in C. But C will always be waaayyyy faster to compile than any new language. It's a small, simple language. That won't change a lot in the future, that's a real plus.
Hm... yeah. A clean build for a not-so-enormous microcontroller we use, depending on the features we compile with, takes anywhere from a few minutes to go grab a coffee, take a walk in the building, take a dump and it is still not done.
@@varadinagypal You really wanna use single translation unit builds if you want fast compiles in C/C++ otherwise as your project grows it will get slower and slower. It's really rare that you have the freedom to do that though. Some newer languages are trying to solve the issues with compile times though, we'll have to wait and see what happens.
@@xhivo97 How is it rare having the freedom to do that? C allows you to put every function in its own file, if you want, and you can even add the prototypes for them all into one header to make using them from anywhere easy. And with tools like `ar` you can even update a library one module at a time and build super fast. Learn the tools and their proper uses and you'll be happier.
As a newbie, C really taught me about the mechanics of how variables are declared and work. That is from a view of what's actually happening in the hardware. Compared to something like python, which is like riding a bike with training wheels
Did it? I honestly didn't really understand how variables work until I learned assembly. C hides it from you by creating the abstraction of "types". A computer doesn't understand types
Every time you mentioned Rust, I kept thinking "but will I be able to cross compile to 6502 with it, like I can with C?" ;) (I've been writing games and apps for the Atari 8-bit conputer in C... after decades of BASIC and an Algol-style language called "Action!".)
MAC/65 did change the game after using the Assembler Editor cartridge for a long time. Took a massive, but powerful, Atari BASIC program and sped it up considerably. However, I did right a one-pager in BASIC (including more REM than not) that I find people unable to write even today in an efficient manner. It solved the "birthday problem" in about 30 seconds. "Find the number of people required to have a greater than 50% chance of two people having the same birthday. [People are born throughout the year with equal likelihood.]" Yeah, on an 8-bit machine with 4k of RAM. It's a good program for students to try in any language.
Based on your opinions on c, I think you will like zig a lot more than rust, at least for some use cases. idk if you know anything about zig so here are some highlights: - zig aims to replace c - it is simple, while having some modern features, - it has amazing interop with c - it has an amazing integrated build system, that can be used to build c/cpp projects too - in particular cross compilation just works, even for c/cpp - it has a package manager, which works for c/cpp projects - it provides even more control of memory than c (or at least makes it easier to have more control) - due to various reasons, zig can often be faster/more efficient than c - it has safety checks (compile time and runtime), at least in debug or safe release builds, I believe some checks still remain, not certain tho.
I learned C at a New Jersey community college, taught by an old gray-beard retired from Bell Labs; was the best math class I've ever had! These days I'm mostly using Python and Javascript, but when it's easier to just write a plugin for SQLite, I dust off my old C chops and delve into malloc() and void (*)() and all my old friends. C is portable assembly; it will teach you how computers work and that knowledge is foundational to any competent programmer.
C was the first programming language I ever learnt. It was difficult and a headache to learn, but I must say, it was thanks to C that I fell in love with programing and computer science/engineering in general. I don't whether I would have liked so much programing, have I learnt another programming language first. Its simplicity made me understood that I could do tons of stuff with programming, that I'm limited only by my own creativity. C is beautiful because of its simplicity, it's ugly because it can be a headache sometime (pointers), but in general, once you understand the basic idea behind C and programming, C is great!
C is easy to learn because it's not very abstracted, but hard to use because it's not very abstracted. It can do a lot with it's basic tools, but knowing how to do a lot with it takes a lot of time and effort. Every time I sit down to use C, it does feel like building a house with popsicle sticks, slightly better than the toothpicks of assembly, but not as effective as the bricks of C++. It really comes down to what software tools are best for the specific project that the programmer is working on. While I think it is good for many programmers to learn a bit of C to better understand how computers work, I don't think that every programmer needs to master it in order to be a "real programmer". Many jobs focus on completely different languages and skills that don't require any advanced knowledge of C so it's totally viable to not worry about it too much if it's not something you'll need very often. Then as far as Rust (and Zig?) go, the student programmer should probably focus on C first and then learn the newer languages as C is much more established. 99% of systems jobs require C and some assembly knowledge anyway, and universities still tech it, so it's hard to avoid it if the student wants to do that kind of work. It's also pretty easy to pick up newer languages later anyway as they'll only have to learn the features that are different that C instead of all of programming all over again. The newer languages still use many of the foundational concepts in C, just with improvements with the hindsight to see what didn't work as well.
Summary: Driving a manual transmission is nice, but becoming quaint, as ever more people drive automatics with so many features. That can be a good thing; however, the trade-off is usually needing to return to a dealer for proprietary componentry, even if an aftermarket place is willing to work on the vehicle. But that's not the same as programming or coding for a job. Then it's about business needs, not personal preferences.
Java runtime is written in C, even javac compiler is initially written in C (yet others claim it is now Java compiled in Java, still it is compiled first by C then bootstraped to Java), majority of big Python libraries that require high computations are written in C, JavaScript V8 engine is written in C and Assembly, etc. but for me I develop in Java, specifically using Spring Framework, because that serves my work purpose, and my self interest..
I started programming with python like most of the beginners do, though Python has eclectic libraries for almost everything, if someone wants to understand how a computer works under the hood, C is the lang one should look up to. After learning C, a lot of concepts that previously sounded unconvincing to me, started making sense.
asking whether C is still relevant is like asking whether we still need our head. C is like a blood, you remove it from human body you know what happens next.
I tend to avoid using C because I’m a C++ programmer and since both languages are very similar I made the choice to only use C++ to not get confused. But the drawback is that I don’t know C that much. 😅
I have spent a lot of time in asm and now am making my 3rd attempt to learn C. Its a great language and is a great re-entry back into the world of HLL. C may be known for lacking abstraction, but asm has even less--none!
You hit a major, underrated argument; the educational value. C's minimal abstraction is fantastic as a bridge between human logic and a processor. It's that happy medium.. Yes, it is frustrating to learn.. yes, it takes more lines of code than other languages with more abstraction. Yes, the strict syntax throwing compiler errors is annoying to new programmers. Yes, it can be annoying to have to define everything. Yet when you actually learn how to use C, you gain a greater understanding of HOW and WHY it all works.. compare this to highly abstracted languages, which might as well be magic (unless you are the kind of person who digs deep into libraries/source files to find the lowest level of methods.. few do that). If you have a good understanding of low-level things, you'll have an easier time learning high-level languages.. and your ceiling grows..
OS kernels (even modern kernels) are almost universally (arguably necessarily) written in C. C is basically tuned to work at a low level of abstraction while also being portable to multiple architectures. If an application needs to obsess about every clock cycle and every bit of memory being used by the program while at the same time needing to be portable and readable... then that application (for better or worse) is probably begging to be written in C.
Yea I'm sure that won't change. I also don't know any OS that has been adopting another language well. I mean why would anyone want to avoid C? Theres absolutely 0 issues with it
C has got to be good. I learned C 25 years ago at community college. I started 50 years ago writing code using assembler language. C could have enhanced function libraries. Assembler used prewritten Macros. Maintaining systems written by other programmers. Invigorating.
To be honest, I think C is vital as a pedagogical language, because it's a lot "closer to the metal" than the newer languages, but still human readable. When I was in school, they started us on Scheme for algorithms; then assembly language for pain and so we'd be *grateful* for C; then C sold as a nicer version of assembly. Point being, it's good to know C to make sure you really understand what your program is doing, and for the *occasional* high-performance application. But most of the time, the ease-of-use of python or C# are more important. Person-time is usually more expensive than beefier hardware.
The coding example where only a few lines of Ruby compared to lots of lines for C highlights the value of libraries, not necessarily differences in the language. The C code is great for showing what is really happening versus just library magic. If someone wanted to, they can create a library that would make the C code as simple as the Ruby code. After someone has a firm grasp on C, I would argue they should learn an assembly language. Not that they'll ever program in assembly professionally, but it will help them understand what is going on under the covers much better. My team at work has a mix of developer experiences, all coding in C++. If something goes sideways, one of the guys that learned assembly is more likely to fix the problem them someone who only knows C++. Not that assembly is called for, but an understanding of what is going on under the covers is required.
You forgot: in C you can define a variable that is a pointer to a pointer to a pointer to a pointer to a pointer to a pointer to a pointer to a pointer to a value.
It's amazing how C gave birth to so many interesting programming languages. Some of my favorites like Kotlin, Golang, JavaScript and PHP and yes Python. My only gripe with C is what can a new programmer build with C? Seems only advanced developers are able to create compilers with this language.
As a "Rust Enthusiast": C is the best thing that ever happened to me. I came in the weird way with no formal training (I studied Journalism, then ended up building Sawmills, later ended up with Video Game QA, and am now doing Test Engineering at some rando website people use). Through that last, the TE, I have grown to like certain ideas in Rust, certain approaches, so I wanted to learn it. But it's hard. It's got a lot of stuff that can be difficult to pick up. And nothing has been as good at teaching me that, as taking a step back, using C (often with the help of a certain Sorber's videos), to achieve the same thing. Eventually I figure out that there's a thing I had misunderstood about how things REALLY work under the hood, that other languages I use (Shell, JavaScript, or the Rust I was learning) was sort of hiding from me. After that, I can drop C (until next issue), go back to Rust, and the latter is suddenly WAY easier. Because I spent some time with C. Or, as we call it: "Vitamin C". :)
C has a stable ABI it's a very small language which makes learning easy and you can pretty much write anything with it. But do some simple stuff with strings for example and the missing features get ridiculous fast. I could write a small lib in c or something for a micro controller but I wouldn't want to write any larger serious program in the language.
Yes, it's relevant. When you go into industry, there is a good chance you will code in C++, Java, JavaScript, or C#. The syntax of all four of these is based on C. A new developer who only learned C in college can be brought up to speed in minimal time in any software house that codes in these other languages.
I've learned many different languages over the past 40 years to varying degrees of proficiency. I'm strongest in C and C++ . Recently tried learning java again after a number of false starts, the first being back in the 90s. Not going well at all. I hate it and I hate it's awful ecosystem. And don't get me onto the monstrosity commonly known as "Eclipse" %$#@&%$. Piece of crap. So you're probably correct in general, but some tools and/or languages can simply be a bad fit... I'll never be a productive java developer. That has again become crystal clear.
Ya, the concepts of the technology is more important than the how some language/framework deal with them. It will lay a stronger foundation and allow user to have easier transition to other language/framework.
You can get around type safety but to say C isn’t type safe isn’t quite correct imo. The main thing missing from C is templates; you can’t compare a library in language X with bare C implementation. Of course, C/C++ may be behind things in other languages - e.g Pandas. Where I work we have lots of C++ with Python layers. C and Haskell - those are two languages I think students should learn in depth. Don’t understand the appeal of Rust tbh.
I think it’s good if you actually need it, or as a teaching language because manual memory management is very good to learn in general, even if you never use it. Pointers are good for visualization ability.
I am learning programming for web development with Golang and JavaScript. BUT I would like to eventually later on make games as a hobby with C. My focus with C is to learn memory management and to get better at algorithms and making games with C sounds like it can be fun. On the subject of making games with C when I looked on TH-cam most were making games on Window and they all were using Visual Studio as their IDE as well they were using Power Shell. But what if you are on macOS? Can you still make games with C on a different operating system? side note: Visual Studio on mac has been deprecated.
Definitely yes. While, writing in C#, i decided to make some CLI prog on C and discovered so many concepts, like actually using gdb, or thinking on how to allocate memory for different scenarios, that I can project onto my C# workflow. Also, Vim is the best editor for C/C++😅
hello, can you advice on what language to begin with? I have no specific goal in terms of what i want to do with the language. I'm only learning for knowledge sake, with the aim of maybe using it for automation and AI/ML in the far future. (I have no interest in doing this for a living) i heard differing things from experienced programmers. "Dont start with Python, it doesn't teach you anything about how computers work" "Start with python, its easy" "Dont learn JS, its trash" "Start with Assembly, then move to C, and then Python". etc, etc... So you see why im conflicted. Any advice and rationale for it would be much appreciated.
I love C. It's supereasy and I feel in control. My only complaint is how painful it can be to setup a project sometimes. Linking libraries can be really annoying, specially when half of the times you need to recompile them. I hate this part of the proccess. I find my self writting things in Python just because I don't want to setup a C project, even when I feel way more comfortable with C.
I'd be interested in seeing you compare Rust and Zig. Both are trying to fill the General Systems Programming space, but Zig is leaner and takes a different approach from Rust as a successor to C.
Rust is a "kitchen sink" language that is good for replacing C++. Rust is NOT a successor of C. It can't be. It's too complicated. A better successor of C is Zig and even then it is FAR from complete and the technical debt of C is likely too big to be overcome in my opinion.
@@hypnoz7871That's interesting as it appears to me that many Rust adopters are often C and C+ (that is, C with classes) types that weren't on board with modern good C++ practice. The C++ guys are interested in Rust, but more to borrow the good ideas and bring it into C++ rather than switching over wholesale. Consider the Linux kernel looking to add Rust support even though Linus famously has an irrational rant against the language that pioneered many of Rust's most loved features.
@@savclaudiu2133 I think they're stretching the definition of "technical debt" to mean "the existing real-life programs people currently depend on", which is really describing a very different thing to "technical debt"
C is fast and efficient in both execution time and memory space. Is there a good preprocessor to help us write C code faster and satisfy some of people's complaints about it or simply speed up the process of writing C code? if there is, I would like to be told of it. With these advances in AI, you would think someone has come up with something--or should come up with something. I would even like to contribute to a program like that, providing it's written in C. I came across your Chanel while looking for AI or neural networks written in C. My personal experience was as an AGC (Automatic Gauge Control) engineer starting in the late 1980's when hardware wasn't that fast and we were writing feedback control loops for rolling mills and the managers wanted as much of the strip to be on gauge as possible, so execution speed was paramount.
can you make a tutorial about transferring executables and shared libraries from one linux machine to another linux machine with different version (e.g. from ubuntu 20.04 to ubuntu22.04/fedora 38)??????????????
Unless the executable is statically linked, don't do it. If it's open source then just recompile on the new target. If you absolutely have to because it's closed source, try a virtual machine to run it by copying the entire system as a disk image and running it that way. Version mismatches in libraries will cause you endless headaches.
@@anon_y_mousse That's exactly what I've been dealing with for the past week. Is there a tool to remedy the pain??? I need a tool to help me with library versioning of executables. (besides ldd)
In the before time. I started in FORTRAN in the mid-70s with punch cards. As for C, I heard about it in the late 70s, and started programming in it in 1980. Still do. It's like driving a manual transmission. I could compile decent programs without having to drop into machine-specific assembly; however, I still wrote in assembler until around 1983 for fast stuff and in BASIC for generic on the then-new home computers. For mainframe work, it was still a lot of COBOL, and I treasured my JCL cards. I did use LISP for a brief spell in the mid-to-late 80s. Today. I've used C++, but it's clunky and heavy enough, that I simply write in Java at that point or drop back into C. That's for compiled or mostly-compiled programs. The rest are scripting languages. Perl, Python, Ruby. Learn C. It works in the snow.
I find that C programs execute faster than others -- simulations like Monte Carlo etc where CPU time is a factor runs for more iterations per unit time than potential competitors, eg Python. (A challenge to a colleague to write a Python program for the same simulations as one in C showed that the C program outperformed the Python program by an order magnitude -- I dont know why this is, but I assumed that it was due to overhead in the Python program for data structure control IO etc. Additionally, C integrates easily and beautifully in a parallel threaded environment with omp protocols -- threads run simultaneously on different CPUs and interacts without a hiccup, giving further factors in the reduction of CPU time for the simulation).
I am still confused about Rust and Go? What are the problems they are trying to solve. I have worked with embedded system for 20 years, and cannot visualize how Rust will replace C in embedded systems. Any suggestions?
Ever had... a segfault? a use after free? a double free? UB because you: accessed an array with an invalid index? forgot to initialise something? wrote a value that was being read by another thread? Invalid behaviour: because you didn't support utf8? because something was implicitly casted? Ever used `int` and expected it to hold more than 2 bytes? Did it work for you? If so, you are lucky.
C has been my goto language for almost 9 years, Still my favorite, but I'm now learning golang, I think it's good language to pick up if you already know C.
If you can, learn it yourself as much as you can. It'll suck. All of us had to put up with it. Once you get a chance to take the class, it will make much more sense.
C is like a stick shift, when you’re going sideways in the snow, you appreciate simplicity (no 163737 versions of c++) and third pedal (completely unguarded pointers) !
Hey Jacob, do you know a book/course to learn about OS (linux) with C? I have already 2 years of experience with javascript, typescript and python as web dev
When I see people using a Raspberry Pi, an operating system and Python to flash a couple of LEDs, I could weep. Sure, as soon as you need complex interfaces, BlueTooth etc, it's different. However, if you don't know 'C' (or assembler) how are you going to program an 8 pin Microcontroller? Unless you can get down and dirty with the hardware, you'll never grasp how these things work. I've written an entire CNC controller in Assembler, before 'C' compilers were efficient enough to get the necessary performance from 8MHz hardware. (Yes, I'm very old) Understanding programming at the lowest levels really helps when you move to ever higher level languages.
What I like from C is how explicit the language is. There is no name mangling, there are no function or operator overrides. In the final exam from last term, one student answered a question, basically "what does this code do?" with "who knows? Is += overloaded?". I feel the same looking at any language that took hints from C++ About those language features: other languages don't have features C lacks, they have features that were probably *built in C in the first place*. As I love telling my class, serious C doesn't look like C any more. You've been rolling your own libraries for a decade so common tasks are one-liners, there's a framework for handling runtime errors, and your output code or array slicing is concise just like any high level lang... that nobody else understands. In short turn your capability issues into compatibility issues lol
Even when I finish the development of Nemesis and release it, I think that the C programming language will still be worth learning as it has some very useful tutorial that help you understand pointers and low level stuff (that will be useful to optimize) that will be very hard to fully modify and translate to Nemesis.
@@anon_y_mousse Yes, Nemesis is the name. Nemesis will ("will" as, It's very early in development) be a language focused in safety, reliability and re-usability! The official implementation of the language will be a compiler that uses LLVM for the backend! Even tho the compiler is not ready yet, you can see the public repository that is hosted on Codeberg (I don't give links because I think TH-cam does not allow it) that contains code examples about how it will look under the directory called "code_examples" and there is even documentation that I have written ahead of time using "sphinx-docs". Of course, it also contains the source code but who wants to see that right? Star the project to stay up with the progress ;)
Rust is good, but I don’t know if it will make it. So few know it, and I can’t find any projects that are being done in it. On a side note, to understand Rust you need to know the same concepts as C. Things like pointers (By Val vs By Ref), stack vs heap allocation, thread concurrency, etc. are issues in Rust, but the structure of Rust programs tend to eliminate these issues by convention.
Simply put, it’s the heart of embedded software engineering. If you don’t understand the importance of embedded systems then you have much more to worry about than if C language is still relevant
The comparison at 4:51 between Ruby and C, leaves out that the Ruby code had zero error checking, whereas the C code had that - any programmer worth his salt does do error checking
@@JacobSorber: I believe you and still I do not really see "source code size" as a significant parameter for the decision about which language to choose. What I believe is important is either a language which is "programmer efficiency", i.e. a language that makes it faster for the programmer to get the job done, OR execution time efficiency. For the first a scripted language might very well win, and for the execution time "C" will practically always be the fastest.
Having 2 semesters of pure C, learning how the memory works, implementing Data Structures and complex algorithms, helped me A LOT to understand programming in general, it's way easier to go to another language once you have done everything in C
Just a side note. I played around a little with C, about 2 months on my own. What I noticed C has a unique still when referencing int and strings. Recently I starting learning Golang and Go feels so much like C. Compared to other languages like JavaScript, Kotlin, Dart. Go in my personal opinion has the most similarities to C. If you are a C fan boy and would like to try another language which has a lot of similarities to C then I highly recommend GO. Go even has pointers but some what different.
Can't we just start from C++?
@@stubbornexplorerstart with c. C++ will be easy then
@@stubbornexplorer Yes, you can. Not only you can learn right away C++, but you will see that if you had to decide later on to use C, you will notice how easy will be to work with it. They have a lot of similarities.
@@DevlogBill well, C was designed by Dennis Ritchien and Ken Thompson. Golang was designed by Ken Thompson, it makes sense
As a python programmer, learning C have changed my mind and how I look at the code I'm making. So yes, It's worth it!
can you please expand/elaborate?
Same here, Learned JS first, now learning C++
Any of the fast python libraries and functions that require speed are compiled from C++.
@@unperrier If you are really interested in it, learn computer science. This can not be taught buy YT comments, lol. If you are not, do not ask.
@@unperrier I learned assembly, C, C++, and all the way up to more modern languages in Python. I feel that knowing about registers, a bit of hardware, and the need to allocate and free memory (on stack or heap) really helps me understand what Python is doing for me. I think that helps to write code in Python which is more optimal for a CPU, giving greater performance. I've always felt that Python was something you "earned". It lets you do things which are not really great in practice but if you understand that you are doing it you have a bit of an excuse.
the things that C 'lacks' actually make you a better programmer since they force you to think and also use the language to its full extent so as to overcome the apparent weaknesses. after 50 years we can still claim that 'if C is good for UNIX it ought to be good for everything'.
Do restrictions and limitations really make a better programmer ?
What if I wanna have namespaces, more generic programs with templates and compile-time evaluation ?
Something that cannot be achieved because of language limitations is frustrating.
C-strings could be built other way but they cannot be changed anymore
@@nikozdev By definition, everything possible in C++ is possible in C because C++ is written in C.
So you can't say "things that cannot be achieved".
100% agree
@@legacywolf443 I mean language features.
Can you have destructors in C ? You can explicitly call functions, but this is not automatic destruction, so zero-cost automatic destruction cannot be achieved in C, so smart pointers are impossible.
There are no namespaces - so I always have to manage global names.
No templates - only macros, which is much harder to debug and harder choose the right names.
Sure, we can write in assembly to achieve everything because that is our back-end.
But we would not have many quality-of-life features because language compilers don't do that for us.
@@legacywolf443_"...because C++ is written in C."_
Not entirely sure what you mean by this, but chances are your C compiler is written in C++ actually. The three major ones certainly are.
C++ at the very beginning started out as a transpiler to C, but that hasn't been the case for decades. C++ as a language mostly compiles valid C, though it isn't a perfect superset. Maybe one of those is what you meant.
It's true that you can do anything in C, though at some point I think the simplistic nature of C hurts it. Personally I think if C added destructors and completely replaced the unsafe bits of the standard library with something much harder to shoot yourself in the foot with, it would be a lot nicer to work with while still being it's overly minimalistic self.
Personally, I'd like stronger types, namespaces and templates/generics too.
I think C's age is a plus! It basically proves it's a great language. if it wasn't good it wouldn't have stuck around for so long.
Well, Pascal, Fortran and Cobol are great too and yet they aren't on the same level as C (disclaimer: I use all 3, not in production but still) so I'm not sure if your argument is 100% airtight
@@stefanalecu9532 what I mean by "stuck around" is that C is still in top 10 most used language according to GitHub. While Pascal, Fortran, and Cobol are nowhere near that in terms of current usage.
So C is very old and still in the top 10 most popular, therefore it's a good language. Whereas Fortran is very old, but not in the top 10 most popular, therefore it's not a good language.
Well said 👏🏼👏🏼
@@stefanalecu9532please don't compare between the real programming language and a scripting language. Anyway I am sure you are involved with user space application software production but not with kernel space system calls, device driver software development. C is the mother of all programming languages as OS, Compilers, loaders etc and last but the least interpreters are written in C language.
Regards and blessings.
@@stefanalecu9532 Except that not as many new projects are started in any of those three languages compared to C.
Learning C was the best thing I've ever done for my C++ programming. I get all of the benefits of a very fast workflow by being able to leveage C++'s standard library of features while being able to utilize the nitty gritty of C when I really need it. Learning C has pushed me into writing better C++ code because I'm now understanding what those abstracted C++ functions are doing under the hood and can make considerations for each.
Bro, I have started learning c.... But don't know how can I start my career after learning it. What will be the future after it, If you could tell me regarding this I will be grateful to you 🙏
What is the best source to learn C language? I am new to 42 school and i will have a 1 year programming projects with C language so I need to master the language what is the best sources?
@@Ahmad-HirzAllah how about MOOC or coursera?
Learning C was the best choice I’ve made. I don’t want to waste my time learning technologies that won’t be around in a few years.
Learning C >>> Learning random crap JS framework which'll loose popularity in 1 week.
@@smallSphere69 way too based, watch out for trendsters crying about it
Like rust
Me too. And I simply like its simplicity.
@@jasonenns5076 Rust will get rust.
I like C because it's predictable. I mean, there are not that many layers between C and me. I have a pretty good idea what code it pushes out and how that will work out. With languages like Python, Rust and Java I'm always wondering "Yeah, but what's *really* happening? What does this thing under the hood? How many bugs are hiding there that I don't know of?"
Implicit declarations -- so many people think the warnings are for losers to read ;)
This is the cost of abstraction. The same way I could say I program in x86 assembly because I need to understand what a "for" do or a "malloc" do under the hood. That being said, I also agree with you that the predictability is important and should be a feature of any low level language
@@LucasGabriel-xz8nk The best C programmers have at least a hunch of what kind of assembly is pushed out. And they have a good idea of how the C runtime functions.
One could argue that a "for" is an abstraction in itself, of course. Or even a malloc() - and they'd probably be right. Even if one did assembly, I guess one would introduce a few fancy macros to "abstract" the boring details out of a program.
But see the difference - one is still very involved and *KNOWS* what these abstractions boil down to. Can you tell me you *WHY* a vanilla "for-next" in Python is dozens of times slower than its C equivalent? I thought so.. Too many magical layers.
(I made plenty of C VMs that were much, much faster than Pythons VM - so it can be done).
But it boils down to a simple preference. To some, fast is fast enough. And they don't bother about predictability as long as it gets the job done.
But I'm not that kind of guy. If I have to hunt down a bug, it'd better be mine - and not someone elses. But I agree wholeheartedly I'm just voicing my personal opinion and preferences here - not stating an indisputable scientific fact.
I wouldn't call C predictable. Implicit conversions, UB literally everywhere, differences in implementations, etc. Also, thinking that the std library has bugs is.... outdated?
(Rust btw has none of the issues above, and I would call it incredibly more predictable than C, would be happy if you could say why you think that it's unpredictable)
@@gigachad8810good point
Real engineering happens in companies where whole stack is based around C/C++ and low level languages
Define real engineering...
Wrong. The Us Defense uses Ada. Universities used Pascal for many years.
no, real engineering happens in publicly-owned organisations where there is no stack and people are developing new languages to replace pieces of shit like C/C++
@@DipsAndPushups the 2nd part kulled me 😂😂😂
I know someone who is a young software engineer who was just hired as a COBOL programmer. He never used and didn't know what it was before. His new company is teaching it to him.
I spoke to an engineering manager at Lockheed Martin a few weeks ago who hadn’t even heard of Rust. Expect C to be around for as long as it’s been here for government and military applications.
I've heard they also use Ada a lot
A bonus I want to add to this video: Because C is simple, there's usually only one way to do things, and alot of behavior isn't hidden from you, memory bugs are actually pretty easy to debug, especially when using any standard debugging tool out there. Honestly, the only bad thing about C's age is its standard library. It has alot of useful stuff you'll need but its not-so-good design is definitely showing.
memory bugs are also extremely easy to make at the same time....
@@samuraijosh1595 with experience you figure out ways to heavily reduce that.
1. NULL check your pointers.
2. Set pointers to NULL after freeing an allocated pointer.
3. Limit how much memory allocation you're doing.
4. Initialize any pointers to NULL if you're not immediately Initializing them to an address.
@@samuraijosh1595I suggest you look into the arena allocator
"there's usually only one way to do things" -- what? Looking at production code, all I see is idiosyncratic shenanigans, the same problem gets solved differently each and every time. Can you guess how a menu is implemented? Parallel shallow arrays, not an array of a certain struct. Mix in a ton of ifdefs, and now reorder the elements.
@@kevinyonan9666Exactly
I'm not a C guy, however I ended up writing a thesis about web programming in C, just to realize by myself that there is not, and probably I wont ever know, any other language like this. It certainly rocks, it's certainly the winner at the poker table.
Not only C is the grandfather of most modern languages, but it's also the corner stone of humanity's tech stack (Linux, Windows, MacOS, etc)
I'd have thought Algol-60 was the "grandfather"... C isn't THAT old.
@@edgeeffect what about fortran?
@@heruhday Algol-60 has blocks, repeat and while loops. All the things people would recognise in a "C like" language. Fortran doesn't.
@@edgeeffect fortran has repeat dan while loop..
Example:
INTEGER A(4,4), C, R
...
C = 4
R = 1
DO WHILE ( C .GT. R )
A(C,R) = 1
C = C - 1
END DO
Example
@@edgeeffect
Block example:
PROGRAM foo
INTEGER :: a
add1 : BLOCK
INTEGER :: res1
res1 = a + 1
BLOCK
INTEGER :: res2
res2 = res1 + 1
END BLOCK
END BLOCK add1
END PROGRAM foo
🎯 Key Takeaways for quick navigation:
00:00 📅 *Introduction to C's relevance*
- Discussing the relevance of the C programming language in modern times.
02:26 🕰️ *Common complaints about C*
- Addressing common complaints about C, including its age, lack of certain features, and perceived inefficiency.
05:16 🚀 *Advantages of C*
- Highlighting the strengths of C, such as its speed, versatility, and foundational role in computing.
07:32 🎓 *Educational value of C*
- Discussing the educational value of C due to its simplicity, hands-on nature, and ability to deepen understanding of computer systems.
Made with HARPA AI
Beginner programmer here, I'd say C is a fantastic first language tbh. The fact that it doesn't have a lot of the pre-built functions in it's libraries compared to other languages really makes the learning worth it since you basically need to make them by yourself. The way that I had to comprehend how memory work really increased my understanding when coding as well as improving how I view my code. Although other languages like Python can serve as an easier and more beginner friendly, C is in a threshold that's still doable by a beginner as well as providing a solid thinking process that will help when learning other languages. Learning programming by starting with C was probably one of the best choices I've made.
Learn assembly
I don't like python for begineers because it hides how types work (and yet has types). Types are foundational to coding in any language. A learning language should use strict types, imo.
@@jal051Hot take - all languages should use strict types. The amount of time you "save" by not having to type "int, string, etc..." is easily lost the instant you make one mistake with your types that only shows up at runtime rather than compile time. Plus the code is by far more readable on its own to other developers.
@@cyberchef8344 Absolutely agree! I don't even think I save any time not typing the type. One still has to make the decision of what type it is that variable you're declaring, so what's the point in not being explicit with it. You don't win anything. It's a fake simplification which only introduces troubles on the long end.
Bro, I have started learning c.... But don't know how can I start my career after learning it. What will be the future after it, If you could tell me regarding this I will be grateful to you 🙏
The first language I learned was C on crappy linux machine. It really forces me to learn how language, compiler, linker, os, hardware, build system, and libraries work together. That learning process really help me a lot later when I was learning other language and many aspects of computer programming in general.
C is the no.1 language for me. I do all in C even create gui programs for windows.
God I love C for everything, but a GUI must be next level in term of difficulty.
@@hypnoz7871 Its very easy, The base of win32 api is also written in C.
@@hypnoz7871It's not easy, but really not that bad. For eg. you can use gtk with C as well which is easier than winapi.
@@hypnoz7871 Depends on what library you're using. If you need cross platform, go with GTK. If you're on Windows only, the base Win32 API isn't too bad, or at least wasn't for me back when I developed with Win98. Though, I would still argue for GTK if someone even wants to consider a transition to a good OS.
@@hypnoz7871 depends. if your program is simple, a simple GUI library like raygui works really well and isn't hard to work with at all. Very easy to modify too since its so simple, so if you know a bit of graphics programming you can add any feature you want
I was a programmer from 1994 to 2002. Graduated in computer science from university of Montreal. I moved to another field of work in 2003. I was a C programmer. I still remember a lot of things, and I believe I could pick up programming again very fast. I knew (and still know. I have not forgotten) C++ as well, but not using it very much. I did many things in C that I cannot imagine how I would have done them without the "low-levelness" of C (dynamic hashing tables (dynamic matrices, 2 dimensions, double pointers). I think it was a major pain the the ass, sometimes, because OOP programing would have made the code clearer. Good ol times...
it’s cool that you remember so much, that’s a long time ago!
Hi i am a up and coming C developer i just wanted to say i really appreciate this kind of content it helps me to better grasp things about my studies so ty so much!
From an educational perspective I find that C is a much better teacher of how a computer works behind the scenes, and I like that it forces learners to pay close attention to and understand what it is they are writing.
yup going from python to C was like enlightement to me
C is the reason how I learn about how classes and packages works.
C doesn't have classes
*C++*
For systems / graphics / embedded programming it's a must. Also the syntax of many modern languages is basically a derivative of C. I recently worked with a code base that was written in pure C, not even C++. What a delight.
I just watched your video and had to smile at some of the "negative" aspects of C. I wrote my first C program in 1978 on a PDP-11/70 and am still using it. I have worked with embedded systems for quite some time ( a lot of WindRiver and Ada and C). I hear a lot about the need for garbage collection and think what it would be like if you vehicle was approaching a cliff and the garbage collection preempted the braking system. :)
C is indispensable for one simple reason: Speed. And the vast back-library of C material is incredible.
Great video! I would just like to add that, in the realm of embedded Linux, if you have a C cross-compiler targeting your board, that's all you need to build a complete system: bootloader, kernel, libc, shell, editor, command-line tools, Perl and Python interpreters, etc.
I wrote a whole custom server and desktop provisioning system for a company over 15 years ago in C. It’s so good, that multiple attempts to replace it (because someone in management was being told by vendor salespersons that they should an commercially available product), but every attempt has failed because the custom solution works so well.
Because I did not rely on any libs other than what is in the core OS, it doesn’t have fragile runtimes that require constant updates and releases, etc…. Anyway, my point is that C is powerful, it is fast, it is secure (if you know what you’re doing) and it can reduce the need for “framework update driven releases”.
Years ago, I worked for a company that "bought" old code (java and C/C++), and recompiled it, etc. I love C/C++. Love it. But old C and C++ code does not want to compile on new compilers. And to add insult to injury, there was not any work at all to converting the old java code. It all worked right out of the box. I have not used it much, but it did make you like java. The C/C++ code, when compiled on a new compiler, was sorta buggy. We spent a month compiling, and getting it to work, writing new make files, etc.
Bugs that pop out from moving from one compiler to another, are failure to initialize variables, and even small details in the language, like holding a string.c_ptr too long, and reusing when it left scope. Or worse. dereferencing null ptrs, is a feature in AIX xlc. so, they do memcmp's against NULL
This has been alluded to in the video and in the comments, but after 16 years in both software and embedded systems - the number one reason for C is “control”. As you’re writing, you can pretty much know exactly what instructions the compiler will generate and how data is accessed and moves throughout your system. I don’t know of many other popular languages where that is the case and it serves as a good and predictable intermediary between assembly and higher-level languages. (And as as aside, if you think developing in C is slow, try writing in pure assembly.)
In most application software, you typically don’t need explicit control over both “what” and “how” the CPU works, but in certain subdomains it’s absolutely critical: high performance or tight memory requirements, finite timing (e.g. cryptography or hardware drivers), determinism (e.g. aerospace, controls, or other intrinsically-safe domain).
So when I hear bunch of people complaining the language isn’t relevant, I hear people saying that it’s not relevant for the domains they’re familiar with
I would say "control if you know every detail of the arch and os and compiler you are using/compiling for"
In an extreme situation, with little contact to outside word I would chose C and maybe Python. C is one of the few languages in which I can program without the need for online documentation. For all the other languages I know the path most traveled, but as soon as I wander outside of it I need some way to refresh my knowledge. I added Python because it's fast (not necessary safe) to code in it but you still need proper documentation for the used libraries.
For basic stuff like what function arguments mean, Python's built in help function can be useful. E.g. help(random)
I really appreciate your balance opinions!
As a CS student who has been touching C for at least two years, I think that besides its familiarity (syntax and awareness of it) with lean, mean execution, there are two other reasons. For the other points, I compare C programming to philosophy. You do it for enjoyment. And the more you get into it, you gain insights into how things work or why things are the way they are. Overall, the best thing anyone going into programming can do is to keep learning.
My heart is big enough for Python and Java too.
As a former CS student currently working in industry... I don't see a place for Java, other than when required because it's already in use in a project. If you need to be fast/close to the hardware you have C, C++, and Rust. If you need fast prototyping you can use Python. If you want to be able to quickly (or even for production) throw together GUI applications you can use C#. Java's original pro was that it provided: object oriented design patterns, garbage collection, and portability. Object oriented design patterns are largely falling out of favor because they end up making the code more complex than it needs to be - not to mention it inevitably blows up into a non-maintainable mess the instant the goal of of the project changes. Garbage collection is implemented in other high level languages as well - plus you could just learn how to correctly manage memory and the whole thing becomes a non-issue. Portability... not really sure where this myth that other languages aren't portable came from. Sure the binaries don't transfer... but who cares. It's really not that hard to set up a few toolchains. For the most part you have Windows, Linux, and Mac OS -- and that's assuming you want to support all 3. I really just don't see how Java has a place.
@@cyberchef8344 Ah, I forgot to check replies earlier. As my update, I agree that Java felt sluggish to use even for leisure projects. The documentation was fine, but looking at all the extra OOP patterns tossed in along with the forced use of classes made me come to a similar conclusion. Java is clunky- development-wise and syntax-wise which made me grow tired of it. At this point I would only use Java for writing Minecraft plugins.
With that being said, what are your thoughts on Kotlin in terms of the programming experience?
Are you guys kidding? We would not have any development in our daily computing lives without C.
That's true but C could still get outdated. Like horses got replaced by cars, C could become similarly irrelevant. I personally love C but your point is weak
@@8292-d6nC stood the test of time, probably it wont be replaced at all, it has all the things you want. Although it takes time to create something, on the way you wrote your own libs and can probably be more productive
@@8292-d6nYeah, but what could replace C? Rust? Cmon it has a very ugly syntax. C is designed to be simple and efficient. It never wanted to be memory safe.
Forget any modern day application of C.
The most thing is C will teach how becomes programmer in proper way.
Yes other can also do that but C is low level languages and don't have any sefty feature of modern languages. It will force you write code right way
It is mother of many modern programming languages so once you learn C. It will make you little easier if you try these languages.
Starting up with c as my first programming language in college makes learning java easier and our professor actually emphasize the important of c despite it being old. We are trained to build our logic while learning c and it really help, i think its a good start especially with someone studying IT or IS but have no background knowledge like me.
Absolutely worth it. It was my third language I learned 35 years ago. First was Basic language, then Z80 Assembly. If you know C well, it's very easy to learn mostly all other languages. For example, getting into Go or Rust is very fast. I learned it with K&R book but nowadays I recommend the book Head First C, it'll give you a very good idea of Linux inner workings too.
To be fair, when you program in C or C++, you program what the standard calls an "abstract machine". While it is a good model of a von Neumann computer, it certainly misses some parts of a modern system, like caches, branch predictors and SIMD, though SIMD is on the way to C++. Thus, code that looks fast can be slow depending on memory layout, any potential aliasing etc. Also, on some machines, floating point operations must be emulated in software. If the result becomes a subnormal number, many processors (even on servers and desktops), need software support.
I got to C from assemblers, programming close to the metal (as a physicist). That taught me a lot. 'The C Programming Language' - K&R - was a revelation.
Now Rust is around; That might be the follower for close to the metal. But running the rust tools on a PDP-11 would not work unless you have a lot of spare time.
Regarding "rust tools": Do you mean running the Rust compiler on a PDP-11 or the resulting binary?
Probably both but I think porting the compiler to work within the limitations of the PDP-11 would be more difficult than simply writing a PDP-11 backend.
@@Burnr-hw6zs I meant the whole rust stack. A binary would work fine, at a guess, although you'd have to build a compiler; and that is a very clever and informative compiler. Squeezing that into a PDP would be a mite tricky.
@@Burnr-hw6zs That is why I used raw C. Better than assembler and close to the hardware.
Now I can cross-compile Rust (or C, for that matter) to the little machines, microproccers, that I use to hit the hardware. Which is fun. (I'm mostly retired - my PDP era was getting on for 50 years ago, but the notion that 'os C useful?' is, I think, on the money, especially if you use it to get at hardware addresses. You learn a lot of what a computer has to do, without the nuisance of learning assembler)
I like c for learning but cannot endure it’s lack of generic programming that cpp has.
Templates and concepts, constexpr, namespaces made me fully switch to cpp.
But I am still looking for modern alternatives.
"I like c for learning but cannot endure it’s lack of generic programming"
Generic programming in C needs programers that have strong brains.
C doesn't have the best syntax for generic programming, but if you read the standard and play with some example code you can still do everything with it that you can in C++, just with less sugar. For reference, look up _Generic in the C standard.
@@anon_y_mousse ,
I've found that for the first time =D
Thanks for this
The other nice thing about C for learning to code well is that with Python you can get away for a time with writing sloppy illegible code but C really forces you to pay attention to what you're writing, how you write it and how you structure it other wise it likely won't even run.
I’m currently taking Harvard’s CS50 and I have to say that it’s great for understanding what’s “going under the hood” plus that when we swap to python it will be definitely much more easier.
25 yr career. Started in C, then Java, then .Net, then NodeJS and have been in Go for several years. Rust syntax for complex tasks makes me want to throw the keyboard out the window (literally). Go and Rust were both originally written in C. Picking up videos on this channel due to something you may have not thought of: ClaudeAI. It does amazing job with code generation and only getting better. This can open the door where AI takes complex business problems and cranks out low level code (C or Assembly). Therefore negating the Cons mentioned in this video.
Using C since K&R first edition (1978). It is the underpinnig of almost everything (including C++). If I had to pick one language for the rst of my life it would be C. But every other language brings something else to the table. All languages that find a purpise have something to offer. Python is great for teaching and casual learning. In the old says we had to pay for languages, hunderds even thousands of dollars for a compiler. Now there seem to be free versions of everything. Sometimes the old days were NT as good as today. ;-)
My advice would always be "If you have to pick ONE language for the rest of your life..." - don't! ;)
I love the preprocessor. I can register functions in an array of function pointers to run as unity test one after another using the try and catch definitions using setjmp and longjmp
I think learning assembly (I learned Z80) and C gives you the low level understanding how a system works, how optimizations work and what performs best. C is usually the first high level language on any given new system as a bootstrap language.
C is still used in many embedded systems, drivers, kernels, high performance applications etc. The number of languages that can rival c is increasing but can't still beat the maturity of tools for c yet. Imagine the carbon footprint of youtube, ai training, processing of big data using python or even C# and java. It's not only not performant, it's irresponible for our little homeworld!
Perhaps a good test for a programming language is to see how well you can work out what someone else's program is doing and how it is doing it. That said, I'm struggling to learn C as it seems to be the defacto language for embedded systems - which is what I need it for.
Fabless manufacturing and electronic design automation are two growth areas where the talents of someone skilled in C are essential. One could be picked up by companies such as Intel, Apple, NVIDIA, Google, AMD, Microsoft
In my opinion C has 2 unique things: it is one to one mapping to the von neumann machine execution model, so you program with the control data flow in mind AND has all the basic tools for algorithmic recursion,, stacks and so on. The example you gave about code lenght does not say the other one was calling a library. if you have a great library, you do the same with C. The last thing is memory access: you can teach how to write safe c, it is totally possible if you do well from the beginning and you know what arw you doing. A simole example: you can use pointers only on specific restricted and controlled part of your code, so every memory plays is there and the algorithms are in another place.
Could you make a guide about programming an embedded device/board from scratch? Considering an empty project, what datasheets do you need to study to get 1. the board and 2. the devices in the board to breathe? Where do you start with the board code and while going through these steps, explaining the registers and other relevant stuff in making the board come alive.
C is highly productive when you got to the point where you wrote lots of small libs to help on some low level stuff. Features in other languages can most of the time be adding as small libs in C. But C will always be waaayyyy faster to compile than any new language.
It's a small, simple language. That won't change a lot in the future, that's a real plus.
Hm... yeah. A clean build for a not-so-enormous microcontroller we use, depending on the features we compile with, takes anywhere from a few minutes to go grab a coffee, take a walk in the building, take a dump and it is still not done.
@@varadinagypal You really wanna use single translation unit builds if you want fast compiles in C/C++ otherwise as your project grows it will get slower and slower. It's really rare that you have the freedom to do that though. Some newer languages are trying to solve the issues with compile times though, we'll have to wait and see what happens.
@@xhivo97 How is it rare having the freedom to do that? C allows you to put every function in its own file, if you want, and you can even add the prototypes for them all into one header to make using them from anywhere easy. And with tools like `ar` you can even update a library one module at a time and build super fast. Learn the tools and their proper uses and you'll be happier.
As a newbie, C really taught me about the mechanics of how variables are declared and work. That is from a view of what's actually happening in the hardware. Compared to something like python, which is like riding a bike with training wheels
Did it? I honestly didn't really understand how variables work until I learned assembly. C hides it from you by creating the abstraction of "types". A computer doesn't understand types
Every time you mentioned Rust, I kept thinking "but will I be able to cross compile to 6502 with it, like I can with C?" ;)
(I've been writing games and apps for the Atari 8-bit conputer in C... after decades of BASIC and an Algol-style language called "Action!".)
MAC/65 did change the game after using the Assembler Editor cartridge for a long time. Took a massive, but powerful, Atari BASIC program and sped it up considerably. However, I did right a one-pager in BASIC (including more REM than not) that I find people unable to write even today in an efficient manner. It solved the "birthday problem" in about 30 seconds. "Find the number of people required to have a greater than 50% chance of two people having the same birthday. [People are born throughout the year with equal likelihood.]" Yeah, on an 8-bit machine with 4k of RAM. It's a good program for students to try in any language.
Based on your opinions on c, I think you will like zig a lot more than rust, at least for some use cases.
idk if you know anything about zig so here are some highlights:
- zig aims to replace c
- it is simple, while having some modern features,
- it has amazing interop with c
- it has an amazing integrated build system, that can be used to build c/cpp projects too
- in particular cross compilation just works, even for c/cpp
- it has a package manager, which works for c/cpp projects
- it provides even more control of memory than c (or at least makes it easier to have more control)
- due to various reasons, zig can often be faster/more efficient than c
- it has safety checks (compile time and runtime), at least in debug or safe release builds, I believe some checks still remain, not certain tho.
I learned C at a New Jersey community college, taught by an old gray-beard retired from Bell Labs; was the best math class I've ever had! These days I'm mostly using Python and Javascript, but when it's easier to just write a plugin for SQLite, I dust off my old C chops and delve into malloc() and void (*)() and all my old friends. C is portable assembly; it will teach you how computers work and that knowledge is foundational to any competent programmer.
C was the first programming language I ever learnt. It was difficult and a headache to learn, but I must say, it was thanks to C that I fell in love with programing and computer science/engineering in general. I don't whether I would have liked so much programing, have I learnt another programming language first. Its simplicity made me understood that I could do tons of stuff with programming, that I'm limited only by my own creativity. C is beautiful because of its simplicity, it's ugly because it can be a headache sometime (pointers), but in general, once you understand the basic idea behind C and programming, C is great!
C is easy to learn because it's not very abstracted, but hard to use because it's not very abstracted. It can do a lot with it's basic tools, but knowing how to do a lot with it takes a lot of time and effort.
Every time I sit down to use C, it does feel like building a house with popsicle sticks, slightly better than the toothpicks of assembly, but not as effective as the bricks of C++.
It really comes down to what software tools are best for the specific project that the programmer is working on. While I think it is good for many programmers to learn a bit of C to better understand how computers work, I don't think that every programmer needs to master it in order to be a "real programmer".
Many jobs focus on completely different languages and skills that don't require any advanced knowledge of C so it's totally viable to not worry about it too much if it's not something you'll need very often.
Then as far as Rust (and Zig?) go, the student programmer should probably focus on C first and then learn the newer languages as C is much more established. 99% of systems jobs require C and some assembly knowledge anyway, and universities still tech it, so it's hard to avoid it if the student wants to do that kind of work. It's also pretty easy to pick up newer languages later anyway as they'll only have to learn the features that are different that C instead of all of programming all over again. The newer languages still use many of the foundational concepts in C, just with improvements with the hindsight to see what didn't work as well.
Summary: Driving a manual transmission is nice, but becoming quaint, as ever more people drive automatics with so many features. That can be a good thing; however, the trade-off is usually needing to return to a dealer for proprietary componentry, even if an aftermarket place is willing to work on the vehicle. But that's not the same as programming or coding for a job. Then it's about business needs, not personal preferences.
Hahaha, sick burn at 1:28 (the caption at the top-left). 😂 🔥 I too have a love-hate relationship with Perl.
hahaha
Java runtime is written in C, even javac compiler is initially written in C (yet others claim it is now Java compiled in Java, still it is compiled first by C then bootstraped to Java), majority of big Python libraries that require high computations are written in C, JavaScript V8 engine is written in C and Assembly, etc.
but for me I develop in Java, specifically using Spring Framework, because that serves my work purpose, and my self interest..
Hello
I started programming with python like most of the beginners do, though Python has eclectic libraries for almost everything, if someone wants to understand how a computer works under the hood, C is the lang one should look up to. After learning C, a lot of concepts that previously sounded unconvincing to me, started making sense.
asking whether C is still relevant is like asking whether we still need our head. C is like a blood, you remove it from human body you know what happens next.
I tend to avoid using C because I’m a C++ programmer and since both languages are very similar I made the choice to only use C++ to not get confused. But the drawback is that I don’t know C that much. 😅
Basically C is C++ without classes, namespaces, templates, references and overloading.
There are things that C++ simply cannot do. There is no MISRA-C equivalent for C++.
@@vitalyl1327 MISRA C++ exists
I have spent a lot of time in asm and now am making my 3rd attempt to learn C. Its a great language and is a great re-entry back into the world of HLL. C may be known for lacking abstraction, but asm has even less--none!
You hit a major, underrated argument; the educational value.
C's minimal abstraction is fantastic as a bridge between human logic and a processor. It's that happy medium..
Yes, it is frustrating to learn.. yes, it takes more lines of code than other languages with more abstraction. Yes, the strict syntax throwing compiler errors is annoying to new programmers. Yes, it can be annoying to have to define everything.
Yet when you actually learn how to use C, you gain a greater understanding of HOW and WHY it all works.. compare this to highly abstracted languages, which might as well be magic (unless you are the kind of person who digs deep into libraries/source files to find the lowest level of methods.. few do that).
If you have a good understanding of low-level things, you'll have an easier time learning high-level languages.. and your ceiling grows..
What kind of coursework would best fit using C for it? e.g., Intro to programming? Data structures class?
OS kernels (even modern kernels) are almost universally (arguably necessarily) written in C. C is basically tuned to work at a low level of abstraction while also being portable to multiple architectures. If an application needs to obsess about every clock cycle and every bit of memory being used by the program while at the same time needing to be portable and readable... then that application (for better or worse) is probably begging to be written in C.
Yea I'm sure that won't change. I also don't know any OS that has been adopting another language well. I mean why would anyone want to avoid C? Theres absolutely 0 issues with it
C has got to be good. I learned C 25 years ago at community college. I started 50 years ago writing code using assembler language. C could have enhanced function libraries. Assembler used prewritten Macros. Maintaining systems written by other programmers. Invigorating.
To be honest, I think C is vital as a pedagogical language, because it's a lot "closer to the metal" than the newer languages, but still human readable. When I was in school, they started us on Scheme for algorithms; then assembly language for pain and so we'd be *grateful* for C; then C sold as a nicer version of assembly.
Point being, it's good to know C to make sure you really understand what your program is doing, and for the *occasional* high-performance application. But most of the time, the ease-of-use of python or C# are more important. Person-time is usually more expensive than beefier hardware.
I like C. I started with QBasic in middle school, and came back to programming more than 20 years later.
The coding example where only a few lines of Ruby compared to lots of lines for C highlights the value of libraries, not necessarily differences in the language. The C code is great for showing what is really happening versus just library magic. If someone wanted to, they can create a library that would make the C code as simple as the Ruby code.
After someone has a firm grasp on C, I would argue they should learn an assembly language. Not that they'll ever program in assembly professionally, but it will help them understand what is going on under the covers much better. My team at work has a mix of developer experiences, all coding in C++. If something goes sideways, one of the guys that learned assembly is more likely to fix the problem them someone who only knows C++. Not that assembly is called for, but an understanding of what is going on under the covers is required.
Your videos are awesome. Thank you!
You forgot: in C you can define a variable that is a pointer to a pointer to a pointer to a pointer to a pointer to a pointer to a pointer to a pointer to a value.
It's amazing how C gave birth to so many interesting programming languages. Some of my favorites like Kotlin, Golang, JavaScript and PHP and yes Python. My only gripe with C is what can a new programmer build with C? Seems only advanced developers are able to create compilers with this language.
As a "Rust Enthusiast": C is the best thing that ever happened to me. I came in the weird way with no formal training (I studied Journalism, then ended up building Sawmills, later ended up with Video Game QA, and am now doing Test Engineering at some rando website people use). Through that last, the TE, I have grown to like certain ideas in Rust, certain approaches, so I wanted to learn it.
But it's hard. It's got a lot of stuff that can be difficult to pick up. And nothing has been as good at teaching me that, as taking a step back, using C (often with the help of a certain Sorber's videos), to achieve the same thing. Eventually I figure out that there's a thing I had misunderstood about how things REALLY work under the hood, that other languages I use (Shell, JavaScript, or the Rust I was learning) was sort of hiding from me.
After that, I can drop C (until next issue), go back to Rust, and the latter is suddenly WAY easier. Because I spent some time with C.
Or, as we call it: "Vitamin C". :)
Would you say to someone learning Rust to first learn C? Asking for a friend 😅
C has a stable ABI it's a very small language which makes learning easy and you can pretty much write anything with it. But do some simple stuff with strings for example and the missing features get ridiculous fast. I could write a small lib in c or something for a micro controller but I wouldn't want to write any larger serious program in the language.
c helps to understand the programming easy, right now i am also explaining in telugu.
Yes, it's relevant. When you go into industry, there is a good chance you will code in C++, Java, JavaScript, or C#. The syntax of all four of these is based on C. A new developer who only learned C in college can be brought up to speed in minimal time in any software house that codes in these other languages.
I've learned many different languages over the past 40 years to varying degrees of proficiency. I'm strongest in C and C++ . Recently tried learning java again after a number of false starts, the first being back in the 90s. Not going well at all. I hate it and I hate it's awful ecosystem. And don't get me onto the monstrosity commonly known as "Eclipse" %$#@&%$. Piece of crap.
So you're probably correct in general, but some tools and/or languages can simply be a bad fit... I'll never be a productive java developer. That has again become crystal clear.
Ya, the concepts of the technology is more important than the how some language/framework deal with them. It will lay a stronger foundation and allow user to have easier transition to other language/framework.
You can get around type safety but to say C isn’t type safe isn’t quite correct imo. The main thing missing from C is templates; you can’t compare a library in language X with bare C implementation.
Of course, C/C++ may be behind things in other languages - e.g Pandas.
Where I work we have lots of C++ with Python layers.
C and Haskell - those are two languages I think students should learn in depth. Don’t understand the appeal of Rust tbh.
Great video, thanks!
The newest iso version is c23, I’m curious how soon will the next version come out?
I think it’s good if you actually need it, or as a teaching language because manual memory management is very good to learn in general, even if you never use it. Pointers are good for visualization ability.
I am learning programming for web development with Golang and JavaScript. BUT I would like to eventually later on make games as a hobby with C. My focus with C is to learn memory management and to get better at algorithms and making games with C sounds like it can be fun.
On the subject of making games with C when I looked on TH-cam most were making games on Window and they all were using Visual Studio as their IDE as well they were using Power Shell. But what if you are on macOS? Can you still make games with C on a different operating system?
side note: Visual Studio on mac has been deprecated.
Definitely yes. While, writing in C#, i decided to make some CLI prog on C and discovered so many concepts, like actually using gdb, or thinking on how to allocate memory for different scenarios, that I can project onto my C# workflow. Also, Vim is the best editor for C/C++😅
hello, can you advice on what language to begin with? I have no specific goal in terms of what i want to do with the language. I'm only learning for knowledge sake, with the aim of maybe using it for automation and AI/ML in the far future. (I have no interest in doing this for a living)
i heard differing things from experienced programmers.
"Dont start with Python, it doesn't teach you anything about how computers work"
"Start with python, its easy"
"Dont learn JS, its trash"
"Start with Assembly, then move to C, and then Python".
etc, etc...
So you see why im conflicted. Any advice and rationale for it would be much appreciated.
I love C. It's supereasy and I feel in control. My only complaint is how painful it can be to setup a project sometimes. Linking libraries can be really annoying, specially when half of the times you need to recompile them. I hate this part of the proccess. I find my self writting things in Python just because I don't want to setup a C project, even when I feel way more comfortable with C.
I'd be interested in seeing you compare Rust and Zig. Both are trying to fill the General Systems Programming space, but Zig is leaner and takes a different approach from Rust as a successor to C.
Rust is a "kitchen sink" language that is good for replacing C++.
Rust is NOT a successor of C. It can't be. It's too complicated.
A better successor of C is Zig and even then it is FAR from complete and the technical debt of C is likely too big to be overcome in my opinion.
@@hypnoz7871 Can you detail what you mean by the technical debt of C?
@@hypnoz7871That's interesting as it appears to me that many Rust adopters are often C and C+ (that is, C with classes) types that weren't on board with modern good C++ practice. The C++ guys are interested in Rust, but more to borrow the good ideas and bring it into C++ rather than switching over wholesale. Consider the Linux kernel looking to add Rust support even though Linus famously has an irrational rant against the language that pioneered many of Rust's most loved features.
@@savclaudiu2133 I think they're stretching the definition of "technical debt" to mean "the existing real-life programs people currently depend on", which is really describing a very different thing to "technical debt"
C is fast and efficient in both execution time and memory space. Is there a good preprocessor to help us write C code faster and satisfy some of people's complaints about it or simply speed up the process of writing C code? if there is, I would like to be told of it.
With these advances in AI, you would think someone has come up with something--or should come up with something. I would even like to contribute to a program like that, providing it's written in C.
I came across your Chanel while looking for AI or neural networks written in C.
My personal experience was as an AGC (Automatic Gauge Control) engineer starting in the late 1980's when hardware wasn't that fast and we were writing feedback control loops for rolling mills and the managers wanted as much of the strip to be on gauge as possible, so execution speed was paramount.
can you make a tutorial about transferring executables and shared libraries from one linux machine to another linux machine with different version (e.g. from ubuntu 20.04 to ubuntu22.04/fedora 38)??????????????
Unless the executable is statically linked, don't do it. If it's open source then just recompile on the new target. If you absolutely have to because it's closed source, try a virtual machine to run it by copying the entire system as a disk image and running it that way. Version mismatches in libraries will cause you endless headaches.
@@anon_y_mousse That's exactly what I've been dealing with for the past week. Is there a tool to remedy the pain??? I need a tool to help me with library versioning of executables. (besides ldd)
In the before time. I started in FORTRAN in the mid-70s with punch cards. As for C, I heard about it in the late 70s, and started programming in it in 1980. Still do. It's like driving a manual transmission. I could compile decent programs without having to drop into machine-specific assembly; however, I still wrote in assembler until around 1983 for fast stuff and in BASIC for generic on the then-new home computers. For mainframe work, it was still a lot of COBOL, and I treasured my JCL cards. I did use LISP for a brief spell in the mid-to-late 80s.
Today. I've used C++, but it's clunky and heavy enough, that I simply write in Java at that point or drop back into C. That's for compiled or mostly-compiled programs. The rest are scripting languages. Perl, Python, Ruby.
Learn C. It works in the snow.
It's still widely used for embedded systems along with C++
I find that C programs execute faster than others -- simulations like Monte Carlo etc where CPU time is a factor runs for more iterations per unit time than potential competitors, eg Python. (A challenge to a colleague to write a Python program for the same simulations as one in C showed that the C program outperformed the Python program by an order magnitude -- I dont know why this is, but I assumed that it was due to overhead in the Python program for data structure control IO etc. Additionally, C integrates easily and beautifully in a parallel threaded environment with omp protocols -- threads run simultaneously on different CPUs and interacts without a hiccup, giving further factors in the reduction of CPU time for the simulation).
I am still confused about Rust and Go? What are the problems they are trying to solve. I have worked with embedded system for 20 years, and cannot visualize how Rust will replace C in embedded systems.
Any suggestions?
Ever had... a segfault? a use after free? a double free? UB because you: accessed an array with an invalid index? forgot to initialise something? wrote a value that was being read by another thread? Invalid behaviour: because you didn't support utf8? because something was implicitly casted? Ever used `int` and expected it to hold more than 2 bytes? Did it work for you? If so, you are lucky.
C has been my goto language for almost 9 years, Still my favorite, but I'm now learning golang, I think it's good language to pick up if you already know C.
My only complaint, where I truly regret using it, it is with string or regex operations. Strings aren’t fun in c
Just write some C++ or Js strings functions and you can be happy
@@paluz1177 Exactly…but then why am I using C? The point is, if I’m not using strings, I use C. If I am, I am using C++
I always wanted to learn C in school. But C has no classes :(
If you can, learn it yourself as much as you can. It'll suck. All of us had to put up with it.
Once you get a chance to take the class, it will make much more sense.
C is like a stick shift, when you’re going sideways in the snow, you appreciate simplicity (no 163737 versions of c++) and third pedal (completely unguarded pointers) !
Hey Jacob, do you know a book/course to learn about OS (linux) with C? I have already 2 years of experience with javascript, typescript and python as web dev
When I see people using a Raspberry Pi, an operating system and Python to flash a couple of LEDs, I could weep. Sure, as soon as you need complex interfaces, BlueTooth etc, it's different. However, if you don't know 'C' (or assembler) how are you going to program an 8 pin Microcontroller? Unless you can get down and dirty with the hardware, you'll never grasp how these things work.
I've written an entire CNC controller in Assembler, before 'C' compilers were efficient enough to get the necessary performance from 8MHz hardware. (Yes, I'm very old) Understanding programming at the lowest levels really helps when you move to ever higher level languages.
What I like from C is how explicit the language is. There is no name mangling, there are no function or operator overrides.
In the final exam from last term, one student answered a question, basically "what does this code do?" with "who knows? Is += overloaded?". I feel the same looking at any language that took hints from C++
About those language features: other languages don't have features C lacks, they have features that were probably *built in C in the first place*. As I love telling my class, serious C doesn't look like C any more. You've been rolling your own libraries for a decade so common tasks are one-liners, there's a framework for handling runtime errors, and your output code or array slicing is concise just like any high level lang... that nobody else understands. In short turn your capability issues into compatibility issues lol
Whats so explicit about C? I'd rather stick to a real explicit language like Rust, thx
Even when I finish the development of Nemesis and release it, I think that the C programming language will still be worth learning as it has some very useful tutorial that help you understand pointers and low level stuff (that will be useful to optimize) that will be very hard to fully modify and translate to Nemesis.
Is that the name of your programming language? What is going to set it apart from all the rest?
@@anon_y_mousse Yes, Nemesis is the name.
Nemesis will ("will" as, It's very early in development) be a language focused in safety, reliability and re-usability! The official implementation of the language will be a compiler that uses LLVM for the backend!
Even tho the compiler is not ready yet, you can see the public repository that is hosted on Codeberg (I don't give links because I think TH-cam does not allow it) that contains code examples about how it will look under the directory called "code_examples" and there is even documentation that I have written ahead of time using "sphinx-docs".
Of course, it also contains the source code but who wants to see that right?
Star the project to stay up with the progress ;)
Rust is good, but I don’t know if it will make it. So few know it, and I can’t find any projects that are being done in it.
On a side note, to understand Rust you need to know the same concepts as C. Things like pointers (By Val vs By Ref), stack vs heap allocation, thread concurrency, etc. are issues in Rust, but the structure of Rust programs tend to eliminate these issues by convention.
Hahaha you know a lot of projects that are using Rust, you just don't realise they are. To mention a few: Windows, Android, Chromium
@@gigachad8810a few that utilise c/cpp: linux, windows android, python, java, unreal engine, bash and many more
Simply put, it’s the heart of embedded software engineering. If you don’t understand the importance of embedded systems then you have much more to worry about than if C language is still relevant
The comparison at 4:51 between Ruby and C, leaves out that the Ruby code had zero error checking, whereas the C code had that - any programmer worth his salt does do error checking
Yep. Good point. Thanks. Of course, the point still holds if I add error checking. The code is still much much smaller.
@@JacobSorber: I believe you and still I do not really see "source code size" as a significant parameter for the decision about which language to choose.
What I believe is important is either a language which is "programmer efficiency", i.e. a language that makes it faster for the programmer to get the job done, OR execution time efficiency. For the first a scripted language might very well win, and for the execution time "C" will practically always be the fastest.