Live data from Hacker News

Ask HN: Should I learn C?

news.ycombinator.com

31–40 of 98 posts

Re: Ask HN: Should I learn C?

#31
Theoretical aspects:

I assume that you want to be a good hacker. A good hacker has a healthy mix of knowledge that will allow him to start work quickly on almost anything. Without a solid grounding in C, (and a perspective of JS and Python), there are a whole class of things that you won't be comfortable working with unless you have some lower level experience.

With your current knowledge, how easy would it be for you to start hacking on an IP stack? Not that you would ever need to, but with a good knowledge of C such a thing becomes natural to you. All of those RFCs begin to make much more sense.

Another big benefit to C is how simple it is. You begin to see how possible it would be to create a simple C compiler, and this is a good spot for this intuition. It has a simple syntax, is somewhat feature-poor, and is very close to the hardware.

Plus, you'd be able to hack on CPython if you want ;)

Practical aspects:

Your knowledge seems to say that you are headed for web development, which I applaud, because all things exciting are happening on the web.

Web development is changing. It used to be that web developers were laughed at, considered to be inferior to other programmers. It has been a few years since I've seen that opinion, and I think it has been thoroughly shown to be wrong.

Web development has become, essentially, a two part system where the pretty web front end sits as an interface to a super hardcore back end. Web companies now face scaling issues that are relatively new to web development. While you may never program in C, having a strong foundation on what the underlying issues are.

Either way you look at it, learn C is to get a better understanding of technology. It will certainly do that for you very well.

Re: Ask HN: Should I learn C?

#32
Short answer: yes.

Long answer maybe you also want to learn some assembler to see how the machine really work (I would recommend programming a simple microcontroller or the lego NXT things).

If you manage to learn C. It will be easier later to learn an object oriented language later. (Java, C# or C++)

The problem (and the frustrating thing) will be that you first probably wont achieve much by using pure c. Therefore you can also start with toolkits like processing.org which can teach you basics about algorithmic thinking.

Re: Ask HN: Should I learn C?

#34
post #15
post #8

Earlier quoted context omitted.

I don't know if I'd call it "profitable" to do so at the moment, assuming you mean profitable in the money sense. I was meaning the in overall sense; "profitable" as in good for me. Sorry for the misunderstanding.

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)

Re: Ask HN: Should I learn C?

#35
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!

"A penny saved is a penny earned." Just as a minute saved is a minute gained. I asked to save myself time. Hindsight is 20/20, and a whole lot of people on here have hindsight.

You are wrong. Penny saved is the subject of income tax :)

Re: Ask HN: Should I learn C?

#36
Absolutely! By learning to deal with pointer manipulation and memory allocation, you can learn what it is, why it is necessary and how to recognize when it is broken. One of the problems with garbage collection is that it suffers from a memory management problem at a higher level of abstraction. There was an entry in an autonomous vehicle competition a few years ago that stalled. Physical objects in the environment were represented internally as objects in the code. When the vehicle passed them, they were moved to a collection of objects that had already been identified but were out of the field of view. That collection grew unbounded even with garbage collection because every one of those objects was still referenced.

Re: Ask HN: Should I learn C?

#37

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…

Good post. Not sure C qualifies as "pure imperative" - it has expressions and functions after all. I'd think a true pure imperative language would have to be either assembly without macros or something like Forth (where IIRC each "word" is a self-contained command that performs an action on the stack etc.)

Re: Ask HN: Should I learn C?

#38
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)

True, but it generally takes quite a bit of time to get to the point where you're "money profitable" with C compared to higher-level languages that are in popular use.

Re: Ask HN: Should I learn C?

#39
There is no wasted knowledge, C is a primitive language, but could teach you things that many other languages cannot.

Consider proper memory management, et al. There are other languages that implement similar features that C does, but ANSI C is a macro-assembler in the truest sense of the word.

Pick up a copy of "The C Programming Language, by Kernighan and Ritchie" and do the exercises.

Good luck.

Re: Ask HN: Should I learn C?

#40
post #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?

I asked this question for two reasons:

1) I had already started learning C. It is low-level, and I was getting disinterested. I wanted to know if it'd really be worth the work to learn it. (The answer is absolutely.)

2) So that other people, when wondering if they should learn C, would have a great list of hacker recommendations. (That has happened.)

Post reply on HN