Live data from Hacker News

Ask HN: Should I learn C?

news.ycombinator.com

41–50 of 98 posts

Re: Ask HN: Should I learn C?

#41

Even though C is used more and more rarely outside of systems programming, I definitely recommend learning it. Learning about pointer arithmetic, memory management, etc... will give you a depth of understanding in other programming languages that other students will be sorely lacking the first few years of college. Other than a little OS-hacking on the side, I've never used it for a project, but understanding how C w…

It is used a lot for embedded systems programming.

Re: Ask HN: Should I learn C?

#42

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'm not sure about aiming for "pure" languages. Lisp is functional enough that one can learn pure functional programming using it, if he tries. And Ruby is OO enough that one isn't missing much, isn't it?

Nothing wrong with the pure languages as options, just I think impure languages can fit the categories too.

Re: Ask HN: Should I learn C?

#43
I think you should learn C only if you will be able to learn enough of it to be very comfortable with it when you get to college. If you learn that much, you can place out of the courses where you learn C. However, if you learn only part of C and still have to take the course, you will have to suffer through many lessons teaching you what you already know. I say this from experience – I learned Java in high school and was taught C++ in college (just finished my freshman year), and about half the lessons were about stuff I already know, like the difference between a value and a reference/pointer to that value, and what an object is, and how while loops work, and other exceedingly boring stuff like that. So if you can’t learn C quickly enough to place out, save yourself the trouble and just learn it in the university courses, so that the courses will be interesting, because they are teaching you something new.

Re: Ask HN: Should I learn C?

#44
post #10

It's better if you dont ask! I don't believe that Linus ever asked (someone else) if he should learn C. Or that Damien Katz (couchdb creator) ever asked if he should learn Erlang. Or if Brad Fitzpatrick (Livejournal & Danga) ever asked if he should learn Perl! Just learn what you (from looking around) believe will make you a better or smarter, what is even more important use what you learn. Don't just learn to learn!

Maybe they did. It's not like you'd know.

Re: Ask HN: Should I learn C?

#45

Yes, you should learn C. And enough assembly language to understand aspects of how C works, like what a "stack frame" is. Now is a great time to start. Go find K&R, fire up Linux and write and compile "hello, world". Then keep going until you experience your first segmentation fault. ;) (Do not study C++ at this point. Study C. These things turn out to be very very different.)

A good book that goes over both C and assembly is "Hacking: The Art of Exploitation". The first 100 pages alone will give you a solid understanding of what is happening behind the code.

Re: Ask HN: Should I learn C?

#47

Yes, you should learn C. And enough assembly language to understand aspects of how C works, like what a "stack frame" is. Now is a great time to start. Go find K&R, fire up Linux and write and compile "hello, world". Then keep going until you experience your first segmentation fault. ;) (Do not study C++ at this point. Study C. These things turn out to be very very different.)

At my university we have a course that goes over all the levels of abstraction between the hardware and systems-level UNIX programming. I never took the class, but I followed the course book on my own and it proved to be one of the most enlightening self-learning experiences I've had with programming. The book is Computer Systems: A Programmer's Perspective, and I highly recommend it.

I've found that even though I now spend most of my time programming in higher level languages, my understanding of C and assembly, compilers and debuggers, the virtual memory model and system memory hierarchy, and CPU architecture are still very valuable in helping me reason about my code and how it interacts with the rest of the system. I also still have developers at work on the C development team occasionally come ask me code questions, and often the answers to their questions come down to understanding one of the above better. If you can master multiple levels of abstraction you will be a much more effective developer.

Re: Ask HN: Should I learn C?

#48
post #34
post #15

Earlier quoted context omitted.

Ahh, in that case learning C is a veritable goldmine! Edit: Also, if you use linux and end up going down the rabbit hole a bit, C is a prerequisite.

Being good at C can be very profitable in a money sense of the word too. Bloomberg is one example that hires a lot of C hackers and pays them obscure amounts of money (very very long hours though)

Obscure amounts of money?

Re: Ask HN: Should I learn C?

#49
Here's where C is taking you.

After you understand pointers and structs and have futzed around in the Unix command line for a while, you probably have enough to go on to something like Linux Programming by Example. This book walks through GNU implementations of Unix utilities and the system calls that make them possible.

You don't just want to run ls, you want to know enough that you can write ls by yourself. You want to learn how to manipulate the operating system with it. You will learn a mental model for how operating systems work in a deep, detailed way, which will serve you well no matter where you go.

Re: Ask HN: Should I learn C?

#50
No, if you want it to be "more profitable" just spend your time learning marketing(what the people that uses the software need) or how money works.

If you want to understand how computers work, of course you will need to know assembler and c. This will give you the option to do things that other people can't.

If you want short term profit, you should choose other options.

Post reply on HN