Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

TLDR: Goto last line of this comment

> It is still one of the most commonly used languages outside of the Bay Area web/mobile startup echo chamber;

Fair.

> C’s influence can be seen in many modern languages;

Saying that that's a reason to learn C is a non sequitur. Why?

> C helps you think like a computer; and,

So does C++. And Rust. And D. All the stuff about databases can be done in any of these languages, C doesn't have a monopoly over letting you be close to the metal. It's one of the only languages that pretty much forces you to be close to the metal, but that's not a plus point.

> Most tools for writing software are written in C (or C++)

True. Hacking on your tools is great. But hacking on your tools rarely requires proficiency in a language (unless you're doing something major, which you're not), I've hacked on tools written in all kinds of languages that I don't know.

And the justification behind this point follows the same flimsy reasoning as the previous one, the reasoning that C is the only low level language out there. The post gives "browsers, operating systems and languages" as examples, but all three of these exist in Rust (Servo, redox/intermezzos/a bunch more, and rustc). I'm sure that D is up to the task for such software too, if it doesn't have them already. C++ of course has all of these.

Sure, you need to know some C when doing low level programming and/or FFI. But nobody's arguing against that. "Everyone “has been meaning to” learn Rust or Go or Clojure over a weekend, not C." is a false dichotomy. With Rust for example it's pretty easy to learn enough C to manage once you've learned Rust (there are tons of folks in the Rust community who have done this). You're not forsaking C, you're just focusing on something better. You can learn enough C to be able to read code and do FFI, and you're pretty much set for writing databases or operating systems or networking stacks or whatever. Reading C isn't too hard and if you speak another low level programming language you can pick this up over a weekend.

The only valid argument I see here is that C is is still used a lot in existing codebases, and you should be proficient if you want to be able to contribute significantly to them. Of course. But cut all the crap about C being the only language that can handle these use cases.



  > The post gives "browsers, operating systems and 
  > languages" as examples
Actually, I can't think of any browsers that are written in C. Unless, wait, does Lynx count? :)


netscape was when it was popular, then they re-wrote in c++ (when compilers for that language were much worse than they are now) and everything went to crap. Templates work now and are pretty much consistent accross platforms, they didn't then or so says JWZ, wasn't there to confirm it but seems very plausible based on what experience I had of visual c++ 6 at the time


netsurf?


> > C’s influence can be seen in many modern languages;

> Saying that that's a reason to learn C is a non sequitur. Why?

To better understand how and why those modern languages work the way they do. The same as learning assembly helps you better understand how computers work (and what C really does under the hood). Learning about layrs under your abstraction layer typically leads to better understanding of your abstraction layer.


C is not a "layer under the abstraction" for C++, D, or Rust, that's my whole point. These languages can be as low level as C, and their higher level bits are implemented as an abstraction layer in the same language.

I understand the need for mechanical sympathy. This is not mechanical sympathy. At best, this is _historical_ sympathy.


Good points.

As a programmer, one has no choice most of the time on what language a program should have been written, in my career, I have mostly been modifying and adding code than writing new code from scratch. This mostly means C, for anything close to hardware, as electrical/electronics engineers are familiar with it. Another way of saying this is that, "I program in whatever language, my team is programming in".

Embedded systems also have size limitations and the problem of bootstrapping on new hardware. C has time and again proven to be easy.

If you examine a typical GNU/Linux distro, you see all kinds of programs written in C that ought to have been written in a type safe language because most of the time, C's features were not required for the program.

I wish more and more "new" programs are written in all kinds of languages (not just Rust, but in Python or Haskell or OCaml ..) other than C and that we restrict C to the things we really need it for.

Overall, knowledge of C is only going to help. Whether you want to use it to use it for your next project is something that depends on the problem at hand.


> Overall, knowledge of C is only going to help. Whether you want to use it to use it for your next project is something that depends on the problem at hand.

Of course! To be clear, I'm not arguing against learning C in general. I'm very happy that I learned C.

I'm arguing against the point made in the post that you should learn C over newer languages. And like I said, "shit my codebase is in C" (i.e. point #1 from the post) is a totally valid reason to learn C. The other points are not.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: