C in 100 Seconds

Ғылым және технология

The C Programming Language is quite possibly the most influential language of all time. It powers OS kernels like Linux, Windows, and Mac and many other low-level systems. Its syntax has inspired many other languages, including Cpp, Csharp, Java, JavaScript, Go, Perl, and more.
#programming #compsci #100SecondsOfCode
🔗 Resources
C Manuel www.gnu.org/software/gnu-c-ma...
GCC compiler gcc.gnu.org/
C History en.wikipedia.org/wiki/C_(prog...)
🔥 Get More Content - Upgrade to PRO
Upgrade to Fireship PRO at fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- C programming basics
- C pointers
- Memory safety and segmentation faults
- C syntax
- What is C used for?
- History of C

Пікірлер: 2 700

  • @Beebo
    @Beebo2 жыл бұрын

    My professor had a saying: "You will die but C will live."

  • @awuuwa

    @awuuwa

    2 жыл бұрын

    that's a good saying

  • @xCwieCHRISx

    @xCwieCHRISx

    2 жыл бұрын

    Yea C wont die out because of embedded systems.

  • @RainMan52

    @RainMan52

    2 жыл бұрын

    so long as there is electricity, C will be forever

  • @awuuwa

    @awuuwa

    2 жыл бұрын

    ​@@Afterburn7 c is used in kernels and stuff.

  • @yoshiguy35

    @yoshiguy35

    2 жыл бұрын

    @@Afterburn7 C++ is C with AIDS

  • @jencruz21
    @jencruz212 жыл бұрын

    Everybody: use print-F to print the value Jeff: *Use printfffff*

  • @evertonalmeida1165

    @evertonalmeida1165

    2 жыл бұрын

    It's not Jeff it's Jefffffff

  • @quazar-omega

    @quazar-omega

    2 жыл бұрын

    @@evertonalmeida1165 Je-F

  • @mmti1010

    @mmti1010

    2 жыл бұрын

    😂😂😂 lol

  • @_prothegee

    @_prothegee

    2 жыл бұрын

    Ffffffff

  • @tarangpatil6952

    @tarangpatil6952

    2 жыл бұрын

    @@_prothegee Ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

  • @xpkareem
    @xpkareem Жыл бұрын

    Becoming a programmer these days is like coming in to a movie theater halfway through the movie. Computer Science history weighs heavy over everything. After decades of messing around with computers and programming I understand the approach of learning things in the order they were invented- everything builds on what came before. Everyone should learn C first if they want everything that follows to be many time easier- because you will have context and won't need to constantly ask: "Why TF did they do it that way?" you'll already know.

  • @anthonyobryan3485

    @anthonyobryan3485

    Жыл бұрын

    I went from BASIC to assembly to C back in the late 80's and early 90's. By the time I got to C, I already knew what "i++" and "++i" meant, how they were different, and why that difference was significant. I had already programmed position independent and re-entrant systems, and understood the benefits and costs involved. I understood why Motorola CPU's were/are far better at it than Intel. I agree with you that learning programming history is a huge, highly underrated benefit.

  • @yvvxn

    @yvvxn

    Жыл бұрын

    I studied the history of computing for 2 weeks straight before actually learning how to program.

  • @mansbjork5721

    @mansbjork5721

    Жыл бұрын

    It would be insane to teach 15 year olds C, which is when we start learning some programming where I'm from. We start with Python. As someone whose first language was Python, I haven't struggled that much with C honestly.

  • @foodiusmaximus

    @foodiusmaximus

    Жыл бұрын

    Seems similar to the way one learns studio or fine art at the professional level. Nothing exists in a vacuum and the best artists reference what came before. Ongoing dialogue

  • @dipper5151

    @dipper5151

    Жыл бұрын

    EXACTLY! I keep asking myself the same question: "WHY DID THEY DO IT THIS WAY". I can't focus due to this. Can somebody tell me how I can overcome this?

  • @Koubles
    @Koubles Жыл бұрын

    Being a CS student, transitioning from classes where C is the only language to now building modern apps with Kotlin/Swift and other various API's and languages. I now really appreciate the simplicity of C.

  • @liveinthecity11211

    @liveinthecity11211

    10 ай бұрын

    Agree 100%. But I'm also grateful we have languages like Java that have garbage collection. Haha.

  • @onlinealias622

    @onlinealias622

    6 ай бұрын

    I work as a software engineer writing C code on embedded linux, and while the C language may be simple, the bugs can be some of the worst ever. I'm finding I much prefer higher level languages. Also, the lack of a string type or decent string library (string.h is trash IMO) really hurts its usability. Also, legacy C code written by EEs who didnt know good programming practices is some of the nastiest stuff ever created lol

  • @justaway_of_the_samurai

    @justaway_of_the_samurai

    5 ай бұрын

    If you ever programmed anything more advanced than an introduction to programming "Hello World" program in C, you would appreciate the simplicity of higher level languages.

  • @unheilbar

    @unheilbar

    5 ай бұрын

    How long did it take you to turn from being heterosexual to kotlin developer?

  • @Koubles

    @Koubles

    5 ай бұрын

    @@unheilbar AHAHAHAHA! Oh that's good. About one college course that praised AGILE and OOP like they were made by the second-coming of Jesus himself dude.

  • @notgin
    @notgin2 жыл бұрын

    Love how it ends with a seg fault, describes the C experience perfectly

  • @diskyariajetmiko

    @diskyariajetmiko

    2 жыл бұрын

    What does it mean?

  • @mberoakoko24

    @mberoakoko24

    2 жыл бұрын

    Seg fault almost cost me my last semester

  • @loganhello

    @loganhello

    2 жыл бұрын

    @@diskyariajetmiko A seg fault is when you try to read or write to somewhere that you haven't allocated memory for.

  • @beefbox

    @beefbox

    2 жыл бұрын

    @@loganhello not necessarily, it's read or write in memory that you are not allowed to read from/write to. You can read garbage from memory that you haven't allocated but that is undefined behaviour.

  • @aldi_nh

    @aldi_nh

    2 жыл бұрын

    Ah, the memory

  • @codegambit2507
    @codegambit25072 жыл бұрын

    "Use prinffffff" 🤣🤣🤣🤣 And those "C" puns at the end 👏🏾

  • @melekRebai

    @melekRebai

    2 жыл бұрын

    Exactly what I wanted to comment 😁

  • @pss_crs

    @pss_crs

    2 жыл бұрын

    You committed on behalf me.😁😁

  • @oamioxmocliox8082

    @oamioxmocliox8082

    2 жыл бұрын

    ;)

  • @Dave-oi4fx

    @Dave-oi4fx

    2 жыл бұрын

    That's what "C" said...

  • @sdprolearning

    @sdprolearning

    2 жыл бұрын

    I love that

  • @chbrules
    @chbrules2 жыл бұрын

    C is beautiful in its simple complexity. I started in C++ 18 years ago, but I've come to find warmth and love in the C language experience.

  • @harleyspeedthrust4013

    @harleyspeedthrust4013

    Жыл бұрын

    I love C. Definitely one of my favorite languages, up there with ocaml and rust

  • @chbrules

    @chbrules

    Жыл бұрын

    @Joltacks You just have to be touched by Dennis Ritchie to know. And he knows how to touch a man very well ;)

  • @thehammurabichode7994

    @thehammurabichode7994

    Жыл бұрын

    Your toxic relationship with C++ has been discarded, and your heart has been soothed by the warmth of -"holy"- C 🖤

  • @usernotfound342

    @usernotfound342

    Жыл бұрын

    @Joltacks It's simple: I started coding in C. I can now easily comprehend any other programming language.

  • @JerehmiaBoaz

    @JerehmiaBoaz

    Жыл бұрын

    18 years ago? Modern C++ is nothing like the C++ you experienced. C++ is a living language that is in constant development and from 2011 on gets a feature update every 3 years. The latest standard C++20 (introduced in 2020) is so different from the C++03 or even C++98 you experienced that it should be barely recognizable to you. C++17 is what got me back into C++ and C++20 is so much better.

  • @manuchatterjee8809
    @manuchatterjee88092 жыл бұрын

    C is challenging to master because to truly use it well, one must understand fundamentally understand how computers work. This means having some ideas about registers and ASM syntax, while not required, greatly enhances interpreting why certain design choices were made in C. C allows interfacing to hardware in straight-forward ways (custom registers, memory mapped peripherals) which don't really make sense in higher level languages. So C excels at low and mid level tasks where performance and resource allocation are the most important criteria. But it is difficult to be time efficient if you have to mix complex dynamic data, such JSON or web content.

  • @alexeynezhdanov2362

    @alexeynezhdanov2362

    2 жыл бұрын

    Well, it's true about almost(?) every language. If you want to master it - you MUST understand, what happens under the hood. Without understanding you can get relatively far, but other people will point at you and laugh.

  • @bf945

    @bf945

    2 жыл бұрын

    Yep. C is just a high level form of Assembly. The output from many C compilers is an Assembly program which is then fed to the Assembler to create object code and then to the Linker to create executable code.

  • @arkeynserhayn8370

    @arkeynserhayn8370

    Жыл бұрын

    @@bf945 That the case with many (all?) compiled languages, but the thing specific to C is that since C is simple (not necessarily easy), its easy to reason about generated Assembly, specially if you have habit of reading Assembly listing file of some compiler, you get a general idea what assembly instructions your compiler might generate from some C code. This is what makes C so joyful to work with in Systems programming.

  • @traveller23e

    @traveller23e

    Жыл бұрын

    @@alexeynezhdanov2362 As a C# dev...no you don't. I routinely have trouble where I can't find anyone on my team who knows whether the performance of a LINQ statement will be better written one way over another, for example. In that environment, performance almost never comes up in consideration, it's all about how clear and maintainable the code is, and if it follows a set of arbitrary style guidelines that are defined vaguely enough no one can agree on (or even really cares) what they mean. Java's the same way...and when you add in front-end web development and consider a lot of backend stuff is written on the assumption that microservices or other tech magic will do all the optimization you need (I mean, to be fair most of the time is spent executing web calls anyway), that's a sizeable chunk of the industry that doesn't require any low-level knowledge for better or for worse.

  • @carltone

    @carltone

    Жыл бұрын

    @@traveller23e the discussions is about C not C# which is abstracted!

  • @leoaso6984
    @leoaso69842 жыл бұрын

    C is such a simple language that you could learn the syntax in a day, learn the important parts of the standard library in less than a week, and learn how to use pointers.... eventually.

  • @saeedbaig4249

    @saeedbaig4249

    2 жыл бұрын

    You can learn pointers... you never master pointers

  • @vaisakhkm783

    @vaisakhkm783

    2 жыл бұрын

    @@saeedbaig4249I loved c and hated all other languages when i studying After my school, i had learned so many other langs, and I never even used c in my job or higher studies, but nothing same as c

  • @betterthanb4r

    @betterthanb4r

    2 жыл бұрын

    @@vaisakhkm783 depends where u work

  • @vaisakhkm783

    @vaisakhkm783

    2 жыл бұрын

    @@betterthanb4r yes, i ment that, eventhough i never used it.... i still love it....

  • @SteelHorseRider74

    @SteelHorseRider74

    2 жыл бұрын

    ...once you see the pointer, which points to the pointer of the pointers' pointer

  • @scattonsimon6992
    @scattonsimon69922 жыл бұрын

    Quick remark, gcc actually means GNU Compiler Collection and not GNU C Compiler, the name GNU C Compiler was dropped around 1999 (in April to be precise) because C was only one of gcc's frontend.

  • @Fireship

    @Fireship

    2 жыл бұрын

    Good call, thanks for the correction

  • @scattonsimon6992

    @scattonsimon6992

    2 жыл бұрын

    @@Fireship No problem! Keep up the good content!

  • @puppergump4117

    @puppergump4117

    2 жыл бұрын

    @@Fireship You could pin him or something but everyone who searches for it will just type gcc anyways I guess

  • @pearz420

    @pearz420

    2 жыл бұрын

    Yeah details like that aren't included in the first paragraph of a wiki page, so the youtuber missed it.

  • @wealthmaster69

    @wealthmaster69

    2 жыл бұрын

    @@pearz420 😂

  • @peppi69
    @peppi69 Жыл бұрын

    I still think C is the most perfect programing language. It's easy to understand to begin programing but has unlimited possibilities on what to build with it and it really runs on anything

  • @petergibbons607

    @petergibbons607

    8 ай бұрын

    it's like driving a manual transmission, only the people actually good at it will be able to understand its greatness.

  • @shadowchasernql

    @shadowchasernql

    8 ай бұрын

    yes compared to something like js it's a godsend

  • @oliverdixon4660
    @oliverdixon46602 жыл бұрын

    "Platform-dependent" in the context of compilers doesn't really imply dependence on a particular operating system; it means the native code is generated for a specified processor architecture, such as ARM or x86.

  • @Tachi107

    @Tachi107

    2 жыл бұрын

    I'm theory you're right, in practice if you're going to use the standard library you'll likely be bound to the architecture AND the OS

  • @tiagodmota5840

    @tiagodmota5840

    2 жыл бұрын

    Platform is OS + processor architecture. No?

  • @Unit_00

    @Unit_00

    2 жыл бұрын

    I'm 99% sure this is wrong, since compiled code will use subroutines defined in ram by the OS, so an executable for linux won't work on Windows even if they are run by machines with the exact same specs

  • @oliverdixon4660

    @oliverdixon4660

    2 жыл бұрын

    @@Unit_00 Well that's a different matter of binary formats and position dependency.

  • @davawen9938

    @davawen9938

    2 жыл бұрын

    Well it depends, if what you want to do is emcompassed by the architecture, then the resulting assembly will be the same: (adding two numbers from the stack together) mov edx, DWORD PTR [rbp-4] mov eax, DWORD PTR [rbp-8] add eax, edx But if you need anything provided by the OS (so most things done by the standard library), the compiler output will probably be different: (exiting program, Linux vs Windows) mov eax, 60 ; sys_exit system call mov edi, 0 ; return code syscall ; equivalent to int 0x80 mov ecx, 0 ; return code call ExitProcess ; WinApi function add rsp, XXX ; clean up stack

  • @hitlerssecondcoming2523
    @hitlerssecondcoming25232 жыл бұрын

    2:14 "Segmentation fault" - classic

  • @VivekYadav-ds8oz

    @VivekYadav-ds8oz

    2 жыл бұрын

    ​@Z3U5 Different compilers have different behaviour, but GCC allows the implicit conversion, so (char*) isn't necessary. Plus, char on most systems is 1 byte, so though a good practice, not multiplying by sizeof(char) wasn't the cause of error either. The only thing I can think of is that his malloc failed to allocate memory, and hence he tried to access null + 1 address, which failed.

  • @NoNameAtAll2

    @NoNameAtAll2

    2 жыл бұрын

    @@VivekYadav-ds8oz char is 1 byte on ALL systems, cause it's the "single byte" it's in the standard :)

  • @NoNameAtAll2

    @NoNameAtAll2

    2 жыл бұрын

    @Z3U5 casting malloc result is not canonic C

  • @int16_t

    @int16_t

    2 жыл бұрын

    @ZRU There is no problem with the original code he wrote unless he change it somewhere and didn't included it in the video. He never access any illegal memory address. void* can be safely cast to any type except a function pointer.

  • @Fireship

    @Fireship

    2 жыл бұрын

    I left out the code that caused the seg fault, it was an intentional joke

  • @pragyan394
    @pragyan3942 жыл бұрын

    Ah yes the classic functions, print-fff and scan-fff

  • @mananasi_ananas

    @mananasi_ananas

    2 жыл бұрын

    And fprintf, and sprintf, and fnprintf, and snprintf, and vprintf, and vfprintf, and vsprintf, and....

  • @whythosenames

    @whythosenames

    2 жыл бұрын

    @@mananasi_ananas i love these now im going to call it ffffprintfff

  • @alexrenoki8366

    @alexrenoki8366

    2 жыл бұрын

    @@whythosenames sssnnprintfff

  • @devilbob

    @devilbob

    2 жыл бұрын

    Useless functions. All my homies use write() and read()

  • @yeahthebois3617
    @yeahthebois3617 Жыл бұрын

    Tip with malloc: if you cant remember how much bytes u need to store u can do malloc(sizeof([datatype here]) * [how much of those datatypes you want]) e.g: char* word = malloc(sizeof(char)*4) Now with chars its easy (1 char = 1 byte) however this technique works well when ur making struc arrays

  • @TheLoveMario

    @TheLoveMario

    Жыл бұрын

    If you need to initialize a string and know its length at compile-time just avoid the heap-allocation and do char word[4];

  • @unpatientes1562

    @unpatientes1562

    Жыл бұрын

    i think in this case it's better to use calloc: str* word = calloc(4, sizeof(char))

  • @yeahthebois3617

    @yeahthebois3617

    Жыл бұрын

    @@TheLoveMario that's cool until you have to access that variable outside of the function its initialised in.

  • @TheLoveMario

    @TheLoveMario

    Жыл бұрын

    @@yeahthebois3617 In a header file: char* word; Inside the function: static char a[4]; word = &a;

  • @yeahthebois3617

    @yeahthebois3617

    Жыл бұрын

    @@TheLoveMario completely forgot abt that one there 😂😂😂

  • @jimmyvo1667
    @jimmyvo16677 ай бұрын

    Love videos like this to just get a general idea of what something is

  • @orco3847
    @orco38472 жыл бұрын

    Actually, as opposed to C's neighbours, one can really learn all C's syntax in 100 seconds... 😂

  • @orco3847

    @orco3847

    2 жыл бұрын

    @@naltun4702 💯 percent agree.. I had my suffering from C, then I moved to JS. Thanks GOD 🎶🎶

  • @socketbyte5348

    @socketbyte5348

    2 жыл бұрын

    @@naltun4702 C is one of the few languages that require you to develop your own standard library to even use the language efficiently. Libc is just way too basic to be reasonable.

  • @schniemand

    @schniemand

    2 жыл бұрын

    I think the *type* syntax of C is quite complicated and I've seen plenty of people get confused by it. I mostly mean declaration and use of anything that has to do with pointers. Pointers aren't complicated but the C syntax without proper explanation can make people think that they are.

  • @orco3847

    @orco3847

    2 жыл бұрын

    @@schniemand That is why I wrote "C's syntax"..

  • @sadhlife

    @sadhlife

    2 жыл бұрын

    @@orco3847 js is worse when it comes to complex stuff :^)

  • @victorpinasarnault9135
    @victorpinasarnault91352 жыл бұрын

    12/10/2011: 10 years ago, Dennis Ritchie past away, leaving the world the legacy of the operational systems and the internet that we use today. He is the true legend, not Steve Jobs.

  • @cobaltno51

    @cobaltno51

    2 жыл бұрын

    and alot of insecure, messy legacy codebases. C is certainly a huge accomplishement, but couldn't we just have bounded buffers? real strings? were those couple of bytes really too much? even as an optional addon?

  • @fredrickdenga7552

    @fredrickdenga7552

    2 жыл бұрын

    He passed on with steve jobs yet few acknowledged him as compared to jobs

  • @adrianorocha-dev

    @adrianorocha-dev

    2 жыл бұрын

    @@cobaltno51 Yes, those couple of bytes were too much in many cases back then. Today we are spoiled by super fast and high memory computers, but people literally counted the bits back in the day. Even C was considered a "heavy" language at some point.

  • @rajveersingh2056

    @rajveersingh2056

    2 жыл бұрын

    Steve jobs is even lesser know than iron man. Point is, Having more than one legend is not a necessary for the world's existence.

  • @Supergecko8

    @Supergecko8

    2 жыл бұрын

    @@cobaltno51 bro it's a 50 year old language

  • @GuimoTheGizo
    @GuimoTheGizo Жыл бұрын

    C was my second language I ever learned. I find it kind of funny that your explanation of C is mostly what happens in the machine for _every language_ but that most people take for granted since so many popular languages have an interpreter and/or sandboxed environment holding their hand.

  • @Brawlstriker89
    @Brawlstriker896 ай бұрын

    I love that I can actually understand every bit of this video now! I watched this when I first started learning c++ about a year ago. I’ve now taken two computer science classes and a web authoring class for html, css, JavaScript. As well as a course in Microsoft power shell. Nice to see I’ve progressed. Lol

  • @poglord._
    @poglord._2 жыл бұрын

    If we look at the algorithm, next would be C++ in 100 seconds, C# in 100 seconds, Assembly in 100 seconds and finally Binary in 100. Last time in the react native, flutter and kotlin series, I predicted correct

  • @patrickmullot73

    @patrickmullot73

    2 жыл бұрын

    that would be "Binary in &1100100 seconds"

  • @sharkinahat

    @sharkinahat

    2 жыл бұрын

    If C was 100 seconds, clearly C++ must be 101 seconds, or 5 in base 10.

  • @PrimalCoder

    @PrimalCoder

    2 жыл бұрын

    What about Eiffel and Ada? Maybe, Pascal and Lisp even. Not to mention Algol and Smalltalk.

  • @rickdev1922

    @rickdev1922

    2 жыл бұрын

    Quantum Mechanic inside Processor & Silicon Transistor in 100 Second

  • @joel9909

    @joel9909

    2 жыл бұрын

    @@patrickmullot73 epicccc

  • @shanebenning3846
    @shanebenning38462 жыл бұрын

    It blows my mind how much of the technology we depend on everyday came from Bell Labs

  • @thedrunknmunky6571

    @thedrunknmunky6571

    2 жыл бұрын

    Truly a place with so many of the smartest people in the world.

  • @PhilipAlexanderHassialis

    @PhilipAlexanderHassialis

    2 жыл бұрын

    Indeed Bell Labs and Xerox Parc technologies and invented paradigms are still either directly or indirectly used today - these people were the knee's bees. Amazing visionaries and engineers all of them.

  • @KookoCraft

    @KookoCraft

    2 жыл бұрын

    @@PhilipAlexanderHassialis What I saw at Xerox Parc's graphical user interface demonstration was a regression. Its no longer "normal" to use a command line to get exactly what you want done, fast. It's all point and grunt like cave men.

  • @jeffesoncosta14

    @jeffesoncosta14

    2 жыл бұрын

    @@KookoCraft If you dont like just dont use it.

  • @kanjakan

    @kanjakan

    2 жыл бұрын

    @@KookoCraft GUI is better though.

  • @martinstent5339
    @martinstent53396 ай бұрын

    One of my all-time favourite things is Exercise 1-23 at the end of chapter 1 in “The C Programming Language” It says “Write a program to check a C program for rudimentary syntax errors like unbalanced parentheses brackets and braces.” This at the end of the first chapter!! We only learned the very basics, and now Kernighan/Ritchie expect us to do that! I think I actually went back and did this exercise after reading chapter 5. But it still remains with me 40 years later as something that just seemed so “Wow!” …

  • @neutral_positron

    @neutral_positron

    2 ай бұрын

    Same experience. Actually really like the book, by the time you read it you feel like you can actually write useful progtammes

  • @XX-ue6kj
    @XX-ue6kj Жыл бұрын

    🤣🤣🤣🤣🤣🤣. That last part killed me! That caught me off guard. That was so good! Im subbing just for making me laugh so hard. Thank you.

  • @justapugontheinternet
    @justapugontheinternet2 жыл бұрын

    I remember writing an employees management system using C during my first year of university. Learnt a lot, including the fact that I don't wanna write C code for work.

  • @justapugontheinternet

    @justapugontheinternet

    2 жыл бұрын

    @@mattmurphy7030 I admire your kind. The guys who write C code and do embedded stuff. I love it, but I just haven't had a chance to do it extensively. I feel like that's where the real stuff is at.

  • @gamerk316

    @gamerk316

    2 жыл бұрын

    @@justapugontheinternet It is. That's pretty much what I do for a living. It takes time to get used to. That being said, with embedded processors being a lot more powerful than they used to be (the Cortex A53 is an industry favorite right now) we're able to splurge a lot more and go C++ rather then straight C, since we aren't as performance constrained as the days when we used 286's and 68000k's as our embedded processors of choice.

  • @toby9999

    @toby9999

    2 жыл бұрын

    @@gamerk316 Not sure about you but I loved the 68000 architecture. It was so elegant compared to the x86 stuff. I've been fortunate to have been working with C and C++ for 25 years but now being pushed into the Java world, I'm hating it.

  • @MaxiJabase

    @MaxiJabase

    2 жыл бұрын

    @@toby9999 Go C# my friend.

  • @nerd2544

    @nerd2544

    Жыл бұрын

    @@toby9999 what's your job

  • @JoolsParker
    @JoolsParker2 жыл бұрын

    I was brought up on C - I bloody love the language (doing realtime embedded software and device drivers with it is a rollercoaster until you know what you're doing).

  • @Crazy_Diamond_75

    @Crazy_Diamond_75

    2 жыл бұрын

    The coolest thing I ever had to do in C was implementing sensory input on an Arduino microcontroller. It was a bizarre combination of bit manipulation, machine language, and regular C that you could only do in something as low-level as C itself.

  • @RealValkor
    @RealValkor9 ай бұрын

    I am a C# programmer and I recently started learning C to program with arduino. My prior knowledge of C# really helped me understand basic programming fundamentals and syntax. Both are definitely great and useful languages!

  • @Tabvn
    @Tabvn Жыл бұрын

    C, c++ , and Go that is simple to learn and training your mindset and programming skills. Thanks for quick video but really useful!

  • @DannyBPlays
    @DannyBPlays2 жыл бұрын

    That part about a string being an array of chars brought me wayyy back to early days in my university class learning C

  • @JoolsParker

    @JoolsParker

    2 жыл бұрын

    But did you ever create an array of characters without remembering to terminate it with a '/0'??? A noob move that everyone learning C has to go through 🤣

  • @raunak1147

    @raunak1147

    2 жыл бұрын

    @@JoolsParker '\0' not '/0' :D

  • @JoolsParker

    @JoolsParker

    2 жыл бұрын

    @@raunak1147 🤣 That’s the noob move that comes after realising there’s no terminating character!

  • @raunak1147

    @raunak1147

    2 жыл бұрын

    @@JoolsParker :o

  • @ShashotoANur
    @ShashotoANur2 жыл бұрын

    Being the mother, C deserves beyond 100 seconds

  • @salsamancer

    @salsamancer

    2 жыл бұрын

    C is the big sister, assembly is the mother

  • @OriMoscovitz

    @OriMoscovitz

    2 жыл бұрын

    It is beyond 100 seconds. It's 145 second to be exact.

  • @borgir6368

    @borgir6368

    2 жыл бұрын

    @@salsamancer assembly is not even a high level language you can call it grandma

  • @praveenawesome2182

    @praveenawesome2182

    2 жыл бұрын

    @@OriMoscovitz hehe

  • @jaydenhenry8083
    @jaydenhenry8083 Жыл бұрын

    This helped me understand character arrays better and how pointers can be used for memory allocation that’s accessed through indexes

  • @unstoppable_ducky4459
    @unstoppable_ducky44592 жыл бұрын

    I just love how Fireship instantly gets to the point and and stays true to the title.

  • @KonKri
    @KonKri2 жыл бұрын

    1:28 use *printffff* exactly what I thought to myself when I was a firstyear at uni😂

  • @manvesh97
    @manvesh972 жыл бұрын

    This makes me want to revisit C, didn’t like it when I learnt it at uni because struggled with pointers, but that all seems more interesting to me now!

  • @senkogaming4784

    @senkogaming4784

    2 жыл бұрын

    kzread.info/dash/bejne/rKmZybOmfcffaLA.html I highly encourage you to watch it, I started learning C with this video. It isn't as hard as you think, you could maybe watch 30 minutes of this video everyday and then watch the Data Structures video from the selfsame youtuber. If you want to learn even more about it, then Jacob Sorber's videos are great too.

  • @5cover

    @5cover

    2 жыл бұрын

    I started programming with C. It's not as hard as people say

  • @gabbagandalfjpr

    @gabbagandalfjpr

    2 жыл бұрын

    what did you learn in this video that you haven't been taught at university? or is it just that you find it more interesting now?

  • @Supergecko8

    @Supergecko8

    2 жыл бұрын

    C gives a lot of nostalgia hahahaha

  • @IngwiePhoenix

    @IngwiePhoenix

    2 жыл бұрын

    C is actually really cool, just absurdly verbose, by design. And you can target just about anything. There is even SDCC, a C compiler that can, for instance, compile for the GameBoy!

  • @mu11668B
    @mu11668B Жыл бұрын

    Honestly C is one of the most amazing language I've ever used. Once you get through the concept of pointers, you'll find out how powerful they actually are. It's one of the most easy-to-use language to do simple parallel tasks without blowing up your memory limit.

  • @dtibor5903

    @dtibor5903

    Жыл бұрын

    Don't forget how powerful memory leaks C does. I just did one yesterday.

  • @WarpRulez

    @WarpRulez

    Ай бұрын

    One of the most easy-to-use languages to do simple parallel tasks? Are you serious? Pretty much _any_ other programming language that has support for threads is simpler to use for parallel tasks than C.

  • @mu11668B

    @mu11668B

    Ай бұрын

    @@WarpRulez The nice thing about C is you can access the same memory chunks in multiple threads more easily. You don't have to call the mutex APIs if the threads are not going to work at the very same position in memory. I'm not sure about Golang though. The synchronization in Java is a bit convoluted but most of the APIs are nicer indeed. Running multi-thread in Python is nonetheless a nightmare. In many cases the GIL gets into the way and makes multi-threading meaningless (e.g. numpy arrays are managed by GIL in the version I used). In my project I had to get both temporal and spatial efficiency and C was the optimal solution to it.

  • @WarpRulez

    @WarpRulez

    Ай бұрын

    @@mu11668B That doesn't make C the easiest language to run multiple threads. It just makes it easier to access shared memory without mutexes. If that's the measure of easiness, then C++ is better on both fronts: It's very easy to create multiple threads (with 100% standard code, no need for non-standard libraries) and you can likewise bypass mutexes if you want. (And, in fact, the C++ standard library also offers support for efficient atomic variables. I don't know how many other programming languages do. And yes, C does too, I know.)

  • @slippydouglas
    @slippydouglas2 жыл бұрын

    `char` is always 0-255. If you want a -128-+127 type, you’ll need the rarely-used `signed char` or more common `int8_t` type.

  • @asuasuasu

    @asuasuasu

    Жыл бұрын

    @scum bag worse: as far as gcc goes, on ARM it's unsigned, on x86-family it's signed. yet, char remains different from signed char and unsigned char to the type system :) nothing in the standard actually prevents `char` from being 16 bits... some obscure platforms (e.g. DSPs) may do that, but it can be assumed to be 8-bit for all typical platforms

  • @abubakrakram6208
    @abubakrakram62082 жыл бұрын

    I think C’s easier than C++. With C++, you feel like you never actually finish learning the syntax. Ever.

  • @ananttiwari1337

    @ananttiwari1337

    2 жыл бұрын

    yeah, exactly

  • @purple.requiem

    @purple.requiem

    2 жыл бұрын

    I really hate it when I get weird errors.

  • @sxs512

    @sxs512

    2 жыл бұрын

    You do finish learning the syntax. I learned most of c++ when I was in middle school in a couple of months. You just need a good tutorial and a lot of determination.

  • @abubakrakram6208

    @abubakrakram6208

    2 жыл бұрын

    @@sxs512 I'm glad to hear it's possible. I've only been learning since September, so I think I've still got a bit of time to go. Most online tutorials are anemic, though, so I think I'll need to memorize the class textbook or something.

  • @purple.requiem

    @purple.requiem

    2 жыл бұрын

    @@mattmurphy7030 C++ gets freaking confusing when you learn about pointers. Segfault runtime errors are a pain on my arse

  • @rifkyniyas122
    @rifkyniyas1222 жыл бұрын

    Everyone: print ef Jeff: prin(t)ph

  • @QxDEADBEEF
    @QxDEADBEEF2 жыл бұрын

    2:19 I C what you did there.

  • @ZacharyCarthair
    @ZacharyCarthair2 жыл бұрын

    Love your videos. Would love to see one for Ruby too!

  • @engel_e
    @engel_e2 жыл бұрын

    2:04 if needed, you can mimic an object-oriented programming language approach in C by having function pointers inside a structure, which then would be accessible through the arrow operator. An instance of this structure could be compared to an object with its getters, setters and methods. Very nice video, I haven't used C lang for quite a few years and that's a great throwback with all those countless segfaults

  • @ccgarciab

    @ccgarciab

    2 жыл бұрын

    iirc that's what they do in the Linux kernel

  • @dany5ful

    @dany5ful

    2 жыл бұрын

    How would something like 'private' and 'public' work tho?

  • @IngwiePhoenix

    @IngwiePhoenix

    2 жыл бұрын

    This is what SDL does, iirc. struct some_sdl_interface { func_ptr method; }; struct some_sdl_interface* create() { ... st->method = method_ptr; ... } create()->method(); I think SDL does that for a lot of its abstractions.

  • @bamberghh1691

    @bamberghh1691

    2 жыл бұрын

    @@5cover opaque pointers can be used to hide details

  • @hamidcrazy9027

    @hamidcrazy9027

    2 жыл бұрын

    Yep, do know that a lot of oop features are made using structures and function pointers

  • @mesota2842
    @mesota28422 жыл бұрын

    Can we get a "Lua in 100 seconds?🔥"

  • @prasannasilva7754

    @prasannasilva7754

    2 жыл бұрын

    Of course! my favorite programming language persuaded me to learn programming properly.

  • @softwarelivre2389

    @softwarelivre2389

    2 жыл бұрын

    Oh, the forbidden language technique of the Hidden Brazillian village. A man of culture, I see.

  • @vivzi_sk3

    @vivzi_sk3

    2 жыл бұрын

    I was about to ask this

  • @ultimaxkom8728

    @ultimaxkom8728

    2 жыл бұрын

    @@softwarelivre2389 lol

  • @dmitrykargin4060

    @dmitrykargin4060

    2 жыл бұрын

    @@softwarelivre2389 While other languages were evolving by adding new keywords, the moon of tecgraf evolved by removing them

  • @q12x
    @q12x2 жыл бұрын

    wow, superb explanation of what pointers are !!! Please, do more !

  • @sanctuary_of_soul
    @sanctuary_of_soul Жыл бұрын

    2:10 i like that example of program compilation and launching. What a good demonstration and nice example.

  • @valerie4275
    @valerie42752 жыл бұрын

    That video, like always, was fantastic. I think it'd be quite interesting to see you cover one of the Lisp languages so Common Lisp, Clojure/ClojureScript, or even Scheme (in that case it'd most likely be Racket as many of the other Scheme implementations are too minimalist by themselves or are extension languages instead of general purpose programming languages).

  • @r.t.5767

    @r.t.5767

    2 жыл бұрын

    Scheme is WONDERFUL! I'd watch a video if he made one

  • @mrocto329

    @mrocto329

    2 жыл бұрын

    Clojure! Clojure! Clojure is one of the BEST languages I've ever seen. It takes the good parts of functional programming & good parts of lisp while getting rid of worse parts. It works on JVM so you can use java libraries. Clojure repl and the tooling around it is amazing, the language really focused on the repl. You can even use the repl with clojurescript to run clojure code that then evaluates ON THE BROWSER IN REAL TIME LIKE BLACK MAGIC.

  • @oskrm
    @oskrm2 жыл бұрын

    One note, return + any number means non-success exit, you can then check what code was returned (exited) to figure where you returned that number.

  • @E231986

    @E231986

    2 жыл бұрын

    YES. I was looking for this. Essentially everything in C that is seen as "FALSE" (not always but often defined by pre-compiler) equates to 0 (0x0, etc, not '0' though). Anything NOT "FALSE" (or !0) is seen as "TRUE" or essentially equal to 1. However, anything "TRUE" == 1 is not always true. It's tricky but the only real definition of "FALSE" should always equal 0 and anything non-zero is true. In extension to that, the only error code that means "no error" is 0 itself. Meaning your program ran perfectly with no issue/bug. Anything non-zero isn't necessarily an error, but any "non-flawless" execution. The nuance is necessary and this hasn't been stated enough in the comments (to my knowledge).

  • @SIGSEGV_Core_Dumped

    @SIGSEGV_Core_Dumped

    Ай бұрын

    yeah for example 137 is SIGKILL

  • @ighao6032
    @ighao60322 жыл бұрын

    pointers get me so confused, I'm glad you could explain then só easily and simple!

  • @textoffice
    @textoffice2 жыл бұрын

    very well done ! internet is also write in C . You can put pointer of function into your structure to be nearer of c++

  • @DabbleCache
    @DabbleCache2 жыл бұрын

    Literally began looking into C today for the first time. The timing of these videos has been oddly perfect. Thank you so much for these!

  • @xyfurion

    @xyfurion

    2 жыл бұрын

    Good fuckin luck fam

  • @thedrunknmunky6571
    @thedrunknmunky65712 жыл бұрын

    I had a great lecturer so he helped me (and a bunch of others) through the week or two it took for me to grasp pointers and arrow notation. After this, C became my favourite language to program in as I love how strict it is. And as it’s statically typed you know exactly how the data flows about in your program. And as long as you use them correctly, pointers make for very easy access to variables from anywhere in your program.

  • @JoolsParker

    @JoolsParker

    2 жыл бұрын

    Erm.... I would not say C is a strict language at all - you can REALLY screw stuff up with it. I saw it almost has a higher-level assembly language in some respects. Try looking at Ada for a strict language.

  • @proloycodes

    @proloycodes

    2 жыл бұрын

    @@JoolsParker true

  • @thedrunknmunky6571

    @thedrunknmunky6571

    2 жыл бұрын

    @@JoolsParker By strict I meant mostly that it was statically typed and it was my first statically typed language (I started programming only in uni therefore I was very late to programming). Being able to shoot yourselves in the foot is true though, as we all definitely have. However C is far more rigid, compared to vanilla JS, which is what a lot of viewers of this channel (including myself) program in.

  • @lucass8119

    @lucass8119

    2 жыл бұрын

    @@thedrunknmunky6571 If you enjoy the strictness of C, C++ is significantly more strict with types and casting. C++ has exceptions as well, so the shooting yourself in the foot stuff can be caught, like accessing outside of array bounds.

  • @immanuelcharles2875
    @immanuelcharles28752 жыл бұрын

    It should be said that malloc/calloc allocates memory on the heap and you should only use free on heap allocated memory. Stack allocated memory will be deleted automatically after it goes out of scope.

  • @human-ft3wk

    @human-ft3wk

    2 жыл бұрын

    Immanuel's talking about 0:52 I assume

  • @WarpRulez

    @WarpRulez

    Ай бұрын

    One could nitpick about your use of terminology. Objects on the stack aren't "deleted" per se. The language manages the stack automatically, without the programmer having to write code to do so explicitly, and this management is essentially just updating the stack pointer register. In some kind of vague sense when a function is exited and the stack pointer is changed to what it was before the function was called, that stack space is kind of "deleted", but that's a bit of a misnomer. (In C++ the use of that term would be more apt because in that case the language actually literally calls destructors for objects on the stack, and in this case "deleting" them would be an appropriate term to use, in a sense.)

  • @Mwa0705
    @Mwa07052 жыл бұрын

    This is one of the best, shortest but somehow very thorough explanation of this wonderful language

  • @gameglide9811
    @gameglide98112 жыл бұрын

    Came here in seconds!

  • @scriptkiddie6151

    @scriptkiddie6151

    2 жыл бұрын

    Same

  • @fahd2372

    @fahd2372

    2 жыл бұрын

    Same

  • @Fireship

    @Fireship

    2 жыл бұрын

    Gold! 🥇

  • @gameglide9811

    @gameglide9811

    2 жыл бұрын

    @@Fireship your videos are always fire, this was just what I needed! You always exceed expectations!!

  • @algogeminus

    @algogeminus

    2 жыл бұрын

    same bruhh

  • @sominupadhyaya9026
    @sominupadhyaya90262 жыл бұрын

    That printf was smooth

  • @skullteria
    @skullteria2 жыл бұрын

    I would have liked a comparison of the project development process compared to other languages. Going into dependency management and all the other stuff.

  • @jeffreyhicks6380
    @jeffreyhicks63802 жыл бұрын

    These videos are great! I would love to C a C# / C++ in 100 seconds.

  • @franciscogilt
    @franciscogilt2 жыл бұрын

    Fireship videos are like a knowledge pill for your brain. Simply awesome!

  • @achyuthcn2555
    @achyuthcn25552 жыл бұрын

    Would love a full course on C from you guys

  • @faseehnaqvi
    @faseehnaqvi2 жыл бұрын

    that "c" mad me subscribed. great work!

  • @nort7214
    @nort72142 жыл бұрын

    Love your videos, they are a great wta to learn, Please make a C++ in 100 seconds video!

  • @rickbhattacharya2334
    @rickbhattacharya23342 жыл бұрын

    C is by far one of the best language . Even after so many years and so many languages later it's still very useful .

  • @supernenechi
    @supernenechi2 жыл бұрын

    I always say I love Go, but the elegance of C is something that I just can't get over. It's so beautiful

  • @lucass8119

    @lucass8119

    2 жыл бұрын

    @@CrafterOfHacks Because they represent two completely different things. (.) is the "access" operator, i.e. access a field in this struct. the "->" operator isn't really unique, its actually a combination of two operators. "->" is equivalent to "(*).", as in "deference this pointer to get a concrete object and then access this element in this object". This is why they're two separate operators. "->" is used exclusively on POINTERS, i.e. references/addresses, while "." is used on CONCRETE objects. It allows you to look at code and quickly figure out if a variable is a reference (pointer) or concrete object. It also lets the compiler easily statically check the program, as it will detect if "->" is used with the wrong type and if "." is used with the wrong type. Languages that only use "." can't do that. Also, languages that only use "." generally don't have pointers. See: C# and Java.

  • @lucass8119

    @lucass8119

    2 жыл бұрын

    ​@@CrafterOfHacks I didn't know C# has pointers, but I would say that "." and "->" are both used very often and they're definitely not interchangeable because pointers aren't like references in C++, you can arbitrarily access a method without first dereferencing a pointer. I think it makes sense from a technical view, i.e. pointers must be dereferenced before using a method/member variable, and from a user point of view, i.e. "->" clearly indicates a pointer, "." does not.

  • @bigshrekhorner

    @bigshrekhorner

    2 жыл бұрын

    @@CrafterOfHacks The majority of people haven't actually done proper programming to know how problematic implicit type declaration is. It's very ambiguous and shouldn't be used when you have lots of incompatible variable types, especially when you want to have multiple *uninitialised* variables of different types.

  • @RoonyKingXL
    @RoonyKingXL2 жыл бұрын

    Great video. GCC stands for GNU Compilter Collection. Although it used to stand for GNU C Compiler in the past.

  • @marvinkuznitz6250
    @marvinkuznitz6250 Жыл бұрын

    I was in college studying computer science circa 1980. For programming we were studying FORTRAN and IBM OS360 assembly language. A friend of mine was interning at Bell Labs and he said he was learning a language that was so much better than FORTRAN called "C" and an operating system so much better than IBM OS 360 called "UNIX". After being a professional FORTRAN programmer for a number of years I started to use C and it was so much better than FORTRAN and the whole developer environment was miles ahead of anything else at the time.

  • @sharangsharma203
    @sharangsharma2032 жыл бұрын

    I used to hate it in college, but now later I realise that it provides the perfect balance b/w high level and low level stuff. The pointers stuff and similar low level details provide a great gateway to get into OS, linux, Networking and Compiler stuff.

  • @loriswit

    @loriswit

    2 жыл бұрын

    we're in 2021, there are plenty of languages that provide full control on low level stuff while still being considered high level level languages, and which are also infinitely less painful than C

  • @mccarthymalonza6500

    @mccarthymalonza6500

    2 жыл бұрын

    @@loriswit which ones?

  • @loriswit

    @loriswit

    2 жыл бұрын

    @@mccarthymalonza6500 I'd say it depends on which part of the low level stuff you need to have access to, but I suppose high-level languages like Rust or even C# could satisfy most of the these needs. On the other hand, you could use C when you explicitly need a low-level language that's as close as possible to machine instructions (e.g. when programming for embedded system with very limited resources), but then there's nothing "high-level" about it in my opinion.

  • @borgir6368

    @borgir6368

    2 жыл бұрын

    @@loriswit literally no one use C# and rust for low level

  • @somebodyelse9130

    @somebodyelse9130

    2 жыл бұрын

    @@borgir6368 People do use Rust for low-level things. For example, Redox OS is an example of an operating system written in Rust, and the Linux kernel is adopting Rust for writing some drivers in. The point they were making is that most people don't actually need to use C; C# or Java would still give good performance while being much nicer to program with, because they offer garbage collection and built-in conveniences like inheritance and lambda expressions, and they hide pointers from you so you don't shoot yourself in the foot.

  • @ogamiitto5642
    @ogamiitto56422 жыл бұрын

    Nice video! One small nitpick though: one should never write functions with completely empty argument lists in „C“, as the compiler takes this to mean that the functions in question can be called with a variable number of arguments (of nearly arbitrary type). Taking your example of a completely innocently looking “int main ()” function, this means that it would perfectly valid to recursively call this function-for example-like so: main(1, 'A', 3.7, "unintended consequences"); Thus, if one is not interested in doing any command line argument processing (at all), a programs entry point should always be written like so: int main (void) { ... } Admittedly, this may change with the next version of “C”… however, until the final standard for C2x is released, the above rule stands as described.

  • @leofigoboh1611

    @leofigoboh1611

    Жыл бұрын

    Is It a problem to allow a variable Number of arguments to the main, if you won't use them after?

  • @mehmedcavas3069
    @mehmedcavas30692 жыл бұрын

    C

  • @charina_custodio
    @charina_custodio2 жыл бұрын

    It's my favorite language, plain & simple but still very eloquent to write.

  • @urbaniv
    @urbaniv2 жыл бұрын

    Elm next please :-) Such a great language deserves to be honoured by the best KZreadr ever :-) Thx for you awesome work

  • @kristofersokk1580

    @kristofersokk1580

    2 жыл бұрын

    And its successor Roc as well. Ty

  • @timboooh
    @timboooh2 жыл бұрын

    "Segmentation fault" ah yes, the C language

  • @yapdog
    @yapdog Жыл бұрын

    Been programming in C for 3 decades, so, at this point, I can't even use a language that doesn't allow me to work with pointers and manage my own memory. And I'm better off for it.

  • @ghosthunter0950

    @ghosthunter0950

    Жыл бұрын

    I learned python then C and now C++. It genuinely feels so much better to deal with the memory directly and you can be really creative with it. You have to know what you're doing though.

  • @zonictrout

    @zonictrout

    Жыл бұрын

    @@ghosthunter0950 same, I really like C/C++, more than python, even though it is much easier

  • @WarpRulez

    @WarpRulez

    Ай бұрын

    It depends completely on what you are doing. If I'm writing a shell script, for example, I couldn't care one iota about memory management, and I'm completely fine with the shell script interpreter doing whatever it does, as long as it does it correctly. Manual memory management in this context wouldn't make an iota of sense.

  • @widepootis
    @widepootis7 ай бұрын

    C is love, C is life

  • @blackfrog1534
    @blackfrog15342 жыл бұрын

    c is such a wonderful simple language, if you're not new to programming, this video has everything you need to get you started in c. awesome job man! p.s. i watch these videos even if i don't care or already know the programming language/tool because they are quite fun to watch. awesome job man!

  • @cobaltno51

    @cobaltno51

    2 жыл бұрын

    but remember, simple != easy

  • @ishdx9374

    @ishdx9374

    2 жыл бұрын

    @@cobaltno51 neither C is really as simple, numerous UB's and quirks are there in the standard, they are there for a reason though, and you don't usually encounter them

  • @TheBeastDispenser
    @TheBeastDispenser2 жыл бұрын

    This was great! Could you also cover how to setup a build file? I always struggle with those for more complex projects that use more a couple of files.

  • @everTriumph

    @everTriumph

    8 ай бұрын

    Makefiles are a little like a backward chaining AI program.

  • @bettyswunghole3310
    @bettyswunghole33102 жыл бұрын

    I *still* get confused by const and const ...

  • @gwynbleidd8723
    @gwynbleidd87232 жыл бұрын

    I joined a programmation school since more than a month and worked 50h per week on C language, I am an absolute noob in programmation, it is an amazing experience and I am glad to see how much things I can do compared to the very beginning but jeez that's hard for me.

  • @kzm1934
    @kzm19342 жыл бұрын

    Anybody who wants to learn C should read the K&R book. It's brilliant and has everything you need.

  • @forouharp9683

    @forouharp9683

    2 жыл бұрын

    I kinda want to, but it's so old. I got Effective C which covers c17 and possible C2x.

  • @nivaldolemos5280

    @nivaldolemos5280

    2 жыл бұрын

    Please, don't recommnend it to beginners.

  • @barbyboi
    @barbyboi2 жыл бұрын

    "and i will c you in the next one" Why did i knew you were going to say that as soon as i clicked on the video xDD

  • @GhostOfTchernobyl6996
    @GhostOfTchernobyl69962 жыл бұрын

    1:28 printffff xD.Thanks for the quality content good like always

  • @Harthikreddyy
    @Harthikreddyy2 ай бұрын

    Wow this video compresses of everything I've learnt in the past 1 year

  • @lupuscanis4370
    @lupuscanis43702 жыл бұрын

    "C does not support OO" if you know how to use C you can make OO it is hacky but you can. There is a book, "Compiler design in C" that all their examples are written in C, and explains how the code is OO.

  • @donjonmaister

    @donjonmaister

    Жыл бұрын

    It certainly is possible. When I was in my data structures course, I was the only crazy person who did the assignments in C (linked lists, binary trees, dynamic queues and stacks, etc.) Objects are just structs with function pointers.

  • @MrjinZin0902

    @MrjinZin0902

    Жыл бұрын

    that's mimic. not support. It is possible to write C code in style of OOP. but that's not OOP. OOP is how you organize data and OOP languages provide syntax for that concept. but C don't provide that syntax. you have to make up oop structure from the scratch and then you have to stick to that style. you can't expect other programmer to stick to that style. if you need to work with other people then you need a lot of document. that's why we don't call C OOP language.

  • @thegrandmuftiofwakanda

    @thegrandmuftiofwakanda

    11 ай бұрын

    @@MrjinZin0902 OOP is a philosophy, not a language. Back to noob class with you.

  • @TheDerpiestSir
    @TheDerpiestSir2 жыл бұрын

    Gcc actually stands for gnu compiler collection, it can compile fortran, ada, obj C, go and more

  • @darkforst17

    @darkforst17

    2 жыл бұрын

    That's crazy my dude but who asked

  • @blahajenjoyr

    @blahajenjoyr

    2 жыл бұрын

    @@darkforst17 I did

  • @ForeverZer0
    @ForeverZer09 ай бұрын

    C will never die. Tons of "low-level" languages have come and gone over the years with the goal of being a C alternative, and most have faded into obscurity. The base libraries that pretty much everything is built atop relies on C in one way or another, and it is just too much to "rewrite it in Rust" or whatever other "hot" language is stylish to use that year.

  • @BibleClinger
    @BibleClinger Жыл бұрын

    I love C. Sometimes I think it just needs a simple push in the right direction to make it better as a language, but its fundamental essence is that of a language that is just so very simple, fast, and beautifully expressive. It's also incredibly dangerous. I still love it.

  • @MrChester114
    @MrChester1142 жыл бұрын

    I love that in C you have no classes. I think separating data from functions makes any program cleaner and easier to understand.

  • @fabricebalan

    @fabricebalan

    2 жыл бұрын

    You can implement OOP in C but you should not

  • @lucass8119

    @lucass8119

    2 жыл бұрын

    I agree for most cases, but I will say containers especially lend to object oriented programming very well. Having lists, vectors, trees, etc. with methods to act on their own data is intuitive and very concise. list.size() and vector.size() have completely different code, but they have the same name and represent the same thing - the size of a container. It really makes it simple to abstract and encapsulate complex data structures with complex memory allocation and traversal into objects as simple and easy to use as arrays. OOP also lends well to GUI parts of applications, as polymorphism and inheritance represent GUI components and widget hierarchies very well.

  • @MrChester114

    @MrChester114

    2 жыл бұрын

    ​@@lucass8119 I can agree about containers. I don't know about GUI programming since this is not my field. I guess the best approach is to use classes where they really fit and not everywhere. Having everything as class never works from my experience. Instead of focusing on the task that your program needs to do you focus on creating object hierarchies. So for example whether message should send itself or there should be a sender object that sends messages.

  • @lucass8119

    @lucass8119

    2 жыл бұрын

    @@MrChester114 I agree 100%. The "everything is a class" sort of idea that we see in Java and others is dumb and needlessly complicated. Most things don't need classes and objects, and you should only use OOP if it makes sense for that specific problem.

  • @sxs512

    @sxs512

    2 жыл бұрын

    And I think you've never tried writing anything longer than 100 lines of code. If you did you'd know that using objects and oop concepts like polymorphism and encapsulation is the way to go.

  • @IngwiePhoenix
    @IngwiePhoenix2 жыл бұрын

    Do Assembly next. Wanna see if you can contain it 100 seconds. Maybe stick to x86 ASM, but most ASMs are kinda similar.

  • @HichigoShirosaki1
    @HichigoShirosaki15 ай бұрын

    Here I was anxious about learning C in my future college courses after having done Java and Python, but if it's really that straightforward, then I am very much relieved.

  • @mushrafaltaf
    @mushrafaltaf2 жыл бұрын

    I enjoyed C so much. I recommend everyone to try C, you will just learn a whole lot about how computers work. Edit: You can C how the computer works, ta dum tiss.

  • @dulanchampa
    @dulanchampa2 жыл бұрын

    Oh god, the "printfff" killed me 🤣

  • @AGBuzz182
    @AGBuzz1822 жыл бұрын

    The video implies that the stack has to be managed manually, but this is not true. If you declare a variable int phone_number, the memory for it will be automatically deallocated when the function containing it returns. This does not require garbage collection.

  • @lucasvillani5484

    @lucasvillani5484

    2 жыл бұрын

    I was in doubt with that detail, thanks for explaining!

  • @bur1t0

    @bur1t0

    2 жыл бұрын

    It isn't deallocated. Such variables are created on the stack, when the function returns that variable is out of scope, but can still be accessed by evil people until something else overwrites it, assuming it wasn't optimized out of existence by the compiler. Accessing something deallocated would cause a segmentation fault on a modern OS, where as accessing an out of scope variable is just evil.

  • @AGBuzz182

    @AGBuzz182

    2 жыл бұрын

    @@bur1t0 Fair point, and this can be the source of very subtle bugs if you're careless! It isn't deallocated in the sense that it's no longer mapped to the program's address space, but as you point out, it is no longer reserved for the data it contains and can be overwritten by the runtime, meaning it should probably for all intents and purposes be treated as strictly deallocated regardless.

  • @ankurpanda9746
    @ankurpanda97465 ай бұрын

    Thanks man, I knew nothing about C and I have my Semester Ending Examination for C in 5 minutes time. I hope this will help me pass the exam.

  • @everTriumph
    @everTriumph8 ай бұрын

    People keep on mentioning OOP. Many languages 'support' Object Orientation. Emphasis on 'support'. If you have enough internal discipline, you can use the object abstraction in Assembler, C, Basic.... Adding the abstraction layers to a language may make it 'easier', but it does make for a very thick language spec, and book. The number and scope of interesting traps and errors also grow at the same time. A feature rich language may be an advantage. If you have an infinite time to learn it. Ada is a very rich language. To write mission critical 'real time' code you use a basic subset, same sort of feature set as a 'Small C'. The code generated can then be simple enough to hand inspect to establish function.

  • @crusaderanimation6967
    @crusaderanimation69672 жыл бұрын

    Languages with garbage colection: Don't worry about memory management, I got you covered and I will protect you. C (and c++) :You're on your own kid... Have fun.

  • @bigshrekhorner

    @bigshrekhorner

    2 жыл бұрын

    Honestly, managing memory yourself is kinda fun

  • @henrykkaufman1488
    @henrykkaufman1488 Жыл бұрын

    OO is just one way of creating layer of abstraction in your code. OO languages not only enforce one way of abstraction layering, but also the OO in most of the languages is 'underpowered' compared to the true OO concept as it was executed in SmallTalk. Not having obligatory OO in your code and having access to memory granted by language means you can create your own abstraction solutions, tailor fit to your particular needs. It also means that if you write C code, it can always do something useful for your program, there's no noise of boilerplate and excessive naming. When you're reading a program, would you rather have to read one file with 5000 lines, or need to understand relations between 100 files 50 lines each? When you're programming, do you just want results, or do you need control?

  • @ahmedace4911
    @ahmedace4911 Жыл бұрын

    Those majors that give you the room to create.... JUST BEAUTIFUL .

  • @gabrielborges7909
    @gabrielborges79092 жыл бұрын

    I love your pronunciation of the printf function.

  • @normie678
    @normie6782 жыл бұрын

    Literally the time I needed it. I just got a book on it too! Thank you

  • @FlorianEagox
    @FlorianEagox2 жыл бұрын

    When I saw the thumbnail I was actually taken-aback for a moment because most of your content is about new, modern stuff. I was like "What is this new-fangled C programming trend I'm missing out on!" And then I realized what you were actually talking about!

  • @debjyotibanerjee6382
    @debjyotibanerjee63822 жыл бұрын

    This video and the 'in 100 seconds' series is nothing short of magical...

  • @Agent839
    @Agent8392 жыл бұрын

    This was a really good video but just wanted to point out that 1:03 GCC actually stands for GNU Compiler Collection and not GNU C Compiler cuz it gives support to some other languages too but anyways this series is so good and this vid was the fine :)

Келесі