Whoever does this should be hailed as a god of programming. Songs will be sung of their deeds for a thousand years. Shrines will be built in their honor. Children shall be named after them. They will bring about a new era!
I've used C professionally long enough to be mad at it's limitations, but it is still the best language to build your foundational knowledge with. Because once you understand C, you start to understand the building blocks that pretty much the entire field of software development is built on. You don't have to learn it first IMO, any high level language is fine, but definitely learn it second. Speaking from my experience learning C contextualised my earlier experience with Java and a lot of the design of the language features started to make sense.
Hah, it's funny reading this almost exactly 8 months after beginning to learn C as a result of this video and this comment. I wonder, when you wrote this, if you knew that you would motivate a random stranger to spend an average of 2-3 hours a day churning through C textbooks, exercises, and programming projects in an attempt to understand computers better 😅. Thank you!
Whether or not you're going to learn Rust or use C in production, C is so immensely important to computer science and computing history that basically every real programmer needs to have experience with it
@@lubba64 Really? From experience I'd say that having the confidence to use C anywhere makes you 100x more effective as a developer - even if you don't use it in whatever project you're currently working on.
I feel like rust improved my "combat posture" - other languages will let you write basically whatever, so it's easy to get into bad habits since the compiler usually won't catch them, or will give you warnings at most. in Rust, mistakes that are just considered bad practice in other languages are actually compiler errors, so rust can help you learn how to design resilient code, and it's a skill that will affect how you write non-rust code, too.
As quite a new „rustacean“, the biggest improvement for me was the tooling. I know C and C++ have lots of great third-party tooling but no setup one short command for everything is just so much better.
100% learn C. I would advise any beginner to start with C until you get to posix things, do those too and voila, a bit more networking stuff and you are set for great success
@@hanselazerus The STL vectors are great and stuff, but you don't learn the essentials of bad pointers and bad array indexing and fencepost errors that the C compiler blindly lets you do.
Experienced developer here. C and Java among other languages. I'll learn RUST as soon as I have a need for it. Right now there are no job listings that list RUST in my area and right at the moment there are no software projects using RUST that I want to get into. If you're going to be a developer you should expect to be asked to pick up languages quickly as needed. It shouldn't take more than a couple of weeks to get productive with basics, though obviously it will take you longer to learn idioms, libraries and frameworks with proficiency.
So I re-write to build a project which was previously built on typescript with rust , I’ve been crying since , rust is after my life , the syntax is sweet, I love it forces you to use snake case conventions but it’s just too unnecessary complicated
Agreed. After a few decades you get pretty good at spotting long term trends vs fads as they emerge. The current return to caring about low level code is an expected outcome of moores law tailing off whilst scale keeps increasing. Rust is in the fad category. Unfortunately a lot of noobs can’t see this yet, and they are going to get horribly burned by investing heavily in rust. They are all cheering each other on, watching videos from inexperienced “sw engineers” who don’t know any better. Rust has all the red flags of a massive train wreck in the making.
@@steveoc64 *Fucking this* seriously Rust has been treated like the second coming of Christ for the past decade and yet there is still basically nothing that actually uses it its actually insane how *not* popular it is, its like the reverse Java.
@@AlbatrossCommando The language is only 8 years old, give it some time. Firefox's entire JavaScript engine is written in it, and it's starting to be used more and more in the Linux and Windows kernels
Full stack dev here and I can't stand how commonplace it is to just not give a fuck about memory. This depiction is so accurate. Even solid experienced devs happily choose js methods that create completely unnecessary memory and make excuses.
Tbf, JS makes it difficult to not allocate memory. You fight the language to be performant. Other garbage collected languages don’t necessarily have that problem, despite garbage collection always being a performance uncertainty.
Not caring about memory waste is one thing, not caring about memory safety is a completely different issue. JavaScript is memory safe. C is not. Using a wasteful js method typically won't create bugs. Being careless about memory management in C typically will.
As a devops and sysadmin... I'm the one that ends up feeling the pain. Typical one: reading unbounded queries from a DB. A Time Bomb waiting to explode on most of your systems. (I'm sure your company have at least one of those, no matter who you are :) )
@@framegrace1 True but as always its a balance between the cost of that timebomb going off vs the cost of preventing it from happening. Highly reliable systems simply cost more. But yes following best practices is important to reduce the number of potential time bombs.
Seems like the only reason people want to replace C is because it's old. It solves any programming problem you can think of and will get you a well paid career if you get good at it.
My advice would be to learn several programming languages, at least 3 or 4. So learn Rust and C, but do more if you can. I can at least recommend learning a combination of languages from which you learn all of these aspects: manual memory management, automatic memory management (garbage collection), procedural programming, object oriented programming (OOP) and functional programming (the latter one is gaining more popularity these days), strongly typed, loosely typed (scripting languages are often loosely typed). Many languages have a combination of those aspects, so you can often learn multiple things together.
I agree C is great as you need no libraries, objects or classes when creating software. Direct low level hardware calls give you full control of the audio chip/card.
@@parlor3115 Idk what do you mean but I have 2 answers: "Ok, and are those advantages of C?" - Yes. "Ok, and what are advantages of C?" - That you can directly manage memory. You pretty much have full control of your cpu. So pretty much what the main comment said. And that's not everything but obviously I am too lazy to write everything here.
Just gained a new respect for you. Many Rust tubers try to shit all over C, that you should avoid C like it's Aids, that C is useless, etc, denying the fundamentals of systems programming and understanding of programming as a whole in general. C is an incredible language, BUT so is Rust. It's very refreshing to see a Rust advocate step up and be honest about it. I tried learning programming from Python, C++, C#, and a few other languages first and it was a literal nightmare. Without any logical understanding of what was happening behind the scenes I was basically at the mercy of whatever tutorial or teacher I had. You know print("Hello, World!") displays "Hello, World!", but you don't know why or how. You just ASSUME the computer sees print and displays your sentence. Now some tutorials are better than others and give you some insight into abstraction, but the reality is most don't, and with that lack of fundamental understanding most beginners are confused from the beginning to the very end. It's like okay I see what these things I typed potentially can do, but I have no way of manipulating into my own will and desires because I know fuck all about the basics beneath it... It was when I finally decided to learn some basic assembly (cause why not at this point of my confusion) did I FINALLY understand what I was learning at the higher level. It was the epiphany that all beginner programmers stride for. That moment where shit just "clicks" and you now KNOW the path you must take to get better and know what to look for and learn. Did I understand how to do anything specific? Fuck no! But I understand the path I needed to take. I understood I needed to learn a, so I could learn b, then approach c, for approaching d, and so on and so on. I didn't learn assembly, but I learned what a programming language actually was. That's when I jumped right into C and began accelerating and actually learning finally! I really don't believe Python is a good beginners language for this very reason among other languages.
Well, I suppose Python works for those who want things magically done without caring about what happens there? I mean, I'm more than sure there are tons of people out there learning things solely so they get some sort of a job, not because they're truly interested in the language and its inner workings
Wait you tried to learn programming by going over 3+ languages, struggled and you think it's the languages fault? I think perhaps you were switching too often without giving yourself the time to solidify the concepts first. To go from Python, C++, C# and a "few other languages" and still having that level of confusion tells me the path that you took was the problem not so much the languages. I think the issue was that you didn't have a good roadmap so you were all over the place and it made things more difficult. It's a very common problem that beginners face so I completely understand where you're coming from, but I just wanted to clarify the programming languages weren't the reason because many many people have become successful software engineers without learning C first
@@programmingloop7 That is a fair point. I should also elaborate. Just reread my comment and can see how it sounds in hindsight. So basically my over all point was the lower level stuff seemed to snap everything in place? Like, everything from high to low felt very abstract in a way I couldn't grasp until I saw assembly and how that translates into higher level stuff. Basically I suck at explaining shit.
I had the same problem. I think that has more to do with how one's mind is configured. Some people can get in life and very far by not understanding how things work behind the scenes. I compare low and mid level languages with philosophy and high level languages with conventional folk wisdom.
Everyone should learn C as this is the thinnest layer over Assembler that allows you to write high level code. Once you understand how to write it in C, you will be able to understand any language and concepts in a very profound way.
@@rustisthebestlanguage Ähhm, sorry to burst your bubble. Rust has overhead because of safety reasons, so it is not the thinnest layer. Thus it is not C.
trust me. once you learn rust youll never return back to c. theres a reason why c-cels are so mad and why everything is being rewritten in rust. its plain better 😂😂😂
That's the real problem with C++. It's all well and good that you "can" write secure and safe code, but it's entirely non-trivial to enforce that standard. And good luck trying to enforce it if you need any third party code!
C++'s memory security features are behind what Rust can do. For example, you have no way of encoding lifetimes in the type system as Rust does, so anyone can trivially write code that gets that wrong. There's also no enforcing of reference aliasing (e.g. many shared references vs a single mutable reference).
Cool. Too bad that one has to read a thousand page introductory book two times just to get good enough with C++ to confidently finish their first garbage project. Jesse Liberty is still alive and well, and if we ask nicely, he could probably write one, this time with a more realistic title "Teach yourself C++ in 21 years".
Maybe I’m just too inexperienced but after trying rust and then trying C, C seems to be a bit “easier for me”. I am primarily a JavaScript developer . It’s interesting because I was very intimidated of C which is why I chose rust (and nearly GO) … but after trying rust and then hopping over to C, I find C a bit easier to learn
C is definitely easier to learn. Smaller cognitive footprint. On the other hand, Rust's advantages do ultimately outweigh the cost of learning it so it's worth the investment.
C is definitely easier. Which makes it easier to do things wrong. The difficulty in r*st, especially for people unaccustomed to memory management, is often that it makes memory errors very difficult while C makes them very easy.
C syntax is much more direct and clear than Rust syntax, so it is easier to think and write what you want. However, as long as your program/software increases, crashes will also increase most likely.
@@oddikaro8236 I'm not sure what your "no" is referring to. How widely Rust is used relative to C has little bearing on the cost-benefit ratio, although I will note that, despite less adoption, the existing Rust crates are *far* easier to add into a program and therefore far more effective than any existing C code, so even with its "0%" adoption rate it's still easily paying off its own investment quickly. I speak from experience, having written C since the 80s...
3:28 Definitely an emphasized point. My formal computer science education is 2 college classes (comp sci 1 & 2). The college uses C as their language, so it was entirely in C. Guess what? Before I knew how to write "Hello World" I knew what char, int, unsigned/signed, pointer, etc was. I knew a string was just an array of chars ending in a null byte, and had done ~20 call stacks by hand, on paper, for basic functions My friend who teaches at a coding boot camp doesn't even know what a linked list is. Meanwhile, I just used Levenshtein Distance to correct the buyer names on 30,000 purchase order records (I dont work in tech, it was just an ad hoc secretary task I was given). You can't learn a subject by starting 100 levels of abstraction above the core concepts. C is definitely what people need to learn those core concepts.
I am a software developer for 35 years now. The one thing that was always there and still is: C. Actually half of my career I spent writing C/C++ code. Usually the better paid ones too. That said: why not both? Learn C first as you will understand better how everything really works, then learn as many "higher" languages as you like. Edit: I should wait until the end of the video before commenting :D
They pay us more because we are unhinged and more valuable. For one of us C++ devs, there are 4-5 front end devs. Our love for debugging sessions should be in fact payed better ahah :)
My friend had a very pragmatic approach to this question; "Take a look at some examplecode. Pick the one that looks appealing. You will have to pick up other languages allong the way, so start with one that you like on first look. Most important is to just start somewhere and then keep going." (Was C++ for me. Just recently decidet to go 'full C' after another 30-ish-hour-nightmare-debugsession-from-hell because returnvalues from templates that get funeld into frameworks wich in turn return a pointer to a polymorphed class with 35 levels or inherritance sucks quite some major cojones. And while I miss some features of C++ (references, operator- and function overloading) the general ease of use outweights those few drawbacks, IMHO)
Same exact thing happened to me. I think it depends on what you're using it for. Personally I am writing math programs that just need to do a lot of calculations. So I don't need all the complexity of C++, it's useless to me. I'll admit I still use vector though, because it's going to take me a while to be an expert at C.
Agree. Learn C first 1) it is a simpler language 2) you will understand computer architecture when you have learned C, 3) you will really appreciate the guardrails Rust puts in front of you before it will compile your program. Idiomatic safe Rust hides so much (which is ultimately very good) that starting there will actually make it harder to learn the why of Rust; why Box, why RC, why Arc?. I would learn to program in C, then learn data structures in C, then learn to code in Rust.
tbh i found it easier to learn C after i got familiar with rust. You can do anything in C, which means you have a billion options, and the documentation and help forums really do reflect that. i still struggle with C sometimes, simply because theres always an assumption that ive read all the other documentation first. i dont always know where to start. with rust the compiler tells me whats up, its like im dipping my toes. i didnt know what an atomic operation or mutex was before a rust compile error lead me to the documentation for Arc and Mutex (and using them together). this should not be underestimated imo.
how is it hipstery? it looks exactly the same way as all modern languages (postfix types and keywords for everything). it's just how modern languages are built (it makes parsing way easier), if you look at languages built in the late 80s up to the mid 2000s you'll see that a lot of them just look like an extended C (Java, C++, C# and the likes) also the mechanics in the language are all there for a good reason, the borrow checker helps with memory bugs, expression based syntax reduces boilerplate and mutability by default reduces general complexity almost everything else is present in most languages and if u take the time to properly look at the language you'll see that it's not actually that different it merely is more pedantic with how u should write stuff cause it cares (sometimes a bit too much) about safety
@@SimloI like python syntax because it uses keywords of lowercase letters for most things and that's easy to search in google like 'python3 "{keyword here}"'
I fully agree with this C then Rust approach. A great book I used for learning C was « Learn C the hard way » … Although I think dabbling in Haskell can help explain some of the abstractions/ patterns that rust uses…🤔
As a Rust dev with bits and pieces of C/C++ exposure, I agree as well. C is a powerful but very simple language which makes it easy to understand all of the concepts you need to make a compiled program, and knowing C will help with transitioning to Rust immensely, as Rust simply adds a layer of depth through borrowing from functional languages, much in the same way as C++ borrowed from OOP. Rust is my favourite systems language because when you fuck up, it makes it very clear how you've done so (and how to fix it). Some people take tissue with Rust's verbosity, that it is that which allows the language the safety it has. I simply think that going from C -> Rust should be the main systems dev pipeline over C -> C++. Hell, Zig is pretty cool too, but I really dislike the way it prints variables to stdout, so I don't use it much. Really it's all down to taste.
Another thing to note is that C is crazy small for a language. The entire manual is like, 100 pages. I would say its actually a good beginner language.
@@hwstar9416 The C Programming Language. 2nd Edition. google it. stop asking people to do things for you. you cannot have random people on the internet hold your hand. do it yourself or you will never be successful.
@@zilog1 was that really necessary? He asked for what manual you were talking about, it's not clear that you meant the C programming language 2nd ed. in your original comment
@@zilog1 get the hell out of here with that attitude! Some people simply learn better from humans. And you post about some nebulous manual and then act pissed when someone asks? You're acting weird, my man. Props for giving the source though.
Learning C for one semester helped me enormously in my programming journey. Especially when, in the next semester, i taught myself Rust. C has made me a better programmer, just like he says. It's an insanely cool experience. Rust is fun, though. I enjoy the potent abstractions while knowing I've hardly lost any speed.
@@dysania1832 Reading the official online book "The Rust Programming Language" and running every single example it gives in your IDE (VSCode) is the best way in my opinion. That's how I got started.
@@dysania1832Look into rustlings. It has a bunch of challenges that walk you through the syntax, borrow checker, and some of the common types from the standard library.
@@dysania1832 ChatGPT. Just try to program something and whenever you get stuck, ask it a question. Don't ask it to write your whole program for you. Try to write the program yourself, and only ask it things when you get stuck. If you think, for example, your program might benefit from having a class, you can ask ChatGPT "hey, does Rust have classes, and if so, how can I create one?" ChatGPT is good because even if you ask it a silly question it often will point you in the right direction.
As a 15 years+ dev, I agree with you. C teaches you how computers work without assembly languages, which are CPU-specific. C enables learners to imagine how complex functionalities in other languages are implemented. Leaning Rust will be overwhelming without that knowledge. You don’t understand why Rust works in its way. Though you should learn a language your job requires you to write FIRST!
Everyone should learn C. It's not hard to learn, learning it teaches you a lot about how computers/languages work, and it's actually useful. I've had to drop down from another language to C several times for work. Then crash your C program a few times and rewrite it in rust, to appreciate the benefits that rust brings. If you just learn rust as your first language then it will seem hard and you won't understand why it is great.
You can essentially learn the core aspects of C in like a week. Then, everything you learn in C is more or less directly applicable to C++ or C++ provides a "better" way to do what you would do in C. This is because C++ is for many purposes a superset of C (if you are gonna nitpick this statement, no body cares about hand countable number of C99 and beyond features that make C different) althought modern C++ has a lot of different features, that some people encourage over using C like constructs in C++.
Order of German CS students learned programming in 2007: 1. Semster: Haskell (Functional Programming) 2. Semester: Java SE 5 OOP 3. Semester: C on ARM to build a complete OS from scratch. So it was from exotic, to easier, to hardcore and it was great 😃👍
I wholeheartedly agree with this, with one extra clarification: Don’t spend too much time on C if you don’t need it. Learn the basics, understand how it works, and break some things. Then transition to Rust for production code. Obviously, there will be exceptions to this, because C is far more prevalent than Rust, but if you’re starting something new, you’ll usually be able to make better, more secure programs faster with Rust. Related side-note: Cargo is AWESOME! My biggest pet peeve with C is the barrier to entry for building any program with more than a few files. Build systems are HARD. Cargo may not have all the features of an old C build system, but it’s SO EASY. I can spend weeks on a build system for a C program or I could just use the defaults provided by cargo and be up and running in mere moments
If you want to learn for fun or getting started: Python If you want to make money: Javascript If you want to study deeply about how programming works: C, Java Rust is fine but there is not much demand for it yet.
Well theres Zig and Nim Nim might be good for Web dev as its compile to other lang like c js and it has c like performance + python like syntax it should be great to build js packages quickly with Nim and Zig lets you use c and its promising and it lets you choose how you want you memory to be manage it gives all the choice out there so this should be great for performance type native and embedded system
Rust is A LOT harder to learn than C. Never learn it as a first language unless you're freakishly genius or you're really into crushed dreams and mental breakdowns.
I seriously doubt that. The only part of Rust that is really hard at first is borrow checker, and that IMHO is because most people learning Rust come with ideological baggage from other languages. If Rust is you first language, you just accept that there are lifetimes involved when you use references, and they are restricted. You won't immediately try to create self-referential structures. Maybe overuse references, struggle with fitting multiple lifetimes in one brain cell, learn the lesson. Otherwise, Rust is pretty straightforward. It's when you come with C attitude, real struggle begins. It's like a secondly amended American in UK: "What? I cannot shoot myself in the foot with a Gatling gun? I cannot even own a Gatling gun? How am I supposed to cut my lawn?"
I tried more languages than my age, and I have to say use whatever you want to, either way your code is gonna be so bad that it should land you in prison.
As someone who tried learning C, then got discouraged then tried C++. I would say C++ is usually enough in my opinion, you will not be a C wizard probably, but you will definitely learn a lot of C since most C++ libraries take advantage of C code or even written completely in C and you will use them like C. Anyway, just my thoughts. I found that the road to C++ was much easier ime.
Interesting, C is more basic than C++, which in my case meant that I grasped better C than C++. With C++ there are so many features and updates that I know whatever I do, there will always be another way to do it, with its pros and cons. With C is just one way, period.
@@189Blake You are right, but it's more that I could do something with C++ rather than it being "easier", since you have the standard library. But C, you have to build everything from the ground up. You could use libraries to speed up the job, but what I'm saying is that why not learn C++? I don't think you will learn less C, rather you would have both solutions and you can test and see what you like. In my case, I learn a lot of C even though I do C++. So I think it could benefit you more if you just went ahead and chose C++. If I'm to go the C route now, I would be able to hold up just fine. It's not like you would go 180% degree...
you do understand how memory works though. Endianness, cache, how data structures are packed in memory, pointers, segments etc. All of that is abstracted away in GC languages, and it makes it unnecessary to understand how your program is mapped in memory. Maybe people are right in seeing pointers as dangerous, but the first time I was able to change a variable by overflowing a buffer it made me feel like I could see the matrix lol. You can't get that feeling of freedom and power with raw pointers from any other language, and I would say it's for the best, but you can't deny it's something that every programmer needs to experience at least once in their career.
Actually, first things that a programmer should learn are algorithms and data structures. Language then is just a way to express them. C and ASM are great languages to delve into computer architectures and writing efficient code.
Algorithm is not that necessary for beginners, it will instead make things appear more complicated than it seems. Most beginners project doesn't need much. Just basic design pattern, db, basic of network, some os stuff. They can grow from there, as they get more comfortable writing code.
Not with any of the newer micro controllers. Most Atmel, ARM, and RISCV processors have Rust HALs. Embedded Rust has seen a lot of progress. On the other hand, C wasn't the dominant language until more recently after finally overtaking Assembly, so maybe embedded is just slow. I also don't know why people keep wanting to make MicroPython a thing.
For the platforms with solid Rust support (e.g. ARM Cortex) Rust is likely to make rapid headway in far less than 100 years. C will dominate for another ten I'm sure, but I wouldn't place bets on anything beyond that. Market forces will decide... we're finding much faster development with Rust, fewer bugs by far, way better package management (than C? LOL, not hard), and more. We'll eat any competitors that don't adapt too.
For me, it's about the basics. If you don't know what's happening under the hood, then it's hard to appreciate what Rust is bringing to the table. And I'm one of those who still uses C as my primary language because I find it expressive and freeing. But I do see what Rust is doing and it's not a bad thing.
I fully agree. In order to understand the moderate annoyances of Rust you need to feel the excruciation pain of C, I mean that constant anxiety of "I think I covered all edge cases...right?". I'd even go one step further: after learning C, try to refactor your programs to C++, using idiomatic C++ to avoid the dangers of C. Only THEN will you breathe a sigh of relief when seeing how much better Rust has implemented the safeguards.
and even then people on the internet will sit around saying you're not a real dev because you choose to use rust and avoid pulling teeth every time you try to do basically anything.
@@DissyFanart Maybe because what you say is not true and you are delusional? "avoid pulling teeth every time you try..." what? Make an example of something that you do often while programming for which C/C++ are such a pain? Are you a civil engineer on a nuclear plant? Do you program embedded systems for life saving situations? What kind of programmer are you to need that extra safety (and btw not having solid frameworks for that already in your prod at the same time after ALL these years of experience you have) ?
@@DS-nv2niSecurity is important for most large projects, and 70% of security vulnerabilities are memory-safety related. Rust is designed to mitigate these issues without sacrificing performance.
Please, no. C is a necessary hardship that makes one's spirit stronger. C++ is a torture device that breaks one's spirit and assembles a hairy ass annoying demon from the shards. That demon will turn any codebase into something that devil himself fears too much to even glance at.
I would make the argument that you should never learn Rust. Instead, learn C, then halfway through learning it, learn assembly. After learning as much of both as you can for say 2 or 3 years, then learn C++. Eventually, after say a decade, design and implement your own language. That would easily take another decade for most people, more so if you're genuinely serious about the project.
The most hardcore C fanatics should form a party and greet each other with "sieg fault" salute (pointing the hand down, as if in the direction of the nearest imaginary manhole).
3:30 I 100% agree here. I started with Java as my first language (modding Minecraft when I was like 12 and used it in High School classes) and initially taking classes in Uni with C++ was a bit of a shock. C/C++ provided the groundwork for the higher level objects in a language like Java. I feel like if I had learned C or C++ first, then Java would have made a lot more sense going into it. At this point however, I am very confident in both Java and C++ and I hope to have opportunities to use other languages such as Rust in the future.
This is literally my dilemma RIGHT NOW! I'm not even exaggerating. I want to start building my projects ASAP & be productive. My area of interest (hw security & crypto) seems best suited for rust. But math,C, asm, computer architecture, memory, DSA, OOP are topics that would help me with a long term career.
Honestly, it's probably a good idea to start in Rust. You'll want to start with something that will keep you interested, and then once you start finding interest in other fields, you can start venturing into C.
@@brumd21 thank you, I really love safety & performance rust brings, I'm a big fan of it. I guess I'd be more excited learning rust than any other language because I value it's benefits.
One is a language which requires a lot of work to learn and understand. It forces you to learn about several high level language topics it's implemented and some it's invented. The other is a simple language that offers a thin abstraction over memory (less true every decade) that makes for a helpful model of most underlying machines you'll encounter. I think you should try Rust and see if you're really learning what you hoped. Because most of the things you mention are orthogonal to language choice and could be learned in either language. I'd prefer a simpler environment for that, but maybe you don't.
Ok I understand the "You should learn C first because it teaches you how a computer works" argument is really common, and I used to believe it as well. But now I actually think this is a bad take. Despite what everyone thinks their start in programming was, nobody started writing in C. My grandfather's generation learnt by writing ladder diagrams, a trivial language with arbitrary rules and little bearing on the fundamental hardware. My dad's generation learnt by writing in BASIC, a trivial language with arbitrary rules and little bearing on the fundamental hardware. My generation learnt with JavaScript, a trivial language with arbitrary rules and little bearing on the fundamental hardware. Sure, in a computer science course at the university level you'll learn something like C right now, but does C really teach you how a computer "works"? It completely obfuscates how registers, caching, context switching, etc. work. C only feels bare metal because you already know how a computer works and you're projecting over the gaps. By the logic of "learning how a computer really works", you could make the argument that people should be writing assembly as their first language, and some schools still believe that. The problem is, assembly is awful for teaching how to think algorithmically. This is why most schools would teach maths and assembly: something high level for algorithms, and something low level for implementation. Now, we're in a world where languages are expressive enough, and computers are fast enough, that you can write complex algorithms in a very expressive language and compile them down to fundamental instructions. The C memory model is no less arbitrary than the Rust model. After all of that, I still think you should learn C, but not because you need it to understand a computer. You should learn C for the same reason you should learn Zig, Rust, TypeScript, BASIC, etc., Because knowledge is transferrable, and learning anything helps with understanding everything.
@@mikethemonsta15 That's awesome! No sarcasm or malice intended. But I would ask: 1) Was it actually your first ever exposure to programming? (No high-level algorithms course in mathematics, no BASIC/Python/JS/etc.) 2) Do you think you represent a common experience? I think there's a bias in these kinds of communities towards the savant. You already have to be either very enthusiastic or very good at programming to watch these kinds of videos, and I don't think that makes us a good representation of most people's experiences with programming.
@@zactron1997 That was my first exposure to programming. No algorithms or anything. No high level languages. I don't know if it's a common experience, I haven't surveyed anyone. But it is what I recommend to every new prospective programmer starting out. Start out with writing a simple console text adventure game in C. It'll teach you the basics about I/O, functions, data structures, string manipulation, and when you get something on screen, it feels real and very satisfying.
@@zactron1997 I have similar situation. my first programming language was C, and I'm very happy about it (i started around two years ago) but since then, i become a programming languages junkie. Also the saying "[...] by that logic one should start with assembly language not C [...]" is faulty reasoning (slippery slope fallacy), the 'low level' argument in favor of C does not extend to assembly language. Plus, 'low level' is not the only argument in favor of c, 'simplicity' and 'high return-for-effort' are two further arguments. Simplicity means among commonly used programming languages c is the simplest one to learn ( (simple != easy) && (simple != easy to master)). "High return-for-effort" means since it is so simple, it doesn't take much time to learn as use-case agnostic language, compared to POSSIBLE use cases one might have. All things combined, C is the best use-case agnostic beginner programming language. Dont even think about functional programming languages. ALMOST all books that teach OOP-supported programming languages start with classes and not with primitive concepts, which is bad way of teaching IMO. UI-enabled programming languages are bad beginning. (So basically JS) Also, JS is also bad beginning language (independent of aforementioned point). In-development programming languages with lacking beginner friendly teaching material are bad beginner languages, so Nim, Zig etc. C, python, go, php are examples of good beginner languages, IMO.
my first language happened to be C, and the thing is I dont see why people see it as hard, its just a bit less easy going than JS, and what does people mean by understanding how a computer works? The only thing I can think of is working with pointers, thats what I learned of more complex on my college, which isnt that hard once u define the types, u are just implementing data structures before using then, the diff on JS is that they came already built for you. Do people think C is hard?
Honestly, I recommend learning C and Rust at the same time if you can. Writing in C will make you a better Rust programmer, and writing in Rust will make you a better C programmer.
Fun Fact: There are many static analysis tools for C like splint and clang static analyzer. So using them is like using borrow checker but in C. (Borrow-checker is also a static analysis tool)
Ha, didn't expect sound advice. Good one. The trolls are probably disappointed now. I personally think dabbling a bit with assembly is a good educational exercise too. Nothing fancy, e.g. building a deadpan calculator app would suffice. Gives tremendous amounts of insight.
C is a language that can't be replaced, if a language is built from C people will try to replace it. But here's the catch, C implements itself into other languages. Like putting MySQL Js Php and C, in microcontrollers and PLCs python bash and C, Java. Java is dirty but you get the idea. The bare bones of C will have security issues but there are other versions of C that were created and updated throughout the years. If C has security holes, it can be fixed by creating functions and libraries.
Rust is just a Haskell -flavored C. It's great, really good, but most of the people don't know exactly what they're doing. Learn some set theory and category theory and maybe Haskell (no pun intended) you'll know what Rust will bring to the tables. Haskell is way better in phylosophy, but poorly implemented. Rust is so much better implemented than Haskell. But it make some C++ concessions when it's necessary. It holds the programmer on a leash.... I think C/C++ are the best programming to solve really really complex problems. Like factoring numbers using methods like general number sieve. It's really unbeatable in this sense. And in the embedded world, of course.
Personally I feel that writing learning Rust first can be very helpful for learning C in the future, working with the borrow checker and race safe threads can help you to realise where in C you need to be cautious with your memory management and watching your variable usage, and getting into scenarios that I did need to use raw pointers in Rust, is really helpful for then going on to experiment with C
In my experience it's the other way round (mostly with C++). You understand why the ownership model in Rust is great. You understand why there are lifetimes to avoid dangling pointers because you're familiar with those problems in C/C++. But going back to C/C++ afterwards does make you a better C/C++ programmer.
The first language I learned was C#. The teach jumped directly into object oriented development. Because of this teacher I absolutely hate C# and never ever wanted anything to do with programming. Only later in University I actually learned C and C++. Then Java a language which I completely forgot how to use. After some fun classes in with assembly (why mips assembly nobody uses mips anymore), real time system (arduinos). Wireless Sensor networks (C with Atmel-Studios IDE) and somewhat surprisingly a major contributor was a FPGA class using VHDL. Well now I’m an embedded developer intern at a power-tools manufacturer. I consider every Operating System a nuisance. No OS no segfault 😂. Just kidding. Well I still didn’t use rust yet and I’m honest there are no plans to use it any time soon. Not because it’s bad in any way. It simply never came up as an option. If employer want me to code rust, sure why not, it sounds like fun.
I've always said that C is the best language for beginners. The concepts translate to other languages, forces you to pay attention to how the stack and heap work etc.
Absolutely, and this is coming from someone who has spent most of their time with python... knowing a bit of c at least, helps you appreciate things like deep copies vs shallow copies. But yeah, maybe python (or I guess any dynamic interpreted language, just less syntax and easier debugging to begin with) then c then c++ then rust :)
@@demenevdmitriy4175 Maybe, but it gave us RAII and zero cost abstractions, and in my view it's pretty sane in its approach to OOP which sometimes goes too far in other languages...
C. I'm not aware of any good library for Rust on a microcontroller. C you can use on anything. C is the ultimate marcro-assembler. For the record, I learned Basic first, then assembly, COBOL, Fortran, JCL, Pascal, and K&R C.
Embassy. There, now you're familiar with a good "library" (framework really) for Rust on (certain) micros. And there are others. And of course it's not necessary to have libraries at all for some embedded development.
Modula2 was better than C in every objective measurement, except for popularity. Sadly, people have turned to Rust to counteract the many flaws of C, and it indeed is far superior in terms of protection against dumb mistakes, and has addressed packages more sensibly, and cleans up some of the syntax mistakes of C. However, Rust has by my measurement around a 24% punctuation frequency (percent of chars, excluding whitespace that are non alphanumeric), which is terrible for readability. In certain areas like string processing, Rust is beyond clumsy. Have a string you want to index by character, use: let letters = name.chars().collect::(); that's obscene IMHO.
When people ask me, how they should learn programming, I ALWAYS say - buy an Arduino learn kit for $20, do some projects with it, remove the Arduino Bootloader, do the same projects again without Arduino header and alter this code to use pointers. After that, you've got a pretty good understand on how C works, how compiler work, how RAM and storage devices work and how processors work. Next step would be to grab a Raspberry Pi and program a driver or two for the ICs from your Arduino kit and you know basically everything there is to know for a starting programmer. You know C (and can switch to C++), you know hardware, you know drivers, you know how to extend the most used operating system in the world. Taking interpreter languages like Python or going wild with web development could be your next step, easy to learn an master if you've got the basics from C. All the code you will ever write, runs on computers so its one of the most valuable things to know how they work, either for optimization, portability and to know in general what the heck you are even doing. Also it's getting hard to find embedded programmers these days, since it seems (to me) that no one wants to go through all the hustle with computer knowledge.
Typescript and C. C for showing how the computer actually works. Typescript for showing off higher level ideas, how to use a robust type system etc. After that learning Rust isn't much more difficult.
I've been working with Java ever since it was introduced. But before that, I also programmed in C for a few years, and before that, back on my Atari ST computer, dabbled in assembly. I absolutely agree that learning a low-level language like C is very valuable, even when you don't want to use it later. It really helps better understanding what that stuff in a high-level language like Java does under the hood. Also, as of right now, with Rust still being quite young, you will likely find more job openings asking for C programming knowledge than for Rust. So for this reason alone I'd recommend learning C first.
Did you find it difficult to transition to Java after learning and using C? I also dabbled in Assembly way back in the 70s and 80s. Subsequently, I've been a C/ C++ developer for 25 years but completely failed at transitioning to Java. I hate the language literally and conceptually and I hated the whole java ecosystem. We're forced to use the Eclipse IDE. And what a peice of unstable bloated crap that is. And since our dev team has been moving away from C++ toward Java, I'm effectivelly being forced into early retirement.
frankly, I'd say to learn both, plus maybe some assembly (ARM is good if you have a chip you can use) Use C and assembly to learn about how computers work, how programs interact with an OS, etc. Then use Rust to develop instincts around memory safety, as all it really does is force you to follow best practices
arm is so easy to learn, 1000x easier than x86 due to being risc (what the fack is a cvttss2si???) and i'd say it's easier than c++. not c though, c is super simple.
I started using rust from c# and I am amazed how easy it is, rust seems to allow the use of higher level concepts that I commonly used in c# and I thought going to a lower level language would be difficult but generics and dynamic types are so much simpler and logical when down at lower level I wish I had learned it sooner, and the speed and memory usage! Amazing. I never used C but I did watch the cs50 videos that used c.
C is my first programming language and it still power the world today. I learn Rust recently, it designed to save your life and time finding trillion dollars bugs. Rust not allow you to compile buggy code especially memory error prone. Now I feel Rust is so beautiful and sexy. C is powerful but weak check, that mean you could create tons of security vulnerabilities and C compiler allow you to do it.
There is a different kind of developer we have today. Everything is library or an import so all people are doing is someone elses code to put things together. I'm glad to see more people going down the road of learning lower level languages. It changes the way you see computers and the software that you use on a daily basis.
2:28 I learned rust a few years ago having only tried python beforehand. It honestly wasn't too hard to start learning and while it did take me a while to get used to rust being statically typed (where previously my programs would just use python lists) it really only took a week or two to get my head around it. C on the other hand... damn if I was learning that straight after python I don't think I would still be programming. C legitimately hurts my brain even after 3 years of learning rust. my current project is writing a simple vim-inspired text editor in C and I must have seen a segfault error with no accompanying reason a thousand times in the last few days and It's starting to get to me.
'Rust has a higher bar to entry'. I completely disagree with that sentiment. To write code that is useful, and works properly it is much quicker to get started in Rust than in C. Yes rust has more high level concepts but you don't need to take them on all at once. The 'borrow checker' is a compiler tool that walks you through memory management. Yes you have to understand a tiny bit about what it demands from you but you can actually get away with a lot without fully understanding what it is doing or why. Just clone till its happy. Whereas in C, if you try to write anything without understanding memory management you will fail hard and painfully. You will learn about the issues from bugs when the code is running and can be very hard to find and there is no compiler holding your hand. The experience is definitely worse.
Hearing this reminds me of an old presentation or textfile I can't remember I *think* by cult of the dead cow (I'm 38... I'm old look it all up if anyone thinks I'm making this up) Smashing the stack for fun and profit Anyone else remember that? Awesome for the time as it was something that hadn't been covered in a like "we" sense rather than people just individually figuring it out and and keeping it to themselves... Yes alot of this is irrelevant... But I'm also interacting so you know the algorithm shows this channel to more people
C isnt just about speed and Rust isnt just about safety. Rust comes with a lot of great tooling and standardized experiences that make it so much easier to dive into. A random project's only difference from yours is that it has different source code. The project building method, style, structure, conventions and tooling are the SAME. Its made for collaboration. Of course, if you want to use it individually its a beautiful language too.
Totally agree buddy. Have learnt both languages to a fairly advanced level. But when you ask me, C is not even a language. It is the foundation of everything in CS. No one has the patience to assemble machine code. So learn c before everything (python, javascript) doesn't matter learn c first just the standard programming concepts. No need to go through advanced concepts like cache freeing or async in c. Then move to any language you desire. All algorithms must be learnt through c first to get a really good idea.
That intro makes no sense. Time clearly came into existence on January the first, 1970.
At least they had the decency to pick something decent as the starting point, and not 1971-07-17 or something 🤣
@@Leonhart_93 I'm incredibly disappointed they didn't use June 9th of the prior year, colossal missed opportunity
Wait, does that mean Time will cease to exist on January 19, 2038?
@@yuichikita6018 welcome to the Epochalypse! it even has a wikipedia page
@@yuichikita6018 then we go 128 bit hopefully
Learns C, builds a C library that handles memory like Rust.
accept 🙂👍
Whoever does this should be hailed as a god of programming. Songs will be sung of their deeds for a thousand years. Shrines will be built in their honor. Children shall be named after them. They will bring about a new era!
@@GeneralHazerd But wouldn't that just be Rust?
@@christopheriman4921 Without a syntax change to allow implementing a borrow checker, no. Rust memory management is inextricably tied to that.
probably impossible
I've used C professionally long enough to be mad at it's limitations, but it is still the best language to build your foundational knowledge with. Because once you understand C, you start to understand the building blocks that pretty much the entire field of software development is built on. You don't have to learn it first IMO, any high level language is fine, but definitely learn it second. Speaking from my experience learning C contextualised my earlier experience with Java and a lot of the design of the language features started to make sense.
Yes without its limitations it would be the greatest language--the programmers.
Hah, it's funny reading this almost exactly 8 months after beginning to learn C as a result of this video and this comment. I wonder, when you wrote this, if you knew that you would motivate a random stranger to spend an average of 2-3 hours a day churning through C textbooks, exercises, and programming projects in an attempt to understand computers better 😅.
Thank you!
@@michaelbeavitt1523 woah, glad I could be of help! Hope you're enjoying learning about computers
Whether or not you're going to learn Rust or use C in production, C is so immensely important to computer science and computing history that basically every real programmer needs to have experience with it
Totally agree
unreal programmers thank god they don't need to
Yep
Nah probably never going to have a use case for C. Maybe if i were an embedded developer or went to a university
@@lubba64 Really? From experience I'd say that having the confidence to use C anywhere makes you 100x more effective as a developer - even if you don't use it in whatever project you're currently working on.
C.
If every language were like a martial art, I'd say that C is the one that improves your combat posture, and that can really make a difference.
Underrated comment!
C gives you a fighting chance when the other languages fail you.
I feel like rust improved my "combat posture" - other languages will let you write basically whatever, so it's easy to get into bad habits since the compiler usually won't catch them, or will give you warnings at most. in Rust, mistakes that are just considered bad practice in other languages are actually compiler errors, so rust can help you learn how to design resilient code, and it's a skill that will affect how you write non-rust code, too.
@@june_m12 im trying to care. i really am
Yes, and Rust is like Aikido, looks good superficially but essentially useless
As quite a new „rustacean“, the biggest improvement for me was the tooling. I know C and C++ have lots of great third-party tooling but no setup one short command for everything is just so much better.
the exact reason, I want to try out rust, but c++ seems so simple that i just dont want to leave it.
@@Miles-co5xm There's not a single aspect of C++ I would describe as "simple".
Yep, that's was the deal breaker, although I still code cpp sometimes for scripts and if I just want that classic feel
" "*
@@tourdesource what makes you think so?
100% learn C. I would advise any beginner to start with C until you get to posix things, do those too and voila, a bit more networking stuff and you are set for great success
What if I begin with c++?
@@hanselazerus Beginning with c++ is like CBT but for your brain.
@@tuna5618 good or bad
@@hanselazerus The STL vectors are great and stuff, but you don't learn the essentials of bad pointers and bad array indexing and fencepost errors that the C compiler blindly lets you do.
@@TranscendentBen Do you recommend me to start with C?
Experienced developer here. C and Java among other languages. I'll learn RUST as soon as I have a need for it. Right now there are no job listings that list RUST in my area and right at the moment there are no software projects using RUST that I want to get into. If you're going to be a developer you should expect to be asked to pick up languages quickly as needed. It shouldn't take more than a couple of weeks to get productive with basics, though obviously it will take you longer to learn idioms, libraries and frameworks with proficiency.
So I re-write to build a project which was previously built on typescript with rust , I’ve been crying since , rust is after my life , the syntax is sweet, I love it forces you to use snake case conventions but it’s just too unnecessary complicated
Agreed. After a few decades you get pretty good at spotting long term trends vs fads as they emerge.
The current return to caring about low level code is an expected outcome of moores law tailing off whilst scale keeps increasing.
Rust is in the fad category. Unfortunately a lot of noobs can’t see this yet, and they are going to get horribly burned by investing heavily in rust.
They are all cheering each other on, watching videos from inexperienced “sw engineers” who don’t know any better.
Rust has all the red flags of a massive train wreck in the making.
What exactly are the red flags that you're seeing?
@@steveoc64 *Fucking this* seriously Rust has been treated like the second coming of Christ for the past decade and yet there is still basically nothing that actually uses it its actually insane how *not* popular it is, its like the reverse Java.
@@AlbatrossCommando The language is only 8 years old, give it some time. Firefox's entire JavaScript engine is written in it, and it's starting to be used more and more in the Linux and Windows kernels
Full stack dev here and I can't stand how commonplace it is to just not give a fuck about memory. This depiction is so accurate. Even solid experienced devs happily choose js methods that create completely unnecessary memory and make excuses.
Tbf, JS makes it difficult to not allocate memory. You fight the language to be performant. Other garbage collected languages don’t necessarily have that problem, despite garbage collection always being a performance uncertainty.
Not caring about memory waste is one thing, not caring about memory safety is a completely different issue. JavaScript is memory safe. C is not. Using a wasteful js method typically won't create bugs. Being careless about memory management in C typically will.
As a devops and sysadmin... I'm the one that ends up feeling the pain. Typical one: reading unbounded queries from a DB. A Time Bomb waiting to explode on most of your systems. (I'm sure your company have at least one of those, no matter who you are :) )
@@framegrace1 True but as always its a balance between the cost of that timebomb going off vs the cost of preventing it from happening. Highly reliable systems simply cost more. But yes following best practices is important to reduce the number of potential time bombs.
GNOME Shell devs?
Seems like the only reason people want to replace C is because it's old. It solves any programming problem you can think of and will get you a well paid career if you get good at it.
Rust teaches you Rust. C teaches you programming.
My advice would be to learn several programming languages, at least 3 or 4. So learn Rust and C, but do more if you can.
I can at least recommend learning a combination of languages from which you learn all of these aspects: manual memory management, automatic memory management (garbage collection), procedural programming, object oriented programming (OOP) and functional programming (the latter one is gaining more popularity these days), strongly typed, loosely typed (scripting languages are often loosely typed). Many languages have a combination of those aspects, so you can often learn multiple things together.
Just dont add C++ to that list or you'll be learning 1 language forever
Learn all languages! 😈
@@FreestylStudio So you also know how many programming languages actually exist in the world? 😜
@@jongeduard Can't be more than 500, eez peez
this is the most correct answer
I agree C is great as you need no libraries, objects or classes when creating software. Direct low level hardware calls give you full control of the audio chip/card.
C is godlike
Just an FYI, but you can do exactly the same with Rust, with only slightly more verbosity.
Ok, and what are the advantages of C?
@@parlor3115 Idk what do you mean but I have 2 answers:
"Ok, and are those advantages of C?" - Yes.
"Ok, and what are advantages of C?" - That you can directly manage memory. You pretty much have full control of your cpu. So pretty much what the main comment said. And that's not everything but obviously I am too lazy to write everything here.
@@parlor3115
Know it and you shall know.
Just gained a new respect for you. Many Rust tubers try to shit all over C, that you should avoid C like it's Aids, that C is useless, etc, denying the fundamentals of systems programming and understanding of programming as a whole in general. C is an incredible language, BUT so is Rust. It's very refreshing to see a Rust advocate step up and be honest about it. I tried learning programming from Python, C++, C#, and a few other languages first and it was a literal nightmare. Without any logical understanding of what was happening behind the scenes I was basically at the mercy of whatever tutorial or teacher I had. You know print("Hello, World!") displays "Hello, World!", but you don't know why or how. You just ASSUME the computer sees print and displays your sentence. Now some tutorials are better than others and give you some insight into abstraction, but the reality is most don't, and with that lack of fundamental understanding most beginners are confused from the beginning to the very end. It's like okay I see what these things I typed potentially can do, but I have no way of manipulating into my own will and desires because I know fuck all about the basics beneath it... It was when I finally decided to learn some basic assembly (cause why not at this point of my confusion) did I FINALLY understand what I was learning at the higher level. It was the epiphany that all beginner programmers stride for. That moment where shit just "clicks" and you now KNOW the path you must take to get better and know what to look for and learn. Did I understand how to do anything specific? Fuck no! But I understand the path I needed to take. I understood I needed to learn a, so I could learn b, then approach c, for approaching d, and so on and so on. I didn't learn assembly, but I learned what a programming language actually was. That's when I jumped right into C and began accelerating and actually learning finally!
I really don't believe Python is a good beginners language for this very reason among other languages.
Well, I suppose Python works for those who want things magically done without caring about what happens there? I mean, I'm more than sure there are tons of people out there learning things solely so they get some sort of a job, not because they're truly interested in the language and its inner workings
Wait you tried to learn programming by going over 3+ languages, struggled and you think it's the languages fault? I think perhaps you were switching too often without giving yourself the time to solidify the concepts first. To go from Python, C++, C# and a "few other languages" and still having that level of confusion tells me the path that you took was the problem not so much the languages. I think the issue was that you didn't have a good roadmap so you were all over the place and it made things more difficult. It's a very common problem that beginners face so I completely understand where you're coming from, but I just wanted to clarify the programming languages weren't the reason because many many people have become successful software engineers without learning C first
@@programmingloop7 That is a fair point. I should also elaborate. Just reread my comment and can see how it sounds in hindsight. So basically my over all point was the lower level stuff seemed to snap everything in place? Like, everything from high to low felt very abstract in a way I couldn't grasp until I saw assembly and how that translates into higher level stuff.
Basically I suck at explaining shit.
@@madezra64 I got you. Btw I do agree with you that learning lower level stuff will help grok these concepts in a deeper way
I had the same problem. I think that has more to do with how one's mind is configured. Some people can get in life and very far by not understanding how things work behind the scenes. I compare low and mid level languages with philosophy and high level languages with conventional folk wisdom.
Start with C, learn basics, get comfortable with fundamental concepts, get used to it, and switch to Rust
Everyone should learn C as this is the thinnest layer over Assembler that allows you to write high level code. Once you understand how to write it in C, you will be able to understand any language and concepts in a very profound way.
weird way to spell rust 🤔
just admit rust is better than c already 😂😂😂
@@rustisthebestlanguage Ähhm, sorry to burst your bubble. Rust has overhead because of safety reasons, so it is not the thinnest layer. Thus it is not C.
I've learned and coded a lot of C. Now I'm beginning to learn Rust and there's some patterns that I definitely will use within my C code too
could you elaborate
trust me. once you learn rust youll never return back to c.
theres a reason why c-cels are so mad and why everything is being rewritten in rust. its plain better 😂😂😂
C++ have good memory security features. But too much people write C code in C++ with is pointless
@@satrac75 Yes. Rust, C and C++ still coexists well
That's the real problem with C++. It's all well and good that you "can" write secure and safe code, but it's entirely non-trivial to enforce that standard. And good luck trying to enforce it if you need any third party code!
C++'s memory security features are behind what Rust can do. For example, you have no way of encoding lifetimes in the type system as Rust does, so anyone can trivially write code that gets that wrong. There's also no enforcing of reference aliasing (e.g. many shared references vs a single mutable reference).
Cool. Too bad that one has to read a thousand page introductory book two times just to get good enough with C++ to confidently finish their first garbage project. Jesse Liberty is still alive and well, and if we ask nicely, he could probably write one, this time with a more realistic title "Teach yourself C++ in 21 years".
Maybe I’m just too inexperienced but after trying rust and then trying C, C seems to be a bit “easier for me”. I am primarily a JavaScript developer . It’s interesting because I was very intimidated of C which is why I chose rust (and nearly GO) … but after trying rust and then hopping over to C, I find C a bit easier to learn
C is definitely easier to learn. Smaller cognitive footprint. On the other hand, Rust's advantages do ultimately outweigh the cost of learning it so it's worth the investment.
C is definitely easier. Which makes it easier to do things wrong. The difficulty in r*st, especially for people unaccustomed to memory management, is often that it makes memory errors very difficult while C makes them very easy.
C syntax is much more direct and clear than Rust syntax, so it is easier to think and write what you want. However, as long as your program/software increases, crashes will also increase most likely.
@@peter9477 Yes...and no...almost 0% of software is made in Rust. Almost anything is made in C.
@@oddikaro8236 I'm not sure what your "no" is referring to. How widely Rust is used relative to C has little bearing on the cost-benefit ratio, although I will note that, despite less adoption, the existing Rust crates are *far* easier to add into a program and therefore far more effective than any existing C code, so even with its "0%" adoption rate it's still easily paying off its own investment quickly. I speak from experience, having written C since the 80s...
Who needs rust when you have C++ which is bett segmentation fault (core dumped)
3:28 Definitely an emphasized point. My formal computer science education is 2 college classes (comp sci 1 & 2). The college uses C as their language, so it was entirely in C. Guess what? Before I knew how to write "Hello World" I knew what char, int, unsigned/signed, pointer, etc was. I knew a string was just an array of chars ending in a null byte, and had done ~20 call stacks by hand, on paper, for basic functions
My friend who teaches at a coding boot camp doesn't even know what a linked list is. Meanwhile, I just used Levenshtein Distance to correct the buyer names on 30,000 purchase order records (I dont work in tech, it was just an ad hoc secretary task I was given). You can't learn a subject by starting 100 levels of abstraction above the core concepts. C is definitely what people need to learn those core concepts.
I am a software developer for 35 years now. The one thing that was always there and still is: C. Actually half of my career I spent writing C/C++ code. Usually the better paid ones too. That said: why not both? Learn C first as you will understand better how everything really works, then learn as many "higher" languages as you like. Edit: I should wait until the end of the video before commenting :D
They pay us more because we are unhinged and more valuable. For one of us C++ devs, there are 4-5 front end devs. Our love for debugging sessions should be in fact payed better ahah :)
My friend had a very pragmatic approach to this question;
"Take a look at some examplecode. Pick the one that looks appealing. You will have to pick up other languages allong the way, so start with one that you like on first look. Most important is to just start somewhere and then keep going."
(Was C++ for me. Just recently decidet to go 'full C' after another 30-ish-hour-nightmare-debugsession-from-hell because returnvalues from templates that get funeld into frameworks wich in turn return a pointer to a polymorphed class with 35 levels or inherritance sucks quite some major cojones. And while I miss some features of C++ (references, operator- and function overloading) the general ease of use outweights those few drawbacks, IMHO)
Same exact thing happened to me. I think it depends on what you're using it for. Personally I am writing math programs that just need to do a lot of calculations. So I don't need all the complexity of C++, it's useless to me. I'll admit I still use vector though, because it's going to take me a while to be an expert at C.
C and Zig. Would recommend a lot
Agree. Learn C first 1) it is a simpler language 2) you will understand computer architecture when you have learned C, 3) you will really appreciate the guardrails Rust puts in front of you before it will compile your program. Idiomatic safe Rust hides so much (which is ultimately very good) that starting there will actually make it harder to learn the why of Rust; why Box, why RC, why Arc?. I would learn to program in C, then learn data structures in C, then learn to code in Rust.
tbh i found it easier to learn C after i got familiar with rust.
You can do anything in C, which means you have a billion options, and the documentation and help forums really do reflect that.
i still struggle with C sometimes, simply because theres always an assumption that ive read all the other documentation first. i dont always know where to start.
with rust the compiler tells me whats up, its like im dipping my toes.
i didnt know what an atomic operation or mutex was before a rust compile error lead me to the documentation for Arc and Mutex (and using them together).
this should not be underestimated imo.
C Syntax is just so simple and pure. Rust is like they tried to be as hipstery as possible.
how is it hipstery? it looks exactly the same way as all modern languages (postfix types and keywords for everything). it's just how modern languages are built (it makes parsing way easier), if you look at languages built in the late 80s up to the mid 2000s you'll see that a lot of them just look like an extended C (Java, C++, C# and the likes)
also the mechanics in the language are all there for a good reason, the borrow checker helps with memory bugs, expression based syntax reduces boilerplate and mutability by default reduces general complexity
almost everything else is present in most languages and if u take the time to properly look at the language you'll see that it's not actually that different it merely is more pedantic with how u should write stuff cause it cares (sometimes a bit too much) about safety
@@FlanPoirot because*
@@JorgetePanete 🤓
I feel like Python went as hipstery as possible
@@SimloI like python syntax because it uses keywords of lowercase letters for most things and that's easy to search in google like 'python3 "{keyword here}"'
I fully agree with this C then Rust approach. A great book I used for learning C was « Learn C the hard way » …
Although I think dabbling in Haskell can help explain some of the abstractions/ patterns that rust uses…🤔
As a Rust dev with bits and pieces of C/C++ exposure, I agree as well. C is a powerful but very simple language which makes it easy to understand all of the concepts you need to make a compiled program, and knowing C will help with transitioning to Rust immensely, as Rust simply adds a layer of depth through borrowing from functional languages, much in the same way as C++ borrowed from OOP.
Rust is my favourite systems language because when you fuck up, it makes it very clear how you've done so (and how to fix it).
Some people take tissue with Rust's verbosity, that it is that which allows the language the safety it has. I simply think that going from C -> Rust should be the main systems dev pipeline over C -> C++.
Hell, Zig is pretty cool too, but I really dislike the way it prints variables to stdout, so I don't use it much. Really it's all down to taste.
Another thing to note is that C is crazy small for a language. The entire manual is like, 100 pages. I would say its actually a good beginner language.
Where can I find such manual?
@@hwstar9416 The C Programming Language. 2nd Edition. google it. stop asking people to do things for you. you cannot have random people on the internet hold your hand. do it yourself or you will never be successful.
@@zilog1 You went full stack overflow with your answer there calm down.
@@zilog1 was that really necessary? He asked for what manual you were talking about, it's not clear that you meant the C programming language 2nd ed. in your original comment
@@zilog1 get the hell out of here with that attitude! Some people simply learn better from humans. And you post about some nebulous manual and then act pissed when someone asks? You're acting weird, my man.
Props for giving the source though.
Learning C for one semester helped me enormously in my programming journey. Especially when, in the next semester, i taught myself Rust. C has made me a better programmer, just like he says. It's an insanely cool experience. Rust is fun, though. I enjoy the potent abstractions while knowing I've hardly lost any speed.
Do you know of any good ways to learn rust? I currently know python without oops
@@dysania1832 Reading the official online book "The Rust Programming Language" and running every single example it gives in your IDE (VSCode) is the best way in my opinion. That's how I got started.
@@dysania1832Look into rustlings. It has a bunch of challenges that walk you through the syntax, borrow checker, and some of the common types from the standard library.
@@dysania1832 ChatGPT. Just try to program something and whenever you get stuck, ask it a question. Don't ask it to write your whole program for you. Try to write the program yourself, and only ask it things when you get stuck. If you think, for example, your program might benefit from having a class, you can ask ChatGPT "hey, does Rust have classes, and if so, how can I create one?" ChatGPT is good because even if you ask it a silly question it often will point you in the right direction.
As a 15 years+ dev, I agree with you.
C teaches you how computers work without assembly languages, which are CPU-specific. C enables learners to imagine how complex functionalities in other languages are implemented.
Leaning Rust will be overwhelming without that knowledge. You don’t understand why Rust works in its way.
Though you should learn a language your job requires you to write FIRST!
Everyone should learn C. It's not hard to learn, learning it teaches you a lot about how computers/languages work, and it's actually useful. I've had to drop down from another language to C several times for work.
Then crash your C program a few times and rewrite it in rust, to appreciate the benefits that rust brings.
If you just learn rust as your first language then it will seem hard and you won't understand why it is great.
Would you recommend C or C++? Usually I see job listing for C++ but not C so wouldn't learning C++ be better?
You can essentially learn the core aspects of C in like a week. Then, everything you learn in C is more or less directly applicable to C++ or C++ provides a "better" way to do what you would do in C. This is because C++ is for many purposes a superset of C (if you are gonna nitpick this statement, no body cares about hand countable number of C99 and beyond features that make C different) althought modern C++ has a lot of different features, that some people encourage over using C like constructs in C++.
4:54 "The knowledge that C gives you" == how to slow and stop a car by downshifting, because it doesn't have brakes.
assembly is fun, it lets me put all my variables into display memory. just ignore that line of pixels on the top left.
Order of German CS students learned programming in 2007:
1. Semster: Haskell (Functional Programming)
2. Semester: Java SE 5 OOP
3. Semester: C on ARM to build a complete OS from scratch.
So it was from exotic, to easier, to hardcore and it was great 😃👍
I wholeheartedly agree with this, with one extra clarification: Don’t spend too much time on C if you don’t need it. Learn the basics, understand how it works, and break some things. Then transition to Rust for production code. Obviously, there will be exceptions to this, because C is far more prevalent than Rust, but if you’re starting something new, you’ll usually be able to make better, more secure programs faster with Rust.
Related side-note: Cargo is AWESOME! My biggest pet peeve with C is the barrier to entry for building any program with more than a few files. Build systems are HARD. Cargo may not have all the features of an old C build system, but it’s SO EASY. I can spend weeks on a build system for a C program or I could just use the defaults provided by cargo and be up and running in mere moments
If you want to learn for fun or getting started: Python
If you want to make money: Javascript
If you want to study deeply about how programming works: C, Java
Rust is fine but there is not much demand for it yet.
Well theres Zig and Nim
Nim might be good for Web dev as its compile to other lang like c js and it has c like performance + python like syntax it should be great to build js packages quickly with Nim
and Zig lets you use c and its promising and it lets you choose how you want you memory to be manage it gives all the choice out there so this should be great for performance type native and embedded system
I code embedded with Nim it’s great :)
No love for Zig? I'm going to go with learn Zig 1st, and Rust 2nd. To fix or port existing things learn C 3rd, C++ 4th.
Quality content, never expect something less from you 😄
That dude is not a real Rust programmer, didn't said "Rust btw" even once smh my head.
Rust is A LOT harder to learn than C. Never learn it as a first language unless you're freakishly genius or you're really into crushed dreams and mental breakdowns.
really ? i never really take my time for rust xD but i'm interested in
Is it tho? I like the book approach
I seriously doubt that. The only part of Rust that is really hard at first is borrow checker, and that IMHO is because most people learning Rust come with ideological baggage from other languages. If Rust is you first language, you just accept that there are lifetimes involved when you use references, and they are restricted. You won't immediately try to create self-referential structures. Maybe overuse references, struggle with fitting multiple lifetimes in one brain cell, learn the lesson. Otherwise, Rust is pretty straightforward. It's when you come with C attitude, real struggle begins. It's like a secondly amended American in UK: "What? I cannot shoot myself in the foot with a Gatling gun? I cannot even own a Gatling gun? How am I supposed to cut my lawn?"
nah. rust is the easiest language to learn. stay mad c-cel 😂
I tried more languages than my age, and I have to say use whatever you want to, either way your code is gonna be so bad that it should land you in prison.
As someone who tried learning C, then got discouraged then tried C++. I would say C++ is usually enough in my opinion, you will not be a C wizard probably, but you will definitely learn a lot of C since most C++ libraries take advantage of C code or even written completely in C and you will use them like C. Anyway, just my thoughts. I found that the road to C++ was much easier ime.
Interesting, C is more basic than C++, which in my case meant that I grasped better C than C++. With C++ there are so many features and updates that I know whatever I do, there will always be another way to do it, with its pros and cons. With C is just one way, period.
@@189Blake You are right, but it's more that I could do something with C++ rather than it being "easier", since you have the standard library. But C, you have to build everything from the ground up. You could use libraries to speed up the job, but what I'm saying is that why not learn C++? I don't think you will learn less C, rather you would have both solutions and you can test and see what you like. In my case, I learn a lot of C even though I do C++. So I think it could benefit you more if you just went ahead and chose C++. If I'm to go the C route now, I would be able to hold up just fine. It's not like you would go 180% degree...
Keep in mind that C & C++ are not the same
Yes you should! Here's why: built-in strings
End of conversation. Bye Bye.
By learning C you won't understand how processors work, only what they do at the high level.
Shhh, don't spoil it. Some people just want to feel different from others; it's c00l.
True! But you still get more than with Rust. Really, any good programmer should have seen some assembly and how function calls work.
you do understand how memory works though. Endianness, cache, how data structures are packed in memory, pointers, segments etc. All of that is abstracted away in GC languages, and it makes it unnecessary to understand how your program is mapped in memory. Maybe people are right in seeing pointers as dangerous, but the first time I was able to change a variable by overflowing a buffer it made me feel like I could see the matrix lol. You can't get that feeling of freedom and power with raw pointers from any other language, and I would say it's for the best, but you can't deny it's something that every programmer needs to experience at least once in their career.
C is incredibly versatile. You can run it on anything, from a Commdore 64 from the 1980s, to an AMD Ryzen powerhouse from today.
old aged programmer vs cat maid femboy
3:09 answer
I learned Python then Rust. The journey was painful but worth it.
It has helped me write better code in other languages, including C.
of course c first, then rust. but i'd like to add assembly in between, as this will allow you to understand what's going on behind the scenes.
Actually, first things that a programmer should learn are algorithms and data structures. Language then is just a way to express them. C and ASM are great languages to delve into computer architectures and writing efficient code.
Algorithm is not that necessary for beginners, it will instead make things appear more complicated than it seems.
Most beginners project doesn't need much. Just basic design pattern, db, basic of network, some os stuff. They can grow from there, as they get more comfortable writing code.
Depends on your use case. Microcontrollers will be C for another 100 years as a dominant language. Depends on what you are doing.
Not with any of the newer micro controllers. Most Atmel, ARM, and RISCV processors have Rust HALs. Embedded Rust has seen a lot of progress. On the other hand, C wasn't the dominant language until more recently after finally overtaking Assembly, so maybe embedded is just slow. I also don't know why people keep wanting to make MicroPython a thing.
For the platforms with solid Rust support (e.g. ARM Cortex) Rust is likely to make rapid headway in far less than 100 years. C will dominate for another ten I'm sure, but I wouldn't place bets on anything beyond that. Market forces will decide... we're finding much faster development with Rust, fewer bugs by far, way better package management (than C? LOL, not hard), and more. We'll eat any competitors that don't adapt too.
For me, it's about the basics. If you don't know what's happening under the hood, then it's hard to appreciate what Rust is bringing to the table. And I'm one of those who still uses C as my primary language because I find it expressive and freeing. But I do see what Rust is doing and it's not a bad thing.
I fully agree. In order to understand the moderate annoyances of Rust you need to feel the excruciation pain of C, I mean that constant anxiety of "I think I covered all edge cases...right?". I'd even go one step further: after learning C, try to refactor your programs to C++, using idiomatic C++ to avoid the dangers of C. Only THEN will you breathe a sigh of relief when seeing how much better Rust has implemented the safeguards.
and even then people on the internet will sit around saying you're not a real dev because you choose to use rust and avoid pulling teeth every time you try to do basically anything.
@@DissyFanart Maybe because what you say is not true and you are delusional?
"avoid pulling teeth every time you try..." what?
Make an example of something that you do often while programming for which C/C++ are such a pain? Are you a civil engineer on a nuclear plant? Do you program embedded systems for life saving situations? What kind of programmer are you to need that extra safety (and btw not having solid frameworks for that already in your prod at the same time after ALL these years of experience you have) ?
@@DS-nv2niSecurity is important for most large projects, and 70% of security vulnerabilities are memory-safety related. Rust is designed to mitigate these issues without sacrificing performance.
Please, no. C is a necessary hardship that makes one's spirit stronger. C++ is a torture device that breaks one's spirit and assembles a hairy ass annoying demon from the shards. That demon will turn any codebase into something that devil himself fears too much to even glance at.
I would make the argument that you should never learn Rust. Instead, learn C, then halfway through learning it, learn assembly. After learning as much of both as you can for say 2 or 3 years, then learn C++. Eventually, after say a decade, design and implement your own language. That would easily take another decade for most people, more so if you're genuinely serious about the project.
Seg fault is my middle name
The most hardcore C fanatics should form a party and greet each other with "sieg fault" salute (pointing the hand down, as if in the direction of the nearest imaginary manhole).
3:30 I 100% agree here. I started with Java as my first language (modding Minecraft when I was like 12 and used it in High School classes) and initially taking classes in Uni with C++ was a bit of a shock. C/C++ provided the groundwork for the higher level objects in a language like Java. I feel like if I had learned C or C++ first, then Java would have made a lot more sense going into it. At this point however, I am very confident in both Java and C++ and I hope to have opportunities to use other languages such as Rust in the future.
Hi, as someone confused btw c++ and java right now. What should I go with. Which one is good as foundation and you can build cool and gui projects
@@kingofhiskingdom4616 Java is by far easier to build GUIs with, same with C#. C++ is better if you want to build a solid foundation however.
This is literally my dilemma RIGHT NOW!
I'm not even exaggerating. I want to start building my projects ASAP & be productive. My area of interest (hw security & crypto) seems best suited for rust. But math,C, asm, computer architecture, memory, DSA, OOP are topics that would help me with a long term career.
You can do "math, asm, computer architecture, memory, DSA OOP" in Rust too :)
Honestly, it's probably a good idea to start in Rust. You'll want to start with something that will keep you interested, and then once you start finding interest in other fields, you can start venturing into C.
@@brumd21 thank you, I really love safety & performance rust brings, I'm a big fan of it. I guess I'd be more excited learning rust than any other language because I value it's benefits.
One is a language which requires a lot of work to learn and understand. It forces you to learn about several high level language topics it's implemented and some it's invented.
The other is a simple language that offers a thin abstraction over memory (less true every decade) that makes for a helpful model of most underlying machines you'll encounter.
I think you should try Rust and see if you're really learning what you hoped. Because most of the things you mention are orthogonal to language choice and could be learned in either language. I'd prefer a simpler environment for that, but maybe you don't.
@@therealb888 You shouldn't have preconceived notions about something you don't know based on what people say.
instead of encouraging a C programmer to improve, you tell him to use Rust so he can work less hard
Ok I understand the "You should learn C first because it teaches you how a computer works" argument is really common, and I used to believe it as well. But now I actually think this is a bad take. Despite what everyone thinks their start in programming was, nobody started writing in C.
My grandfather's generation learnt by writing ladder diagrams, a trivial language with arbitrary rules and little bearing on the fundamental hardware.
My dad's generation learnt by writing in BASIC, a trivial language with arbitrary rules and little bearing on the fundamental hardware.
My generation learnt with JavaScript, a trivial language with arbitrary rules and little bearing on the fundamental hardware.
Sure, in a computer science course at the university level you'll learn something like C right now, but does C really teach you how a computer "works"? It completely obfuscates how registers, caching, context switching, etc. work. C only feels bare metal because you already know how a computer works and you're projecting over the gaps.
By the logic of "learning how a computer really works", you could make the argument that people should be writing assembly as their first language, and some schools still believe that. The problem is, assembly is awful for teaching how to think algorithmically.
This is why most schools would teach maths and assembly: something high level for algorithms, and something low level for implementation.
Now, we're in a world where languages are expressive enough, and computers are fast enough, that you can write complex algorithms in a very expressive language and compile them down to fundamental instructions.
The C memory model is no less arbitrary than the Rust model.
After all of that, I still think you should learn C, but not because you need it to understand a computer. You should learn C for the same reason you should learn Zig, Rust, TypeScript, BASIC, etc., Because knowledge is transferrable, and learning anything helps with understanding everything.
My start in programming was writing C
@@mikethemonsta15 That's awesome! No sarcasm or malice intended. But I would ask:
1) Was it actually your first ever exposure to programming? (No high-level algorithms course in mathematics, no BASIC/Python/JS/etc.)
2) Do you think you represent a common experience?
I think there's a bias in these kinds of communities towards the savant. You already have to be either very enthusiastic or very good at programming to watch these kinds of videos, and I don't think that makes us a good representation of most people's experiences with programming.
@@zactron1997 That was my first exposure to programming. No algorithms or anything. No high level languages.
I don't know if it's a common experience, I haven't surveyed anyone. But it is what I recommend to every new prospective programmer starting out. Start out with writing a simple console text adventure game in C. It'll teach you the basics about I/O, functions, data structures, string manipulation, and when you get something on screen, it feels real and very satisfying.
@@zactron1997
I have similar situation. my first programming language was C, and I'm very happy about it (i started around two years ago) but since then, i become a programming languages junkie.
Also the saying "[...] by that logic one should start with assembly language not C [...]" is faulty reasoning (slippery slope fallacy), the 'low level' argument in favor of C does not extend to assembly language.
Plus, 'low level' is not the only argument in favor of c, 'simplicity' and 'high return-for-effort' are two further arguments. Simplicity means among commonly used programming languages c is the simplest one to learn ( (simple != easy) && (simple != easy to master)). "High return-for-effort" means since it is so simple, it doesn't take much time to learn as use-case agnostic language, compared to POSSIBLE use cases one might have.
All things combined, C is the best use-case agnostic beginner programming language.
Dont even think about functional programming languages.
ALMOST all books that teach OOP-supported programming languages start with classes and not with primitive concepts, which is bad way of teaching IMO.
UI-enabled programming languages are bad beginning. (So basically JS)
Also, JS is also bad beginning language (independent of aforementioned point).
In-development programming languages with lacking beginner friendly teaching material are bad beginner languages, so Nim, Zig etc.
C, python, go, php are examples of good beginner languages, IMO.
my first language happened to be C, and the thing is I dont see why people see it as hard, its just a bit less easy going than JS, and what does people mean by understanding how a computer works? The only thing I can think of is working with pointers, thats what I learned of more complex on my college, which isnt that hard once u define the types, u are just implementing data structures before using then, the diff on JS is that they came already built for you. Do people think C is hard?
Honestly, I recommend learning C and Rust at the same time if you can. Writing in C will make you a better Rust programmer, and writing in Rust will make you a better C programmer.
Fun Fact: There are many static analysis tools for C like splint and clang static analyzer. So using them is like using borrow checker but in C. (Borrow-checker is also a static analysis tool)
Ha, didn't expect sound advice.
Good one. The trolls are probably disappointed now.
I personally think dabbling a bit with assembly is a good educational exercise too.
Nothing fancy, e.g. building a deadpan calculator app would suffice. Gives tremendous amounts of insight.
C is a language that can't be replaced, if a language is built from C people will try to replace it. But here's the catch, C implements itself into other languages. Like putting MySQL Js Php and C, in microcontrollers and PLCs python bash and C, Java. Java is dirty but you get the idea. The bare bones of C will have security issues but there are other versions of C that were created and updated throughout the years. If C has security holes, it can be fixed by creating functions and libraries.
Learn both. Keep using the one that benefits you.
Well, with C you're getting your hands dirty. Literally.
With ASM you're getting your hands dirty.
Rust is just a Haskell -flavored C.
It's great, really good, but most of the people don't know exactly what they're doing. Learn some set theory and category theory and maybe Haskell (no pun intended) you'll know what Rust will bring to the tables.
Haskell is way better in phylosophy, but poorly implemented. Rust is so much better implemented than Haskell. But it make some C++ concessions when it's necessary. It holds the programmer on a leash....
I think C/C++ are the best programming to solve really really complex problems. Like factoring numbers using methods like general number sieve. It's really unbeatable in this sense. And in the embedded world, of course.
Personally I feel that writing learning Rust first can be very helpful for learning C in the future, working with the borrow checker and race safe threads can help you to realise where in C you need to be cautious with your memory management and watching your variable usage, and getting into scenarios that I did need to use raw pointers in Rust, is really helpful for then going on to experiment with C
In my experience it's the other way round (mostly with C++). You understand why the ownership model in Rust is great. You understand why there are lifetimes to avoid dangling pointers because you're familiar with those problems in C/C++. But going back to C/C++ afterwards does make you a better C/C++ programmer.
The first language I learned was C#. The teach jumped directly into object oriented development.
Because of this teacher I absolutely hate C# and never ever wanted anything to do with programming. Only later in University I actually learned C and C++. Then Java a language which I completely forgot how to use.
After some fun classes in with assembly (why mips assembly nobody uses mips anymore), real time system (arduinos). Wireless Sensor networks (C with Atmel-Studios IDE) and somewhat surprisingly a major contributor was a FPGA class using VHDL.
Well now I’m an embedded developer intern at a power-tools manufacturer.
I consider every Operating System a nuisance. No OS no segfault 😂. Just kidding.
Well I still didn’t use rust yet and I’m honest there are no plans to use it any time soon. Not because it’s bad in any way. It simply never came up as an option.
If employer want me to code rust, sure why not, it sounds like fun.
same exactly story here omgoodness
I've always said that C is the best language for beginners. The concepts translate to other languages, forces you to pay attention to how the stack and heap work etc.
Absolutely, and this is coming from someone who has spent most of their time with python... knowing a bit of c at least, helps you appreciate things like deep copies vs shallow copies. But yeah, maybe python (or I guess any dynamic interpreted language, just less syntax and easier debugging to begin with) then c then c++ then rust :)
C++ is a rabbit hole
@@demenevdmitriy4175 Maybe, but it gave us RAII and zero cost abstractions, and in my view it's pretty sane in its approach to OOP which sometimes goes too far in other languages...
Rust is faster than C, safer than C and syntactically better than C.
Nothing is faster than c
@@happygofishing Oh yeah? Create a hashtable
don't agree with the first claim but +1 because propaganda is important 😂
Rust is faster than light.
Rust is faster than C except in compilation speed, and program development time.
C. I'm not aware of any good library for Rust on a microcontroller. C you can use on anything.
C is the ultimate marcro-assembler.
For the record, I learned Basic first, then assembly, COBOL, Fortran, JCL, Pascal, and K&R C.
Embassy. There, now you're familiar with a good "library" (framework really) for Rust on (certain) micros. And there are others. And of course it's not necessary to have libraries at all for some embedded development.
C Programming Language Gang
👇
Modula2 was better than C in every objective measurement, except for popularity. Sadly, people have turned to Rust to counteract the many flaws of C, and it indeed is far superior in terms of protection against dumb mistakes, and has addressed packages more sensibly, and cleans up some of the syntax mistakes of C. However, Rust has by my measurement around a 24% punctuation frequency (percent of chars, excluding whitespace that are non alphanumeric), which is terrible for readability. In certain areas like string processing, Rust is beyond clumsy. Have a string you want to index by character, use:
let letters = name.chars().collect::();
that's obscene IMHO.
C is the language of the gods. Rust is the language of the gods irritated killjoy wives telling them the platypus is a bad idea.
Yes, C first and then Rust, sometimes you need FFI that only C can do in other programing language
bro rust is giga ugly, that shit has disgusting syntax, just no
@@RustIsWinning lmao just look at your profile, did the creator of rust came in your mouth lmao fanboy chill, rust can get fucked
It's not about "speed vs safety". Rust easily performs as well as C.
I enjoy the topic, the content and the comedy, thank you
Completely agree, I don't see learning Rust useful if you don't understand the problems it tries to solve.
It's like saying Vim or Emacs? Both :p (What a nice way to avoid conflict)
Just kidding, I agree with you. It was fun with your other friends LOL.
When people ask me, how they should learn programming, I ALWAYS say - buy an Arduino learn kit for $20, do some projects with it, remove the Arduino Bootloader, do the same projects again without Arduino header and alter this code to use pointers.
After that, you've got a pretty good understand on how C works, how compiler work, how RAM and storage devices work and how processors work.
Next step would be to grab a Raspberry Pi and program a driver or two for the ICs from your Arduino kit and you know basically everything there is to know for a starting programmer.
You know C (and can switch to C++), you know hardware, you know drivers, you know how to extend the most used operating system in the world.
Taking interpreter languages like Python or going wild with web development could be your next step, easy to learn an master if you've got the basics from C.
All the code you will ever write, runs on computers so its one of the most valuable things to know how they work, either for optimization, portability and to know in general what the heck you are even doing.
Also it's getting hard to find embedded programmers these days, since it seems (to me) that no one wants to go through all the hustle with computer knowledge.
That's like the path of learning every language. Learn C first then learn something else after. Understanding C gives you a really good foundation
Typescript and C.
C for showing how the computer actually works.
Typescript for showing off higher level ideas, how to use a robust type system etc.
After that learning Rust isn't much more difficult.
I've been working with Java ever since it was introduced. But before that, I also programmed in C for a few years, and before that, back on my Atari ST computer, dabbled in assembly. I absolutely agree that learning a low-level language like C is very valuable, even when you don't want to use it later. It really helps better understanding what that stuff in a high-level language like Java does under the hood.
Also, as of right now, with Rust still being quite young, you will likely find more job openings asking for C programming knowledge than for Rust. So for this reason alone I'd recommend learning C first.
Did you find it difficult to transition to Java after learning and using C?
I also dabbled in Assembly way back in the 70s and 80s. Subsequently, I've been a C/ C++ developer for 25 years but completely failed at transitioning to Java. I hate the language literally and conceptually and I hated the whole java ecosystem. We're forced to use the Eclipse IDE. And what a peice of unstable bloated crap that is. And since our dev team has been moving away from C++ toward Java, I'm effectivelly being forced into early retirement.
I don’t care about Programming Language. I just wanna develop a product!
Great video though
frankly, I'd say to learn both, plus maybe some assembly (ARM is good if you have a chip you can use)
Use C and assembly to learn about how computers work, how programs interact with an OS, etc.
Then use Rust to develop instincts around memory safety, as all it really does is force you to follow best practices
arm is so easy to learn, 1000x easier than x86 due to being risc (what the fack is a cvttss2si???) and i'd say it's easier than c++. not c though, c is super simple.
I started using rust from c# and I am amazed how easy it is, rust seems to allow the use of higher level concepts that I commonly used in c# and I thought going to a lower level language would be difficult but generics and dynamic types are so much simpler and logical when down at lower level I wish I had learned it sooner, and the speed and memory usage! Amazing. I never used C but I did watch the cs50 videos that used c.
C is my first programming language and it still power the world today. I learn Rust recently, it designed to save your life and time finding trillion dollars bugs. Rust not allow you to compile buggy code especially memory error prone. Now I feel Rust is so beautiful and sexy. C is powerful but weak check, that mean you could create tons of security vulnerabilities and C compiler allow you to do it.
There is a different kind of developer we have today. Everything is library or an import so all people are doing is someone elses code to put things together. I'm glad to see more people going down the road of learning lower level languages. It changes the way you see computers and the software that you use on a daily basis.
2:28 I learned rust a few years ago having only tried python beforehand. It honestly wasn't too hard to start learning and while it did take me a while to get used to rust being statically typed (where previously my programs would just use python lists) it really only took a week or two to get my head around it.
C on the other hand... damn if I was learning that straight after python I don't think I would still be programming. C legitimately hurts my brain even after 3 years of learning rust. my current project is writing a simple vim-inspired text editor in C and I must have seen a segfault error with no accompanying reason a thousand times in the last few days and It's starting to get to me.
My advice is always super brief: C is must, Rust is an option. Big respect to both languages.
'Rust has a higher bar to entry'. I completely disagree with that sentiment. To write code that is useful, and works properly it is much quicker to get started in Rust than in C. Yes rust has more high level concepts but you don't need to take them on all at once. The 'borrow checker' is a compiler tool that walks you through memory management. Yes you have to understand a tiny bit about what it demands from you but you can actually get away with a lot without fully understanding what it is doing or why. Just clone till its happy. Whereas in C, if you try to write anything without understanding memory management you will fail hard and painfully. You will learn about the issues from bugs when the code is running and can be very hard to find and there is no compiler holding your hand. The experience is definitely worse.
C - easy short term, hard long term
Rust - hard short term, easy long term
Hearing this reminds me of an old presentation or textfile I can't remember
I *think* by cult of the dead cow
(I'm 38... I'm old look it all up if anyone thinks I'm making this up)
Smashing the stack for fun and profit
Anyone else remember that?
Awesome for the time as it was something that hadn't been covered in a like "we" sense rather than people just individually figuring it out and and keeping it to themselves...
Yes alot of this is irrelevant...
But I'm also interacting so you know the algorithm shows this channel to more people
C isnt just about speed and Rust isnt just about safety.
Rust comes with a lot of great tooling and standardized experiences that make it so much easier to dive into. A random project's only difference from yours is that it has different source code. The project building method, style, structure, conventions and tooling are the SAME. Its made for collaboration. Of course, if you want to use it individually its a beautiful language too.
I do not want anybody dictating what is safe for me or not, so C all the way. The heck.
Totally agree buddy. Have learnt both languages to a fairly advanced level. But when you ask me, C is not even a language. It is the foundation of everything in CS. No one has the patience to assemble machine code. So learn c before everything (python, javascript) doesn't matter learn c first just the standard programming concepts. No need to go through advanced concepts like cache freeing or async in c. Then move to any language you desire. All algorithms must be learnt through c first to get a really good idea.