Live data from Hacker News

Ask HN: Should I learn C?

news.ycombinator.com

21–30 of 98 posts

Re: Ask HN: Should I learn C?

#22
Absolutely yes.

There's no downside in learning C, and there's not much fluff in the language core to complicate things, or slow things down.

I'd suggest you get a copy of K&R: The C Programming Language and just work through the text and examples. You might also want to pick an existing C-based project and work on bugs in it, maintenance programming being one of the best ways to get to grips with using the key tools, gcc and gdb.

This way you'll get a feel for the language, and also for what you'll need to debug and fix code.

Re: Ask HN: Should I learn C?

#23
Yes. You won't really know python or javascript until you learn C. You may gain some empirical knowledge about how various parts of those languages operate, but without knowing C, you won't understand the "why". If you understand the "why", you'll occasionally be able to intuitively see solutions that would never have occurred to you otherwise. Those are the sorts of key problems that can make all the difference in the success of the project and of your career.

Any language you learn will make learning additional languages easier and faster. But, the boost you get from learning C is arguably greater than for other languages. It's also the single most powerful backup language you can know.

Re: Ask HN: Should I learn C?

#24
I would suggest Python and C, in that order. Python will let you quickly have fun building large applications, and it will teach you object oriented programming. Once you know what a loop is, though, go by "Advanced Programming in the Unix Environment" and a decent C book and trip out on that for a year or so to really understand how computers work.

I don't write C for a living at all, but it is great to know how everything is working under the hood, and APUE will teach you that.

To be honest, I wouldn't bother with Java. I think in ten years Java will look like Ada does now: we will all be asking ourselves "What were we thinking?"

I also wouldn't bother working on anything but Unix, but that is just bias...

Re: Ask HN: Should I learn C?

#25
You should absolutely learn C - you don't need to be an expert, but you should fully grasp the use of pointers and memory allocation, and how the compiler really works (intermediate stages and all that).

This, for the same reason you should learn some provisional level of assembler on an older 8 or 16 bit processor with a simple instruction set (intel 8080 or 8086, and then maybe something RISC just for kicks). You don't need to be an expert, just dabble enough that you "get" how it works.

Also learn how to implemenet a few other progrmaming patterns in C - you can do OO in C, you can do functional in C, you can do concurrent in C. You likely won't have to in real life, but understanding those concepts at the level of C will really help you understand the benefits of higher level languages.

I'd say the same for any of the Lisps - learn one, even if you'll never use it - the insights it gives you are worth it and will make your other code better.

Re: Ask HN: Should I learn C?

#26
My answer to the question "Should I learn ?" is almost always "yes". Even if you never need to use it, it's always good to have a different way of looking at things.

One thing you might want to look at is cython[1]. It allows you to write C extensions in a Python-like language. Could be useful as a "bridge".

[1] http://cython.org/

Re: Ask HN: Should I learn C?

#27
Yes, learn C. I've tried to avoid it for years, but it's actually a beautiful and simple language. It's very powerful and low-level, which means that it's easy to create ugly programs, but that's another problem.

If you ever have to do low-level programming or Mac/iOS development it will definitely be of great use.

Re: Ask HN: Should I learn C?

#28
In my opinion, instead of asking and spending time reading the comments of everyone saying why you should learn C, you should have actually learned C. It's a great language and learning it will surely help you in your career.

Think of it this way: Why not learning it?

Re: Ask HN: Should I learn C?

#29

Absolutely, yes. + From the point of view of Python or Java (say), it's close enough to assembly language to let you understand how things might work; + If you need speed or control over hardware, sometimes it's your best route to extend whatever you're working in; + In many jobs you'll be the only one who has the knowledge to do unusual things, hence you'll be more valuable; + It gives you another point of view when…

I'd just add that c teaches you about pointers and how objects are stored in memory which is useful in whatever language you end up using.

Re: Ask HN: Should I learn C?

#30
post #7

A lot of people take the route of not learning C. If you do web development and your team finds something hard or impossible to do, watch their reaction when you say "I'll just write a C extension." The stack-frame comment is spot-freaking-on. Knowing this level of detail will make you a way better programmer in every other language because you won't make stupid memory hogging decisions or mistakes. You also understa…

I'd never heard of Pintos before. This looks like something I'd really enjoy working on, thanks for bringing it up.

http://www.jamesmolloy.co.uk/tutorial_html/index.html
Post reply on HN