Live data from Hacker News

Ask HN: Should I learn C?

news.ycombinator.com

11–20 of 98 posts

Re: Ask HN: Should I learn C?

#11
Yes! Learn C!! But learn it with a view towards using it to inform your use of other languages. The low-level aspects (pointers, memory management, working with .DLL or object libraries) are things that most languages, however fluent or high-level, use under the hood.

Spolsky and Atwood argued this out in Stackoverflow Podcast #2. http://blog.stackoverflow.com/2008/04/podcast-2/

Just get a comfort level with it (C), and move on. It will pay dividends.

Re: Ask HN: Should I learn C?

#12
post #5

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's also very useful for extending other languages by binding a library.

agreed ... since you seem to be proficient in Python, one potential exercise is to write a C extension to the Python interpreter or C library modules for high performance

Re: Ask HN: Should I learn C?

#13
I really only have experience with web development with Rails and in PHP. I also have done a little Java at school. I am considering diving into iPhone development and learning Objective C. Would I get at least some of the benefits of learning C that you all have described in this thread from Objective C? From what I understand you even have to learn some raw C to work with Objective C.

Re: Ask HN: Should I learn C?

#14
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.

Re: Ask HN: Should I learn C?

#15
post #8
post #6

I, like many here, would strongly recommend learning C. I don't know if I'd call it "profitable" to do so at the moment, assuming you mean profitable in the money sense. C is a good language to learn, and a lot of interesting, well-paying jobs use C, and a lot of interesting open-source projects use C -- but if you just want to make steady cash, you can do so much easier with Java or PHP. That said, if you go about y…

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.

Re: Ask HN: Should I learn C?

#16
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 designing systems;

+ You say you'll need it for college - learn it now;

+ A spread of languages is critical if you want to master programming.

You can carve out a perfectly good programming career without knowing C, but it's always of benefit and value to get a wide range of skills. Some recommend:

+ Pure OOP: perhaps smalltalk or Self

+ Pure Functional: perhaps Haskell (non-strict) or ML (strict)

+ Pure Imperative: perhaps C

+ Pure Logic: perhaps Prolog

Other hybrid languages are useful and perhaps more productive, but it's the ideas that really matter while you're still learning.

Re: Ask HN: Should I learn C?

#18
You won't learn anything unless you need it, and it depends on your interests whether you need C in your programmings.

Other than that, I can't speak for anyone but myself.

For me, C has taught me so much since I was 14 that I couldn't possibly be where I am if I hadn't spent years writing C and I couldn't possibly recommend anyone not to learn it. But it's a different world for everyone and I can't say it's a bad thing if you don't know C. It would be a bad thing in my line of business but not everyone does the same things I do.

One thing about C is that it's a nice forced marriage with the von Neumann machines we're using these days. If you really want to know C, you really want to know the current hardware architecture as well. It will change but it won't do that at least in the next couple of decades.

On the other hand, mastering high-level languages first and dropping down when necessary might be a wise choice, if you only know you can do it. Like I said, architectures and paradigms will change in the future, and higher-level languages can embody abstractions that are very hard if impossible to contain in a von Neumann machine and it is the revolution of some new architecture when C will eventually be obsoleted.

Re: Ask HN: Should I learn C?

#19
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.

Re: Ask HN: Should I learn C?

#20
No, you should learn Java instead. The leap from Python to C would be atrocious, but the leap from Python to Java would be feasible. (And if, after feeling comfortable with Java, the leap from Java to C becomes reasonable too).

You'd want to learn C to get a feeling for how the computer works at the core, but more important than that you should be seeking a rock-solid foundation in proper coding methods and structures that has potential off-branches into your courses and your career.

From Java, you could pursue Android development or even Objective-C for iOS development. From C, that transition would be frustrating to say the least.

(Other points behind pursuing Java is you'd find it quicker to start testing on your local box without needing to seek help, it'd give you great insight into what an IDE is and why it is your best friend, and there are more community projects surrounding Java than C that you could start to participate in when you're ready.)

In the end, any language you want to learn would be a good language to learn (even Fortran), but you should go after a language that you can go from 0-to-novice on your own in a short time where you'll end having built a nice repertoire, and I think Java would best suit that need for you.

Post reply on HN