Linus Torvalds "Nothing better than C"

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • Creator of Linux Linus Torvalds explains why there is no language he knows of that's better than C for writing optimized code.
    runtimerec.com
    jobs.runtimere...
    #embeddedrecruiter

Комментарии • 2,5 тыс.

  • @gz6963
    @gz6963 3 года назад +7439

    Even Beethoven wrote his Symphony in C

    • @kattihatt
      @kattihatt 3 года назад +429

      I heard the bible was written in C, before it was compiled to english.

    • @ruxandy
      @ruxandy 3 года назад +131

      @@kattihatt You didn't really get the joke, did ya? :-)

    • @kattihatt
      @kattihatt 3 года назад +20

      @@ruxandy lol actually not. Atleast not completely.

    • @aleksybalazinski
      @aleksybalazinski 3 года назад +158

      @@kattihatt famous symphony no. 5 is written in *C* minor key

    • @kelvinxg6754
      @kelvinxg6754 3 года назад +17

      lmao good joke

  • @mayankmathur3257
    @mayankmathur3257 4 года назад +7147

    I got a C in math,and thats something my parents care about

    • @juanok2775
      @juanok2775 4 года назад +35

      Lol

    • @b213videoz
      @b213videoz 4 года назад +328

      You should've got C++ and your parents would have been happier

    • @juanok2775
      @juanok2775 4 года назад +17

      @@b213videoz doubt it, cpp is for the proctologist

    • @yuntaozhang666
      @yuntaozhang666 4 года назад +4

      You are so funny

    • @satmastersatmaster4066
      @satmastersatmaster4066 4 года назад +5

      Congrad! you got good responsible parents

  • @dmn3floyd659
    @dmn3floyd659 4 года назад +3206

    My embedded systems professor once said, " I know assembly better than English".

    • @grandmastergyorogyoro532
      @grandmastergyorogyoro532 4 года назад +136

      Pls say hello to your professor for me.

    • @peesicle
      @peesicle 4 года назад +44

      My grandma is lit

    • @joel230182
      @joel230182 4 года назад +43

      allow me to doubt it

    • @Gooberpatrol66
      @Gooberpatrol66 4 года назад +106

      Was English his native language?

    • @BuzzKirill3D
      @BuzzKirill3D 4 года назад +5

      Your embedded systems professor... if you don't mind my asking, what do you major in and what university?

  • @DaSnipy
    @DaSnipy 5 лет назад +5120

    When I read C code, I know what Assembly language will look like and thats something that I care about ... LEGENDARY !

    • @aziz9488
      @aziz9488 5 лет назад +97

      Wait you don't ?

    • @slackerengi2401
      @slackerengi2401 4 года назад +207

      Brian Kernighan really knew what he was doing
      Unix and C despite trying to be replaced multiple times since their invention are still the gold standerd

    • @iskomaxmin
      @iskomaxmin 4 года назад +28

      me : What the hell is Assembly Language!!! 😆😆😆

    • @NiekNooijens
      @NiekNooijens 4 года назад +123

      oh i also know in c++ how the assembly looks like, but to be honest, you want to stay away from there! for example: 2 classes with inheritance will basically create tables of function pointers and based on which constructor function is called this "virtual method table" or VMT will be filled with different jumps to different places of or code... and i'm not even speaking about the memory layout....

    • @TheEVEInspiration
      @TheEVEInspiration 4 года назад +80

      ​@@NiekNooijens You can know it for even higher level languages than C++, in the end its having the understanding of how things really work that is important, no matter where you code in. Its good if you think of the costs when opting to use virtual functions and then reason about it if its really needed or acceptable to pay the cost.
      The problem with C++ and OO languages however is that as the abstractions accumulate, poor choices get cemented in and become the foundation for a new round of code. Choices once made, are hard to revert as everything is knotted together. Sure the code is abstracted, but that hardly matters as everything is still tied on the interface and architectural level.
      Its a code oriented approach and that is why OO is a scam and a dead-end approach to software development.
      Programming is about data, not code, so unless job security is the primary goal, stay away from OO or use it in only limited fashion as a tool to organize large domain blocks.

  • @lorenzrosenthal119
    @lorenzrosenthal119 2 года назад +714

    Programming in C in my university courses was like driving a fast car with no airbag on the high way. It felt dangerous, fast and fun!

    • @runtimeshorts9577
      @runtimeshorts9577 2 года назад +9

      Love the analogy Lorenz

    • @fabio.1
      @fabio.1 Год назад +1

      😊

    • @michal3141
      @michal3141 Год назад +11

      C was maybe fun in 70's These days C sucks compared to majority of programming languages. Maybe not compared to Java because Java sucks even more.

    • @michal3141
      @michal3141 Год назад +3

      @AL Don't get me wrong. C is a great language for doing low-level stuff and when performance really matters. Still my experience with C is that it is not exactly fun. For fun and 95% of applications I would rather go with Python than C.

    • @studybuddy7060
      @studybuddy7060 Год назад +19

      C is a skill rather than just another programming language at this point. C doesn't need to prove its worth any more.

  • @rodholseth6354
    @rodholseth6354 3 года назад +1483

    C was the first language I mastered, and it made it very easy to jump to Java, C++, C# and even x86. Even with no object orientation, it helps build a strong foundation.

    • @oODomeeOo
      @oODomeeOo 3 года назад +82

      I learned C very early with microcontrollers. Additionally learned C++ which was an easy transition. Though learning to program object oriented when you were programming procedural for years was hard. But going to high level languages like C# or Java is a pain. I have real trust issues to shift my freedom of memory access towards the interpreter. Also to have just a library for everything and just use them is hard, when I don't know whats happening in the background. I just feel disconnected from the computer. So I try to stay away from those and keep programming near the hardware. :)

    • @letsthink8245
      @letsthink8245 3 года назад +2

      @@oODomeeOo What kind of projects do you do recently or currently

    • @tismanasou
      @tismanasou 3 года назад +42

      u better leave C and start writing full assembly. I love writing 1000 lines of code so as to program a simple for loop

    • @rodholseth6354
      @rodholseth6354 3 года назад +19

      ​@@tismanasou Assembly is very good to know as it teaches about the machine. But I wouldn't say it's very useful in this day and age. But each to his own.

    • @tismanasou
      @tismanasou 3 года назад +26

      @@rodholseth6354 No dude, assembly all the way, I sometimes write in 8085 instruction set for that extra vintage vibe

  • @DJ_Force
    @DJ_Force 3 года назад +1582

    I love C. I used to write C. I would give almost anything to find another C coding job. Seems like no one writes code anymore, they just glue together frameworks.

    • @alefratat4018
      @alefratat4018 3 года назад +387

      Yeah, so true.
      SW in 2020: we need to implement one function that could be done in 50 lines of C but instead let's use some gigantic frameworks with a ton of dependencies and then hide the mess into a trendy container for deployment.

    • @mmaranta785
      @mmaranta785 3 года назад +106

      You can in the embedded world

    • @DJ_Force
      @DJ_Force 3 года назад +217

      @@mmaranta785 True, but embedded systems jobs seem few and far between. Seems like 99% of developers are connecting databases to browsers.

    • @melvinthomas8527
      @melvinthomas8527 2 года назад +44

      Some of us still do embedded. Sometimes I do miss features of modern languages; only thing in C is that you have to be mindful of the issues you can cause. Rust is a great iteration for a system language you get documentation, unit-testing, direct memory access.

    • @DJ_Force
      @DJ_Force 2 года назад +20

      @@melvinthomas8527 I did a bit of C++, and I did missed reflection. However, when I went back to C#, I missed a lot more.

  • @shinej11
    @shinej11 4 года назад +543

    You don't have to use, 'nothing better than C' click bait. Just use Linus Torvalds anywhere in the title and you'll be fine.

    • @fredflintstone8048
      @fredflintstone8048 2 года назад +4

      Yes, and he's saying it's the lang he prefers for doing the type of work he enjoys doing. It's not the best language for everything.

    • @shinej11
      @shinej11 2 года назад +8

      @@fredflintstone8048 that's what a click bait is. The title says something else than what the actual message in the video is

    • @fredflintstone8048
      @fredflintstone8048 2 года назад

      @@shinej11 Yes, I do know what click bait is. I'm not sure why you would assume that I don't.

    • @shinej11
      @shinej11 2 года назад +2

      @@fredflintstone8048 oh of course you know, I can C that

    • @saudude2174
      @saudude2174 2 года назад +3

      @@fredflintstone8048 it's not just the language he prefers for writing OS. It is objectively the right tool for this type of work.
      The whole rant teenagers tend to have around here about which language is the best is just silly. Everyone who actually works in this industry knows you always pick the right tool for the job.
      In the end, it doesn't matter what language you're using, if you're a crappy programmer, you'll make a mess of nearly everything.

  • @ronfarmery
    @ronfarmery 2 года назад +392

    Wrote my first C program in 1978. It was written on a Datapoint computer using an unofficial C compiler written by Mike Green who used to work at Datapoint. When the IBM PC came to life, I wrote many communications program in C (using the Lattice C compiler). Wonderful language (and I’ve learnt over 30 languages since I started in ICT in 1967).

    • @ko-Daegu
      @ko-Daegu 2 года назад +32

      You have been coding more than I have been alive insane
      But today with C I can’t find any job I got no chance against giants who have been writing for decades
      So I gotta go with python or JS 😢

    • @ricknash3055
      @ricknash3055 2 года назад +12

      Kernighan and Ritchie's definitive 'The C Programming Language' 1st edition was published in 1978. You must have been programming in C as it was borne?

    • @ronfarmery
      @ronfarmery 2 года назад +24

      @@ricknash3055 Yes. C was created in the early seventies; the book was the "official" bible on how to write programs in C. I bought it immediately. I was lucky enough to be given a beta of a C compiler written by a person (Mike G.) who worked for a computer manufacturer located in Texas (this was a personal work by Mike, it was never released). I started playing around with it and immediately liked this language. I already had experience with more than half a dozen other languages but nothing was even close to what I imagined I could do with C. In the end, it became my main language to write hundreds and hundreds of programs, from applications to utilities. I even wrote complete data communications programs like emulators and comms servers in C. I could not have done this without C and the various compilers created by some very good companies and persons.

    • @goedeck1
      @goedeck1 2 года назад +3

      Sir, I read K and R but had the question how to provoke EOF in say putchar getchar programs? You can't type eof because getchar will see it as ' e'. I thought of prompting the user to type a selected char that then you define as -1, then ask the user whether they want to end the string or use the char.

    • @ronfarmery
      @ronfarmery 2 года назад +10

      @@goedeck1 Run a simple test loop...
      #include
      int main (void)
      {
      int c;
      do { c = getchar(); } while (c != EOF);
      printf ("
      End
      ");
      }
      The compile and run it. Type some characters, then do Ctrl+D. See the result. Run again, type some characters, then do Ctrl+Z. So, no need to checking for characters but note the difference between Ctrl+D (program continues to run and prints the end message) and Ctrl+Z.

  • @mazinmustafa9869
    @mazinmustafa9869 2 года назад +241

    C language is simple, clean, efficient, fast, and just flexible enough to express any idea you have in mind. That is the beauty of C.

    • @DavidsKanal
      @DavidsKanal 2 года назад +1

      @@Wariowa345 Literally thought the same lmao, W

    • @aeebeecee3737
      @aeebeecee3737 Год назад +1

      yes, agree

    • @upendownlinker
      @upendownlinker Год назад +30

      No its not, it doesn't even a build in ability to make high order routines or data structures. You need to hack around with macros or go trough the burden of implementing your own generic types, all of which just leads to you making your own esoteric programming language on top of c, wasting time that would have spend better programming in a language that has those features build in aka c++.

    • @MundodasGuitarras
      @MundodasGuitarras Год назад +20

      C is not simple, is definitely not clean, it's not efficient cuz it takes dozens of line for something that could be done in half with languages and it takes much longer because of debugging

    • @bluesteel1
      @bluesteel1 Год назад +12

      Everything is fine till there's a segfault or memory leak in an enterprise codebase

  • @JagjotSingh
    @JagjotSingh 4 года назад +2236

    The title does not justify what he said. He’s talking in terms of hardware and low level programming.

    • @bai7uo
      @bai7uo 4 года назад +214

      Ever heard of a term "clickbait"?

    • @ShaferHart
      @ShaferHart 4 года назад +9

      Yeah but it's always good to hear from the man

    • @vitaliykondrenko742
      @vitaliykondrenko742 4 года назад +25

      tbh, it's clearly told in Torvalds biography... The man working only with kernel that literally interact with hardware (at least with Linux, but probably in Git either)

    • @orangeshoes
      @orangeshoes 4 года назад

      @@ShaferHart true

    • @isimvol
      @isimvol 4 года назад +2

      We clicked though

  • @davidjohnston4240
    @davidjohnston4240 3 года назад +892

    After 40 years of programming, I can confirm that he is correct.

    • @johnc3403
      @johnc3403 2 года назад +7

      Well said.

    • @aadarshkumarshah8795
      @aadarshkumarshah8795 2 года назад +40

      @@johnc3403 hi C

    • @369seeker9
      @369seeker9 2 года назад +10

      would you say Rust is becoming a contender to C now? Perhaps not designing operating systems but you can at least write performative hardware apps.

    • @vladlu6362
      @vladlu6362 2 года назад +18

      @@369seeker9 There is a whole OS written in rust though, very performance as well, although very limited

    • @borise4104
      @borise4104 2 года назад

      Did you saw Zig programming language?

  • @tobiasdg3yev161
    @tobiasdg3yev161 3 года назад +231

    When I was younger (in the early 90s) and wanted to start coding on my 386, I asked my father who at this point has been in software development for over 30 years (IBM 1401,360/370): "Dad, what language should I start with?" He told me: "Start with assembler to understand how the machine really works. After that, you can continue with C/C++ or whatever you prefer." I followed this advice and ended up as embedded system dev, working on ARM Cortex currently. And I'm still using C/C++ and asm for some DSP routines.

    • @lanceharvie
      @lanceharvie 3 года назад +8

      Having written assembler and being and embedded engineer you deeply know the sentiment of what is being said here.

    • @warrenbuckley3267
      @warrenbuckley3267 3 года назад +5

      Have you had a chance to dabble in any Rust?

    • @nesa6582
      @nesa6582 2 года назад

      You are self thought?

    • @satoshinakamoto7253
      @satoshinakamoto7253 2 года назад +8

      @@nesa6582 many great programmers are self taught and math / physics majors

    • @GospodinLLIoTaKe
      @GospodinLLIoTaKe 2 года назад

      @@satoshinakamoto7253 I'm self taught but my dad isn't a programmer, because of this I started my programmer's path as webdev at 19yo

  • @efa666
    @efa666 4 года назад +803

    C is for cookie, that's good enough for me.

    • @Deschutron
      @Deschutron 4 года назад +32

      As far as I'm concerned, you've won this comment section.

    • @MarkRose1337
      @MarkRose1337 4 года назад +12

      Oh cookie cookie cookie starts with C

    • @BigSavageG
      @BigSavageG 4 года назад +3

      C stands for Cuchi

    • @bobamazon2094
      @bobamazon2094 4 года назад +1

      But is it soootable?

    • @efa666
      @efa666 4 года назад +2

      @@nu11ptr increment the cookies

  • @jklax
    @jklax 4 года назад +514

    I learned C\C++ before anything else. Was a good starting point for me and springboard.

    • @norpriest521
      @norpriest521 4 года назад +7

      What are the references
      C vs C++ vs C# ?

    • @Mauro0
      @Mauro0 4 года назад +68

      @@norpriest521 c : low level language, close to hardware, great for memory management, OS, hardware.
      C++: medium level language, takes some C features, but it's object oriented.
      C sharp(#) : high level language, object oriented like Java. They dont compile into machine code.

    • @-_--ex5lt
      @-_--ex5lt 4 года назад +82

      @@norpriest521 He said enough but for learning C# you need to sell your soul to Microsoft.

    • @mycrushisachicken
      @mycrushisachicken 4 года назад +89

      MR MEME "assembly is low level language? please tell me you're joking, binary is low level, assembly is middle level, but assembly is lower level than C, both C and C++ are high level, C# is ultra high lvl" kappa

    • @mikhail5002
      @mikhail5002 4 года назад +6

      hahaha these comments are awsome

  • @user-lv6qm3fj2z
    @user-lv6qm3fj2z 3 года назад +112

    He's so right. Nowadays people tend to just completely ignore of how optimized and efficient the code is, despite the fact that the speed increase of modern computers is decreasing with each generation. People write unoptimized code and think it's okay. In 90-s we thought with the computers getting faster and faster we will get applications that will do stuff for us so much faster and instead we get a bunch of unoptimized code that barely matches the speed of applications of 90-s...

    • @billatkin3956
      @billatkin3956 3 года назад +3

      That's so true! Sometimes, when my computer is taking an age to complete an operation, I'm thinking 'Why the hell is it taking so long? What on earth is it doing to take so long?'

    • @64BitLamp
      @64BitLamp 2 года назад +25

      It's optimized because its borderline machine code. The more low level your code gets, then technically yes it is more optimized. I've been down the path of writing everything by hand with no libraries or dependencies (HTTP servers, database pools, auth API's) and I can tell you for a fact that you are creating nothing but problems later down the road. Enterprise doesn't always care about speed when it comes down to nanoseconds. It often cares if you can easily move your codebase to a new platform and if others can pick it up quickly.
      I'm not trying to dawg on C. I love C. I'm just saying it has its use cases (aka stuff really close to the hardware level). I don't need to access the A register from my API. Another thing to point out is C is processor specific, so it can be a nightmare trying to build separate environments. On the other hand I know that the JVM will run on almost anything without a fuss.

    • @user-lv6qm3fj2z
      @user-lv6qm3fj2z 2 года назад +9

      @@64BitLamp Bro, you just wrote a wall of text that can be summarized to "I don't care about the speed of my application as long as it just works somehow". No offense, but it's a deadend that sooner or later will cost us dearly.

    • @64BitLamp
      @64BitLamp 2 года назад +23

      @@user-lv6qm3fj2z I never said you shouldn't try to optimize your code, I'm just stating that sometimes other things can take precedence. Are you telling me you find big O notation of every algorithm you've ever written in your life (I hope not). It's simply about weighing the time required vs the amount gained aka opportunity cost.

    • @user-lv6qm3fj2z
      @user-lv6qm3fj2z 2 года назад +11

      @@64BitLamp of course I didn't - I'm a programmer, who being paid for results just like you, but that's the problem. We aren't given a proper time to optimize - and this leads the whole industry down the drain.

  • @rabbitcreative
    @rabbitcreative 4 года назад +38

    Enjoyed the timing. Ending on, "and that's something I care about." -- powerful way to state preference rather than talk about something as if what is being said is absolute fact.

    • @richardpalme5b
      @richardpalme5b 4 года назад

      @Dirk Knight 1. The Linux kernel is fast though 2. Just use a lightweight distro, e.g. Lubuntu.

  • @axolet
    @axolet 3 года назад +424

    "Nothing better than C"
    *TempleOS and HolyC enters the battlefield*

    • @mujtabahussain7015
      @mujtabahussain7015 3 года назад +23

      that's only for true god worshipers, normal people won't understand that.

    • @equinox2584
      @equinox2584 3 года назад +15

      Holy C is the only language what are you talking about sir?

    • @dmitryhetman1509
      @dmitryhetman1509 3 года назад +14

      But holy C if only for whitest of the white christians

    • @qvindicator
      @qvindicator 3 года назад +28

      Holy C was created with divine intellect, which is a component Linus Torvalds lacks. This is due to the fact that Linus failed to write his own compiler that compiles just in time and ahead of time, and instead resorted to porting GCC. Linus wouldn’t understand

    • @newfaith912
      @newfaith912 3 года назад +9

      man those glowing things got him :(

  • @LouisChiaki
    @LouisChiaki 3 года назад +315

    I learn C as my first programming language. It is very clean, clear, and simple!

    • @sollyprogrammer3750
      @sollyprogrammer3750 3 года назад +20

      I fall in love with C

    • @lenonkitchens7727
      @lenonkitchens7727 3 года назад +45

      @@n4rfy477 C *is* simple. I've been writing it for 27 years, and it's always been simple. Bad code is what's not simple, and you can get that in any language, though admittedly, it's probably easier to write bad code in C.

    • @omshree901
      @omshree901 3 года назад +14

      coding in C is actually easy.... but developing or deploying data structures in C.... something I don't wish to do.

    • @salmarwow
      @salmarwow 3 года назад +28

      @@omshree901 making a hundred bugs in 10 lines of C code is easy, yes.

    • @danielbonheur5441
      @danielbonheur5441 3 года назад +5

      I agree with you - it gives you a deliberately minimal set of tools, so that when reading and writing C programs you know exactly what is going on.

  • @NickVoid
    @NickVoid 5 лет назад +958

    Misleading "Yellow paper" style name of video. :)
    Linus didn't say "Nothing better than C". You cut this out of context. Talk was about specific task like "OS development" and choosing good tool for this task. Good quote: "If you think like a computer writing C actualy make sense". :)

    • @user-tn3fo3pj2x
      @user-tn3fo3pj2x 5 лет назад +10

      yeah and nowadays thinking like a computer becomes obsolete as the likes of agile programming, scrum, etc time to market is the most important, that is why python, to the pragmatist, wins!

    • @patham9
      @patham9 4 года назад +66

      ​@@user-tn3fo3pj2x Obsolete for user programs only, not for operating systems and not for the dozens of chips inside your PC and inside your car.

    • @emotionaware4192
      @emotionaware4192 4 года назад +10

      "...think like a computer..."
      I knew linus was a robot

    • @TheEVEInspiration
      @TheEVEInspiration 4 года назад +17

      @@user-tn3fo3pj2x I think the only reasons python ever got traction, despite it objectively awfulness and unsuitability, is that it got adopted by non-programmers in the field of Machine Learning and that it functioned as the perfect artificial reason to do 100% unit test coverage (as the language is that fragile). A tech trend mixed with a religion, those are powerful forces, it has nothing to do with pragmatism. And you would not claim it as a reason if you knew other languages that are far more pragmatic, without the fragility.
      I think it so bad, that I rather have no work than code in Python.
      There is only one language I know that is still clearly worse and that is Perl.

    • @chadiusmaximus9350
      @chadiusmaximus9350 4 года назад +6

      @@TheEVEInspiration Python was popular way before ML came around. Its a 90s language.

  • @jeancorriveau8686
    @jeancorriveau8686 4 года назад +154

    In the past 45 years, C has been the choice for development of operating systems. C allows for a bridge between hardware and software which is a role of an OS.

    • @philsburydoboy
      @philsburydoboy 4 года назад +21

      Really it is the choice for all things that exist outside of popular architectural paradigms.
      AI, games, realtime analysis software, etc. are also typically all written in C because OOP does not play nicely with lots of threads, data, or time.
      Military software is also written in C because it is easier to guarantee. The F-35 software is a 10-20 million line C project (with some C++).

    • @CTimmerman
      @CTimmerman 3 года назад +6

      ​@Sirin Kalapatuksice Rude. Build engine (Duke Nukem 3D, Shadow Warrior, Blood, Redneck Rampage), id Tech 1-3 (Doom, Doom II, Heretic, Hexen, Strife, Chex Quest, Quake 1-3, Quake Live), and Jedi (Star Wars: Dark Forces, Outlaws) are written in C.
      GoldSrc (Half-Life, Team Fortress Classic, Half-Life: Opposing Force, Counter-Strike, Ricochet, Deathmatch Classic, Half-Life: Blue Shift, Half-Life: Decay, Day of Defeat, Counter-Strike: Condition Zero, Counter-Strike Neo, Counter-Strike Online) was written C, C++, and Assembly.

    • @StradexEngine
      @StradexEngine 3 года назад +3

      ​@Sirin Kalapatuksice Imagine thinking Quake 3 it's shit lol. You are just delusional, go home kid.

    • @n3on440
      @n3on440 3 года назад +8

      @@StradexEngine ignore him, he is a typical troll

    • @rasitsimsek9400
      @rasitsimsek9400 3 года назад +4

      There is no reason today write everything for OS in C. There is a historical reason only.

  • @elietheprof5678
    @elietheprof5678 2 года назад +17

    People get a bad impression of C because of boilerplate code.
    For a long time I never got into game programming because of how many lines of code it took just to create an OpenGL window and render a basic "hello world" triangle on the screen. But once I abstracted it all away into a nice header, now programming in C became fun again.

  • @helloitismetomato
    @helloitismetomato 3 года назад +14

    Videos like this really should have the date in the title/description, or at the very least the year

  • @Quemedices684
    @Quemedices684 10 месяцев назад +4

    He is talking about writing code for operating systems, where C shines by itself. At other areas OO languages helps to organice the code, although starting with C++ is a kind of nightmare

  • @kokomong9254
    @kokomong9254 4 года назад +487

    in this , important thing is "for developing os"

    • @godwarrin
      @godwarrin 4 года назад +4

      But what if I used c to develop a website or a Windows app is there any advantages or disadvantages?

    • @tetst_54546
      @tetst_54546 4 года назад +66

      @@godwarrin There are. For example, apps written in C can crash really easily. You need to handle all the possible situations by hand, or use many libraries and learn them. Also you need to manually manage the memory use, which can cause nasty memory leaks and make your app crash again (or worse). On the other hand, languages like Java or C# have been designed to prevent mentioned problems (as possible), but of course you pay for it with lower performance, at least in some cases. However, most of the time it is much better to use high level language (Java / C#) and if there are any parts that need to run very fast simply write them in C. Such approach can speed up the development a lot and deliver application of higher quality.

    • @sakethravuri3023
      @sakethravuri3023 4 года назад +3

      @@tetst_54546 🤓

    • @stackerliew
      @stackerliew 4 года назад +8

      @@tetst_54546 But not for Linus Torvalds, for him, he can do anything with C, and the some more is rock solid stable.

    • @tetst_54546
      @tetst_54546 4 года назад +17

      @@stackerliew True. However, if we relied only on Linus, we probably wouldn't have so many applications.. :D So yeah, we need tools for less skilled developers too. But Linus is a great inspiration for me, and I have been Linux user for more than 12 years now! ;-)

  •  2 года назад +17

    Love this! It's so true! C is an amazing language and Torvalds remark, being able to visualize its outcome resonates with me. We did C (no + or visual or anything then) just simple C programing for composer input languages for music composition at the Center for Contemporary Music (CCM) at Mills College back in 1983/84 in Oakland, CA. Those were amazing times and great memories.

  • @karthikk2719
    @karthikk2719 3 года назад +161

    He is like Neo from Matrix. He can see through high level programming language and deduce low level code.

    • @georgplaz
      @georgplaz 3 года назад +14

      C is NOT a high level programming language 🙄

    • @vijaykryesItsMe
      @vijaykryesItsMe 3 года назад +47

      Depends on the context.C is high level compared to Assembly

    • @Kevin-jc1fx
      @Kevin-jc1fx 3 года назад +2

      He is a human compiler or interpreter.

    • @The13point1
      @The13point1 3 года назад +24

      He can C through high level programming

    • @karthikk2719
      @karthikk2719 3 года назад +7

      @@georgplaz Yes I agree, its definitely not as high level as Python, but from the perspective of executable binaries and OP codes and assembly languages, C is relatively high level and human readable :D. Come on man, I am just kidding around. Cheers!

  • @directx872
    @directx872 Год назад +4

    Yes until the compiler starts using architecture specific instrisics and vendor specific instruction sets. The you no longer can tell anything

  • @heinzk023
    @heinzk023 Год назад +6

    I learned object orientation with a C (!) program. This program had structs containing pointers to arrays of function pointers all over the place and it took me a while to figure out what it was good for. After getting in contact with C++, I suddenly realized that what I saw back then was nothing than virtual functions and inheritance!

  • @mattgrice7228
    @mattgrice7228 4 года назад +128

    Aw shit, the entire Rust community is on suicide watch

    • @proloycodes
      @proloycodes 3 года назад +1

      well no i prefer Rust more than C, altho i respect a guy as great as Linus Torvalds
      edit: spelling

    • @KidB.
      @KidB. 3 года назад +30

      Rust in Linux kernel is a serious possibility today and even Linus is open to that.

    • @astrolillo
      @astrolillo 2 года назад

      Good!

    • @astrolillo
      @astrolillo 2 года назад +4

      ​@@KidB. if by today, you mean "in 20 years at the very least" and if by serious you mean " as long as Rust is the new cool thing if another 'cooler' language does not comes up"

    • @HaveAGoodHeart
      @HaveAGoodHeart 2 года назад

      @@KidB. Tks for telling us. do you have any ref to this?

  •  2 года назад +21

    Pure gold! I always loved C, but never really knew why. His words made me understand something I have subconsciously felt all that time. When you write C code you KNOW exactly what the computer will do. When you write code in some fancy new language, using annotations and stuff, you HOPE that it will do what you think it will. It's a difference between knowledge and faith. And I prefer the former.

    •  2 года назад +1

      I'm sure you do. But I feel much more comfortable when I know exactly how the program manages memory or when it allocates and releases various resources. I'm not saying C is the only language that can do that, but it's my all-time favourite.

  • @cesardmora86
    @cesardmora86 2 года назад +6

    "when I read C, I actually see all those green words of the matrix"
    Linus Torvalds

  • @wysoft
    @wysoft 2 года назад +11

    Never learned C, only ever learned BASIC before deciding that programming wasn't really my main interest. Still, I don't have much trouble reading C and getting a basic understanding of what the code is doing. It's almost unavoidable that you will have to look at some C code and build processes while dealing with Unix systems for 20+ years. I would have absolutely zero idea what a block of FORTRAN or COBOL code is doing, and no hope with assembly or machine code. The fact that someone proficient in C can do almost anything with it, and a layman can still look at a block of code and decipher a good deal of it - that's a great language. Maybe someday I'll get off my ass and learn it when I have nothing else to do.

    • @Flamechr
      @Flamechr Год назад

      Depends who wrote the code 😂

  • @jimreynolds2399
    @jimreynolds2399 4 года назад +2

    I agree with him 100%. Many programmers don't know the link between source code and what that looks like when it's compiled and then when it's assembled. Many programmers don't need to care about that level of detail because they're programming in Java or interpreted languages and in fact many programmers don't have the knowledge or skills to understand machine-level programming. They don't know about instruction-sets or memory management. Web Services is so abstracted from hardware that it's just not necessary to understand anything about hardware interaction. It doesn't mean you're programming is inferior if you're not on the hardware.

  • @TheOneAndOnlyNeuromod
    @TheOneAndOnlyNeuromod 3 года назад +14

    The funny thing is - if you've ever started from the ground up - trying to build your own disassembler or assembler/compiler - or building kernel primitives in your own OS - you end up converging upon the same constructs formed in C anyway. LOL
    The language is just elegant and efficient.

  • @storerestore
    @storerestore 10 месяцев назад +9

    Having written about 12000 lines of Zig over the past year, I think it's a strong contender that maintains these aspects of C and in a lot of ways surpass them, removing many of the footguns of C without the complex macro system and memory management paradigm of Rust.

  • @kjetilhvalstrand1009
    @kjetilhvalstrand1009 4 года назад +19

    The problem with C++ is hidden allocations, the things you don't see, it’s the tendency to write complicated code for simple tasks. on the other hand, C++ is good for complicated code. Its about finding the balance.
    A C++ string is abstraction of methods, data, memory management, a array of char, is
    just a array of bytes.

    • @jjl772
      @jjl772 4 года назад +8

      That's only really true if you use the STL though. You can choose to write C++ in the style that I call "C with classes", where you only use built-in language features like classes, namespaces, lambdas, templates, etc. and avoid using the STL wherever possible. I agree that you can accidentally write over-complicated code with C++, but I think a big part of writing good code is the mindset going into it. If you're writing a really simple application, you need to go in with the "C programmer's" mindset, meaning you utilize more basic language constructs instead of shoehorning classes, lambdas or templates into the program.

    • @kjetilhvalstrand1009
      @kjetilhvalstrand1009 4 года назад +1

      @@jjl772 I don’t think templates are bad, after all a template is way to make new classes by inserting stuff into it, I’m sure the code becomes bloated, (size of the code), I don’t think it impact speed. Names spaces, just a quick way to rename a bunch function variable, there nothing really wrong with it. Lambdas can be bad I have not looked into this, any function you create will always produce some overhead, but then again it becomes a question is your code readable, or is it not, if doing lot of copy & paste coding, you probably should be using a function or methods, or function pointer or whatever, it all depends. It’s not that lots of code is bad, or little code is good, its just that lots of the same, often result in some of code not being fixed or updated, and so it results in bugs. An example of more code being better is when you unroll loops, remember its not the number of lines on the screen that makes a difference, it’s what being executed that does..

    • @jjl772
      @jjl772 4 года назад

      @@kjetilhvalstrand1009 Of course, I'm not saying templates are bad at all. I personally use templates in many of my projects, as they're useful there. In more simplistic applications I avoid templates and lambdas, because I don't really need to use them to parse command line arguments, for example. As for performance, templates, classes and namespaces don't impact it at all really, unless you're using virtual methods inside of a class.
      My previous reply was really just addressing complexity from the programmer's point of view. All these high level language constructs can damage readability if overused or used improperly, and I've personally seen a lot of code that really overuses this type of stuff.

    • @kjetilhvalstrand1009
      @kjetilhvalstrand1009 4 года назад +1

      @@jjl772 I compared the string vs chars[], but there also things like initializers in classes, while C use
      bzero( &var, sizeof(struct hello) ), in initializer in classes you often start setting individual public and private data to 0, instead of using optimized routine to clear everything.
      So again, coding style produces worse code. You start think about what is inside the box, instead of think about the box. And some times you forget you are dealing with box lots stuff, because all looks like a simple type.

    • @jjl772
      @jjl772 4 года назад +1

      @@kjetilhvalstrand1009 std::string in C++ is known for being slower than C strings usually. The only good thing about it is that it stores the length, so you dont need to call strlen all the time. Other than that, std::string has a lot of overhead in the constructor, copying of data, and other cruft that's inside of its member functions. I never said that I used std::string too, I said that I *avoided* using std::string in favor of normal char arrays.

  • @jerrygreenest
    @jerrygreenest 4 года назад +64

    1:12 "when you... I mean, when compilers", ha ha. People, compilers, whatever...

    • @empty3061
      @empty3061 4 года назад +14

      back in the days, there were people who actually did the work compilers do now...

    • @blackcitadel37
      @blackcitadel37 3 года назад +1

      people are food compilers.

    • @jerrygreenest
      @jerrygreenest 3 года назад +2

      @@blackcitadel37, we compile food into code? Pls don’t just tell me my code is shit

    • @georgplaz
      @georgplaz 3 года назад

      @@jerrygreenest actually, in german, another word for shit is "Kot". which is pronounced almost exactly like "code". So reading your comment aloud is.. confusing, while making a lot of sense..

  • @ulysses_grant
    @ulysses_grant 5 месяцев назад

    Thank you, Linus. Unemployed senior C developer for almost a year now here. Your talk makes it easier to move forward.

  • @wolf_code
    @wolf_code 2 года назад +3

    As a Denis Ritchie said: C will be the language that will be very hard to replace in low level programming

    • @lanceharvie6933
      @lanceharvie6933 2 года назад +3

      I don't see anything remotely close to C except machine assisted coding but that itself will spit out C code

    • @wolf_code
      @wolf_code 2 года назад +3

      @@lanceharvie6933 exactly, thx for fix)

  • @NytronX
    @NytronX 4 года назад +54

    ELI5 version: When linus looks at a computer screen, he sees it in The Matrix esque green scrolling characters.

  • @pdjinne65
    @pdjinne65 2 года назад +20

    C is the closest language to assembly, other than assembly itself. C++ became a lot more abstract and conceptual, most of the time it's up to the compiler to optimize and make your stuff faster, but in C it's up to you.

    • @ChristopherGray00
      @ChristopherGray00 Год назад +11

      there is nothing inherently more low level about C than there is with rust or C++, the latter two languages just provide the option for higher level abstractions and more library functions, whereas with C, you pretty much have to write low level code unless you import an external library.

    • @FaustoSaporito
      @FaustoSaporito Год назад +3

      C is defined as a portable assembler :)

    • @obiwankenobe3962
      @obiwankenobe3962 9 месяцев назад +1

      @@FaustoSaporito Exactly right! I was looking for that comment, if missing, I was going to add it myself :)

    • @FaustoSaporito
      @FaustoSaporito 9 месяцев назад

      @@obiwankenobe3962 but really I regret there is no PL/M for the latest Intel processors :) C is quite close, but features like write everywhere in memory or goto everywhere in memory, access the flags, without using assembler, of course. But my way to work with C is very peculiar. :)

  • @harrytjokroaminoto9212
    @harrytjokroaminoto9212 3 года назад +28

    why linus asking himself?

  • @insoft_uk
    @insoft_uk 3 года назад +7

    One of my favourite languages the other is assembly.
    Totally understand his response when it comes to working with hardware you need a language that works at a medium or low level

    • @sakon4466
      @sakon4466 3 года назад +1

      there was a time C was called a high level language

    • @marcb907
      @marcb907 3 года назад +3

      @@sakon4466 C is high level language, it sits on top of ASM.

    • @sur4y
      @sur4y 3 года назад +4

      @@marcb907 so you're one of those people who like to think that binary is low level, assembly is mid level and C is high level, right? then wtf is C#? ultra high? what about python?

    • @carldrogo9492
      @carldrogo9492 Год назад +3

      @@sur4yC, is a high level language. Any language that is NOT Assembly is high level. 🤦‍♂️

  • @luv2stack
    @luv2stack 3 года назад +18

    When you google "Nothing else matters" and RUclips gives you "Nothing better than C". That's when you know you are nerd

  • @arminharper510
    @arminharper510 4 года назад +15

    it wasn't until i decided to write a desktop script for my Kali linux in PHP that i realized that programming languages DO differ and it is imperative to choose the right one for your project. so i agree with him,if you want to build an OS just go for C. in PHP a thing as simple as taking some inputs from the user is unusual since you have to "read a file" and then add that line to history manually xD

    • @ShaferHart
      @ShaferHart 4 года назад +25

      PHP is the wrong choice though. Always.

    • @anvarnasar7716
      @anvarnasar7716 4 года назад +3

      It is not the fault of PHP. That is how the implementation of basic printf() and scanf() io functions is implemented in C. I didn't know this until I read some books about linux system programming in c. You have to call the kernel commands and do a ton of stuff like memory management to do io and every io devices are treated as a file in linux systems. In the case of C they implemented this as stdio on the standard c library which comes preinstalled with linux system. By default your c program is linked to the standard c library if you include header files like stdio.h. I think you can get one like that for PHP from composer or something.

    • @arminharper510
      @arminharper510 4 года назад +5

      @@anvarnasar7716 i never said that it was PHP's fault. It is perfect for what it's designed to do, it is the entire point of my comment :p also i have started to learn C since i wrote this comment and i just love it :p

    • @anvarnasar7716
      @anvarnasar7716 4 года назад

      @@arminharper510 I am also a C and C++ programmer.😃

  • @balintb2748
    @balintb2748 9 месяцев назад +3

    if you look really close you can notice he is signaling "Rust" in morse code with his foot

  • @esra_erimez
    @esra_erimez 4 года назад +85

    For too long high level computer languages tried to model the problem space. Think Fortran and Cobol. Whereas, C modeled the hardware at a higher level. Therein lies its elegance.

    • @ElPasoJoe1
      @ElPasoJoe1 4 года назад +5

      I liked FORTRAN. Hard to do recursion - knew a guy once who did it but he had to build his own stack and be very careful it didn't overflow. A Kludge at best. But for real time command and control it was really good. It was not as good at hammering on numerical solutions for differential equations as a spreadsheet (Visicalc) was. Yeah, I'm old...

    • @Alche_mist
      @Alche_mist 4 года назад +11

      @@ElPasoJoe1 It all depends on the use case. It's autumn 2019 and it's not even a month I have seen a freshly written (my acquaintance actually wrote it) Fortran (.f90) program that's actually used to enable quite a significant discovery in the field of quantum chemistry. Fortran isn't dead. It's specific in what it wants to do.

    • @esra_erimez
      @esra_erimez 4 года назад +2

      @@Alche_mist +1

    • @asadulhaq6689
      @asadulhaq6689 4 года назад +5

      This is the unspoken truth we all know, and yet seldom put in words.

    • @williamdavidwallace3904
      @williamdavidwallace3904 4 года назад +7

      C is essentially just a higher level assembly language especially if one does not use an optimizing compiler.

  • @aakashmalviya6231
    @aakashmalviya6231 3 года назад +1

    I like how the text shows when he's saying something important. More channels should start doing this.

  • @SwagBastard
    @SwagBastard 3 года назад +1

    he just means for interacting directly with hardware, which is true. This is also why most compilers and the JVM are written in C/C++

  • @xr.spedtech
    @xr.spedtech 3 года назад +17

    Walking philosophy, Can't stop Listening to his talks / conferences ....

  • @BillFlann9
    @BillFlann9 3 года назад +31

    Two take away sentences ..."If you think like a computer, writing C actually makes sense" and "If I read C I know what the assembly language will look like"

    • @michaelpotts1131
      @michaelpotts1131 3 года назад

      And that’s why assembler (System 360/370) and C were combined into one class in my undergrad.

  • @LydellAaron
    @LydellAaron 4 года назад +21

    Only a dramatically new computer architecture paradigm could unseat C as the language of choice for system programming. C will likely remain alive, for as long as our modern processor architecture involves bits, bytes, CPU and memory mapping.

    • @tappy8741
      @tappy8741 3 года назад

      Rust is a good augment, but even that won't unseat C

    • @embeddor2230
      @embeddor2230 2 года назад +2

      It's called C++. A safer and better C

  • @timhofstetter5654
    @timhofstetter5654 3 года назад +2

    I could not possibly agree more, in all regards. Except, of course, that I'm also very, very comfortable with a soldering iron.

  • @Netsmile
    @Netsmile 2 года назад +1

    All of Tesla's autopilot is written in C. AS it has to be super efficient in interacting with HW, and milliseconds do count.
    The have even created a custom made C compiler as well.

  • @JJSogaard
    @JJSogaard 3 года назад +28

    He didn't really say that there is "nothing better than C", though that might have been what he meant.
    He simply said that C does something unique, specifically in regards to OS development, that he values and therefor he prefers C.

  • @nasrimarc7050
    @nasrimarc7050 2 года назад +8

    Rust don't replace the C language but it's a excellent programming language with built-in security mechanism, data structure and memory management so opening Linix Kernel to the Rust language is pretty good idea 💡

    • @robertobokarev439
      @robertobokarev439 Год назад +2

      funny joke, lol

    • @nieczerwony
      @nieczerwony Год назад

      Not with regulation currently introduced by foundation. It's a joke. Try to imagine I'd Dennis Ritchie would go the same route as Rust foundation. People creating unix or C/C++ language were humble geniuses, which worked with passion to make it possible for engineers and scientists to use tools which will speed up and improve their work. Look at the difference between Bill Gates who didn't even invented Windows and Ken Thompson who created Unix. Rust it's actually going into direction of Gates.

    • @charlieking7600
      @charlieking7600 11 месяцев назад

      Have you ever tried static analysers?

  • @nantunest
    @nantunest 4 года назад +13

    C is just generic assembly, as said one of the best C programmers I've met. He had developed his own OS on that time and made his master and doctorate thesis over it.

  • @Sam-hu3xt
    @Sam-hu3xt 3 месяца назад

    Recently I had to audit a little project of 6k assembly instructions compiled from C, and the fact that everything can be traced easily between Source Code and Object Code it is such an important thing while developing safety critical software, that makes C so relevant today.

  • @venus007e6
    @venus007e6 Месяц назад

    That exactly why I love c too. You can look at any line in a c program and easily tell exactly what the line is doing. For me, c is just assembly with a nice coat of paint, but you don't loose any control.

  • @shantanushekharsjunerft9783
    @shantanushekharsjunerft9783 4 года назад +9

    gcc -S stops the compilation process at x64 assembly, from my vague memory. I would take every C code and bring it to assembly and it just made perfect sense.

  • @Deschutron
    @Deschutron 4 года назад +8

    At first I thought the guy asking him the question might have been a young Linus Torvalds.
    I guess having heard that answer from his future self, he focussed on C more strongly and achieved greater things.

    • @Deschutron
      @Deschutron 4 года назад +2

      @statorworks 345 I'm glad I wasn't the only one who thought that, or rather I was..

    • @jerrygreenest
      @jerrygreenest 4 года назад

      @@Deschutron, just watch "The Egg" and don't ask weird questions (of course you was)

    • @Deschutron
      @Deschutron 4 года назад

      @@jerrygreenest galactanet.com/oneoff/theegg_mod.html
      Oh wow, what a great twist to add to the idea of us all being the one soul via time-travelling reincarnation!
      I can't wait for Linux to grow up and write its own OS.

    • @voxelamateur
      @voxelamateur 3 года назад +1

      I thought exactly the same until the younger person started to speak. underrated comment

  • @ropersonline
    @ropersonline 3 года назад +16

    I bet this was in my recommends because the Linux kernel is now gathering "rust"...

    • @janglestick
      @janglestick 3 года назад +1

      i noticed that too, it might be time to re-ask this question with the whole Rust for Kernal thing.
      Also ... what about when the OS has been built up a bit but still needs to handle concurrency at the hardware level?
      Wouldn't you use GO or something that had some sort of primitive for parallelism.

    • @RodrigoCFD
      @RodrigoCFD 3 года назад +1

      @@janglestick Just for drivers, which is a rather superficial part. The problem with Rust is that it depends on LLVM, which does not support all the platforms Linux does, _not even close_. That's why Rust will probably remain only in drivers, never in the kernel.

  • @EigenMaster
    @EigenMaster 3 месяца назад +1

    "I like tinkering hardware from a software perspective."
    Words to live by

  • @SeventhCereal
    @SeventhCereal 3 года назад +20

    C++ is good enough for HFT which can do a complete reaction from input in 10 nanoseconds. But the standards are high and requires many unit tests to ensure assumptions of compiler optimizations are correct, which they usually are. Then you have to adjust the algorithms to the cache and core layouts of the processor. C is more of a direct-mapping but its clunky and old school back when you had 1 person do everything.

  • @videoaccount5676
    @videoaccount5676 4 года назад +145

    C Master race reporting in

    • @GigaPlaya
      @GigaPlaya 4 года назад +5

      I still remember the days when we used a hex editor to alter programs. Not for people who have trouble spelling.

    • @kingzeeb319
      @kingzeeb319 4 года назад +3

      C? Fucking casul, do as zer0flag said and then you can talk.

    • @empireempire3545
      @empireempire3545 4 года назад +15

      @zer0flag thats casual. I write by positioning my motherboard in just correct way for the incoming cosmic rays to generate current corresponding to sequences of 0s and 1s i want to execute.

    • @libremercadoencrisiseconom2118
      @libremercadoencrisiseconom2118 4 года назад +3

      real ones have a custom keyboard where they make logic gate combinations, and set flags and builds physical mem allocators, then insert a card which is wrapped by an electromagnet machine built by themselves, and that also moves card registers into logic entries reading and modifing pointers regarding the flag states produced by logic subroutines, to inner ones

    • @anse1774
      @anse1774 3 года назад

      I hate your race

  • @thedude4795
    @thedude4795 3 года назад +7

    Kurt Russel pouring whiskey inside the computer, thats "interacting with the hardware".

  • @tylerriley
    @tylerriley 3 года назад +5

    I like C for the overflows.
    But I don’t really know what I’m talking about.

    • @kattihatt
      @kattihatt 3 года назад +1

      @@n4rfy477 lol

  • @torphedo6286
    @torphedo6286 8 месяцев назад +1

    I've really been liking Zig, I'm not sure yet if it's as flexible as C. I think once I get used to the syntax it will be pretty close, I really love the if/for/while statement capture syntax and built-in optional/error types. I think it strikes a nice middle ground between the more complex features of C++ (like generics via templates), and not adding too much invisible code under the hood.
    For example being able to pass a data type as a function parameter and do a switch statement on it makes it super easy to do generics without the pain of templates. And that means for example you can easily have the compiler auto-generate code to swap the byte order of struct fields. Linking Zig code to C and calling Zig from C code is not great though. And writing build files in Zig is neat, but incredibly annoying for simple projects (spent like 2 hours writing a Zig build script to add C files from all subfolders to the build, which would've taken like 2 unix commands and some pipes). Also the cross-compilation support is literally best in class. Unironically surpasses GCC cross toolchains by miles.

    • @lanceharvie6933
      @lanceharvie6933 8 месяцев назад

      Great insights on your experience with Zig! It sounds like you're appreciating its syntax and built-in features, which indeed offer a unique approach compared to C and C++. The ease of handling generics in Zig, as you described, definitely sounds like a significant advantage, especially for those who find C++ templates cumbersome.
      I agree that the ability to pass data types as function parameters for generics is a game-changer, simplifying many tasks. It's interesting to hear about your mixed experiences with Zig's integration with C and its build system. It seems like while Zig offers some innovative features, it also has areas that could be improved for user convenience, particularly for simpler projects.
      Your point about the cross-compilation capabilities of Zig is especially noteworthy. Surpassing GCC's cross toolchains is no small feat, and it speaks volumes about the potential efficiency gains with Zig in more complex development scenarios.
      Have you found any workarounds or best practices for the issues with linking Zig to C and writing build files that might help others? Sharing such tips could be incredibly valuable for the community. Thanks for sharing your thoughts!

  • @misogear
    @misogear 4 года назад +199

    Damn i just complete ruby for beginners

    • @xsorn
      @xsorn 4 года назад +20

      I agree. Dont start with C. C is a good second language to learn. Now get a good beginner's book on C and get started!

    • @yzhang2008
      @yzhang2008 4 года назад +12

      No worry, Ruby is one of the best application developing languages. And it's good for beginners too. C is basically for system programming. It's almost impossible using C to implement something like RoR.

    • @plasmahvh
      @plasmahvh 4 года назад +18

      @@yzhang2008 it's like hahaha python is too slow for AAA engines! C is not meant to be used in web development, like python isnt used for complex games. people learn C cause they want to go as low level as possible but still don't want to mov all the time.

    • @toma4474
      @toma4474 4 года назад

      Ruby is very simple. It’s for web back-end. C is completely different ballgame it’s used for making libraries in mobile devices. The smart phone you’re running using many those c libraries processing this webpage. I’m using iPhone’s RUclips app which uses lots of c libraries. One question: Is Ruby on Rails losing it’s popularity? It was very fast tho.

    • @popespalace823
      @popespalace823 4 года назад +2

      @@plasmahvh
      Most videogames are made in c++

  • @Kimchi_Studios
    @Kimchi_Studios 3 года назад +5

    He's right. It's why I use it to program the Atmega328p in C instead of the Arduino in 🤢🤢🤢Arduino language🤮🤮🤮🤮🤮🤮.

    • @lanceharvie
      @lanceharvie 3 года назад

      That's awesome @Kimchi Robotics!

  • @lamperouge3615
    @lamperouge3615 2 года назад +4

    I got into programming with Java and learned C a bit later on. I mean pointer arithmetic can be confusing in the beginning, but once you get into it and understand what the code really does it's so beautiful to actually program the computer and not some abstract concept. You will never want to use Java again xD

    • @lanceharvie
      @lanceharvie 2 года назад +1

      Pointers are magic once you get your head around them.

    • @carldrogo9492
      @carldrogo9492 Год назад

      You clowns fanboy over tools (programming languages are tools). 🤦‍♂️😂

  • @rishabhmahajan6607
    @rishabhmahajan6607 3 года назад +23

    All firmware engineers are nodding in approval

    • @kevinchadwick8993
      @kevinchadwick8993 4 месяца назад

      Nope. After writing embedded Ada code professionally you will hate reading C reference code and all of it's obfuscation of the logic.

  • @ElPasoJoe1
    @ElPasoJoe1 4 года назад +10

    The reason to use C is because it will generate reasonable assembler code. I wrote an operating system in assembler once. Or twice. C is better but still some things I would rather do in assembler. 68K was my best processor - looked a lot like a big machine when down on the bare metal programming. Don't think we see much of those anymore...

    • @sfcs3743
      @sfcs3743 4 года назад

      Did you write your own kernel for your hardware?

    • @adamkoxxl
      @adamkoxxl 4 года назад

      What about calling asm from another file or inline asm in c?

    • @sfcs3743
      @sfcs3743 4 года назад

      @@adamkoxxl I don't believe inline assembly existed for C during a time where people coded in pure assembly xD

    • @tsumardi
      @tsumardi 4 года назад

      the question is can you get another job when employers do round of lay offs every quarter and there is no demand for this ancient language.

    • @adamkoxxl
      @adamkoxxl 4 года назад +1

      @@sfcs3743 i am attending an assembly class and we dont use inline asm but rather declaring an extern function on the top of c file which is linked to asm file... its interesting but gets confusing really quickly, especially when working with extended instruction set like AVX.

  • @GRDwashere
    @GRDwashere 3 года назад +4

    I get what he's saying. I write hardware specific code for embedded controllers and c is my language of choice for that.

  • @AGUNGKAYA
    @AGUNGKAYA 4 года назад +59

    Everything in his mind is about linux kernel, so he will stick in C..

    • @karma6746
      @karma6746 4 года назад

      @@miguelbarra5091 You mean the MOST POPULAR versioning tool in the world!

    • @adnanhowlader143
      @adnanhowlader143 3 года назад +1

      @@karma6746 python is written in c

  • @chengmunwai
    @chengmunwai 3 года назад +7

    We have an entire generation of so-called "coders" now who prostrate themselves before Ruby on Rails not knowing that C still exists and they can't write a single query in SQL.

    • @davidjohnston4240
      @davidjohnston4240 2 года назад +1

      Not writing queries in SQL is a good thing. SQL is a truly horrible thing. I've seen 4GLs in the early 90s that were more elegant.

    • @saudude2174
      @saudude2174 2 года назад +1

      the more coders on the market, the less competition for actual programmers
      if you're still young and striving for a better career and pay, you should be happy as well
      dont worry about the "general level of knowledge" decreasing. You will always find enthusiasts and scientist who push the cart forward, actually, there's more of them now than there was in the past.
      This generation of coders is exactly what the market demands at the moment and its good for us.

    • @carldrogo9492
      @carldrogo9492 Год назад

      @@saudude2174thats contradictory.

    • @saudude2174
      @saudude2174 Год назад

      @@carldrogo9492 to what?

  • @Merthalophor
    @Merthalophor 3 года назад +4

    He's talking about the hardware abstraction presented to the programmer, not the hardware itself. Those two things used to match, back in 1980, but don't do that _at all_ anymore. In this sense, of course C follows a similar paradigm as assembly, but that's mainly due to the reason that both x86 and the hardware has been _designed with C in mind_ . C and x86 are very close brothers who were developed hand-in-hand, it's not the brilliance of the C inventor that C follows x86 so closely.
    Modern ISA's move away from the Von Neumann model. ARM and MIPS for example are much, much simpler and better designed than x86, and as a result don't mimick C as closely. Even further away is the EVM ISA, the ISA used by Ethereum to execute smart contracts, where you're departing completely from the Von Neumann model.
    But even for x86, no human can translate C to assembly the way modern compilers do. Their optimization algorithms are so advanced that it's often extremely hard to even understand why the output is correct when reading it.
    His reasoning sounds romantic, but I don't think it's the reason C won't die. The actual reason is the vast highly performant codebases written in C. If a compiler isn't implemented in C, the language it's implemented in is. And the entire POSIX specification was done with C in mind.
    There are luckily emerging languages that stand a good chance of replacing C, most notably Rust, which has managed to get rid completely of the null pointer exception and segmentation fault, while staying as performant as C.

    • @lanceharvie
      @lanceharvie 3 года назад

      @Merthalophor great comments - Rust is indeed an alternative however C will dominate into the future particularly on resource-constrained hardware ie embedded systems or even high order software stacks where the last drop of performance needs to be extracted.

    • @stanislawpalka9015
      @stanislawpalka9015 3 года назад

      No need of another language than C. C can be extended and will be perfect. 20-30 extentions is sufficient. Program is shorter, faster, more secure, no bugs.

    • @stanislawpalka9015
      @stanislawpalka9015 3 года назад

      @ReaktorLeak I agree with You. But You wrote the REPLY under my comment, so @Merthalophor does not received notification and don't know about Your REPLY. Please repeat Your REPLAY under comment of @Merthalophor.

    • @stanislawpalka9015
      @stanislawpalka9015 3 года назад

      There is good Answer of Mr @ReaktorLeak. Unfortunetely he wrote it under last comment so You does not received notification.
      You are probably theoretician not much of practice.

  • @linuxdemy
    @linuxdemy Год назад +2

    C is the mother of many things in computing.

    • @charlieking7600
      @charlieking7600 11 месяцев назад

      The main Mutterficker of programming languages is Algol.

  • @asdadadsadasda
    @asdadadsadasda 2 года назад +1

    True! I agree 'C' is required for best.

  • @blankjo9113
    @blankjo9113 Год назад +2

    Multidimension arrays are a real nuisance in C

  • @vetiarvind
    @vetiarvind 2 года назад +3

    Damn, this makes me nostalgic about the time in the 90's when I was writing C code for travelling salesmen, TSR's and stuff like that as a teenager. I forgot the name of the IDE (it had a blue background with a DOS like look)
    After that have coded in C++, VB, C#, Java, Scala, Haskell, Js, Typescript, Python, Ruby but yeah I still remember reading the docs for each function in C listening to heavy metal back in the day.

    • @bill3143
      @bill3143 2 года назад +7

      Borland Turbo C, perhaps?

    • @nezman_x2080
      @nezman_x2080 11 месяцев назад

      Turbo C

  • @dickheadrecs
    @dickheadrecs Год назад +4

    The kernel is rusty now tho

    • @charlieking7600
      @charlieking7600 11 месяцев назад

      Maybe after several years we'll see C++ included.

    • @tomtravis858
      @tomtravis858 10 месяцев назад

      @@charlieking7600 nope, he Linux specifically shoots down proposals to use C++

  • @alejandrochataing5341
    @alejandrochataing5341 3 года назад +1

    My first code was in C and I loved it. I later learnt C++, Java, php, javascript, mysql, autohotkeys, bash, git, visual basic, c#, nodejs, wordpress dev, laravel without mentioning many more

    • @ton6492
      @ton6492 3 года назад +1

      how the hell do you remember all them

  • @tecra3toshiba149
    @tecra3toshiba149 3 года назад +1

    Thank you! Assembler - that is a blast from my childhood. I was lucky. My dad brought home all kinds of hardware.

  • @ComeLeVent
    @ComeLeVent 2 года назад +3

    I agree even though I like the concept of classes at least, but not the fashion to think everything in object oriented terms. Even inheritance is something i prefer to avoid.

    • @taxerap8498
      @taxerap8498 2 года назад +3

      I agree with you. I quit Rust mainly because it supports OOP in the language explicitly, and when a language does that, people *will* start to write OOP, and it ends up with a bunch of mess. It is possible to do OOP with C, but no one does that because the language intents to let you think about the CPU, rather than abstractions upon abstractions. (Using "classes" is not the same as OOP)

    • @kevinchadwick8993
      @kevinchadwick8993 4 месяца назад

      ​@taxerap8498 You should check out Ada. It had object oriented design (not oop) in the 80s. It was also designed for embedded use and to be highly maintainable. Ada is actually safer and easier to use than Rust too. I'm not really a fan of object-oriented or functional programming. Imperative programming is under rated .

  • @mahkhi7154
    @mahkhi7154 2 года назад +8

    Different Languages for different purposes. C is good for hardware. C++ for Object Oriented Software. The GUI is OO in Nature. C# or Java for Web Development. A rookie error won't mess up the System. MATLAB for Simulation. SQL for data. C was the First Programming Language I learnt.

    • @saudude2174
      @saudude2174 2 года назад +2

      this is my favourite comment in this entire section

  • @davidloo1002
    @davidloo1002 4 года назад +13

    Hey Linus, I am a high school student. I always love C too. But my parents don’t agree with me. :(

    • @ahmadyogi1340
      @ahmadyogi1340 4 года назад +7

      It's okay maybe someday you'll get C++

    • @davidmella1174
      @davidmella1174 3 года назад +1

      hey, at least it isnt a D. Dont make it so bad.

    • @CTimmerman
      @CTimmerman 3 года назад

      Sounds like ruclips.net/video/RnqAXuLZlaE/видео.html

    • @AGUNGKAYA
      @AGUNGKAYA 3 года назад

      You should learn Ada, so you will love A too :D

    • @TheLordoftheDarkness
      @TheLordoftheDarkness 3 года назад +1

      Get new parents

  • @ianboard544
    @ianboard544 3 года назад +18

    It's also nice not having to learn new languages all the time as they drift in and out of fashion.

    • @fredflintstone8048
      @fredflintstone8048 2 года назад +2

      Yes, web-stack developers seem somewhat fickle and there seems to be a new framework that hits the scene every year or two. I suppose it's our addiction to novelty, or some kind of thinking that finally a framework has arrived that will make web-stack development better, easier, whatever.

    • @suibora
      @suibora 2 года назад +10

      ​@@fredflintstone8048 web developer - "Why are there 7 different standards to do the same thing? I'm just going to unify them all into one standard without any of the bugs or gimmicks". Now there are 8 standards

    • @fredflintstone8048
      @fredflintstone8048 2 года назад

      I think there are so many standards because there are so many different ways to skin the same cat. There are also different frameworks for just about every popular language, and the browser is fairly flexible and if a developer wants to do something different he/she can even create plugins for browser to be able to interact with the server/service environment.

  • @erwinkonopka7071
    @erwinkonopka7071 2 года назад +24

    Well. Recently he added Rust to list of allowed languages in kernel. So finally he must have found a language at least as good as C.

  • @dansanger5340
    @dansanger5340 2 года назад +14

    What he said was completely uncontroversial at the time he said it. Of course you would use C when you need low level access to the hardware in the kernel. The only alternative is assembly, which is needlessly complex except in limited circumstances. C really began as a glorified assembly language. So, when he says he knows what kind of assembly C code would generate, he is saying nothing remarkable. Anyone who has used C and assembly would say the same thing (at least on CISC processors). However, for someone writing a new OS now, it might be a good idea to consider Rust. Also, just because C is good for the low level parts of an operating system, doesn't mean it's good for writing a web app or a desktop app or a mobile app.

    • @topkek670
      @topkek670 2 года назад +2

      well he is talking about OPERATING SYSTEMS.. not desktop apps.. come on

    • @carldrogo9492
      @carldrogo9492 Год назад

      🤦‍♂️🤡

  • @WestCoastAce27
    @WestCoastAce27 4 года назад +34

    The man, the legend.

  • @makelebanon1
    @makelebanon1 3 года назад +22

    the title should be, "When I read C I know what the assembly language look like"

    • @alpers.2123
      @alpers.2123 3 года назад

      Meanwhile optimizer: 🤨

  • @johnphamlore8073
    @johnphamlore8073 3 года назад +1

    I am curious if any CS algorithm books discuss how the Linux kernel uses C's extension of container_of to "inside-out" data structures. If you naively look at older algorithm books, you would think you would implement a data structure and its such as a red-black tree and then expect the user to use pointers to objects that implement some api for red-black operations. But in the Linux kernel, an entire red-black tree operation api is NOT implemented. Instead the developer is expected to implement many details themselves. One embeds a piece of the data structure as a field of a struct and then uses container_of when given that field member to work up to the object itself. It's very elegant.

  • @howardlitson9796
    @howardlitson9796 4 года назад +1

    Don't forget that nothing better than assembly language and machine code. C language was published in 1972. Assembly language was published in 1949. Since there was electronic computer, in that time was appeared in assembly language. C language was based on assembly language.

  • @Muck-qy2oo
    @Muck-qy2oo 4 года назад +7

    C is like a linking point between all other, higher, languages and assembly language.

  • @fincrazydragon
    @fincrazydragon 3 года назад +3

    I love C. I started in 1991 with Borland Turbo C/C++. One of the best features is being able to write inline assembly code.

    • @lanceharvie
      @lanceharvie 3 года назад

      You and me fincrazydragon - C is king

  • @AGUNGKAYA
    @AGUNGKAYA 4 года назад +13

    I was choosing Java when trying to automate my task but I did not know why it was not finish. Then I moved to C and start writing the code. Just in a week, the code was finished and was running great. C just works!

    • @HistoricalPlayer
      @HistoricalPlayer 2 года назад

      Why tho? What changed?

    • @Zephyr-tg9hu
      @Zephyr-tg9hu 2 года назад +1

      I mean the argument "I tried programming in Java but failed.... C works" is a tad contrived. All programming languages "work", it just depends on what your goal and implementation is. If I write code that Java doesn't compile, that doesn't mean I should move on to a different language. It means I need to learn how to debug.

    • @AGUNGKAYA
      @AGUNGKAYA 2 года назад +1

      @@Zephyr-tg9hu I believe some languages are easier than the other one. I dont know. Maybe I just like C.

  • @tengamangapiu
    @tengamangapiu 2 месяца назад

    I learned C in college from the K&R book, but don't really use it in any job I've had. I wish there were more embedded projects that made sense for enthusiast/amateur use of such a powerful language. Maybe even sell your creations in an Etsy marketplace (thinking about a commercially viable use).

  • @mrdesperate1
    @mrdesperate1 3 года назад +8

    I expected to see a lot more posts bringing up rust

    • @sakon4466
      @sakon4466 3 года назад

      i would like to see them too