Live data from Hacker News

Ask HN: Should I learn C?

news.ycombinator.com

51–60 of 98 posts

Re: Ask HN: Should I learn C?

#51

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.

Objective-C is just a layer on top of C (and inlcudes a C interface to the runtime as well). Knowledge of pointers and memory management is required in Objective-C. Objective-C methods _are_ C functions. I would imagine it would be hard to be effective at Objective-C without a working knowledge of C.

Re: Ask HN: Should I learn C?

#52

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.

The answer is "yes, some". You will have to deal with pointers and memory allocation, though I believe the newest ObjC runtime has a garbage collector so your exposure might be limited... if you're lucky. ;) And you'll get a general exposure to C syntax, the compilation cycle, et cetera.

From a strictly pedagogic perspective, it would also be good to spend some time studying vanilla C and the POSIX APIs. When we say the phrase "learning C" in a thread like this one, we tend to actually mean "learning to work at a lower level of abstraction, closer to the OS, to assembly language, or even to the hardware itself". And I believe that most of iPhone development consists of telling Cocoa to do things, and Cocoa is presumably not a very low level API -- thank god.

However, any C is better than no C, and iPhone development is fun and useful, so if it inspires you, go for it.

Re: Ask HN: Should I learn C?

#53
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…

this makes me wonder if DHH (David Heinemeier Hansson) knows or has ever learned C.

Re: Ask HN: Should I learn C?

#54

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…

+1 learn different paradigms. Besides reading language tutorials, read some PLT (prog lang theory on Lambda the ultimate, and these survey type things. (And you'l frequently see ruby, python, erlang folks say "We have to drop down in C to get plausible performance" or "this algo was already thoroughly tested in C or java". You kinda have to know C and java to get s##t done.

http://mvanier.livejournal.com/998.html

http://matt.might.net/articles/best-programming-languages/

http://www.info.ucl.ac.be/~pvr/VanRoyChapter.pdf

http://www.info.ucl.ac.be/~pvr/paradigmsDIAGRAMeng101.pdf

http://www.slideshare.net/brweber2/functional-concepts-for-o...

-----------------

Oh, SICP and books like PL pragmatics

http://www.amazon.com/Programming-Language-Pragmatics-Michae...

----------------

and i love "Traps/pitfalls" from 1989!)

http://www.amazon.com/C-Traps-Pitfalls-Andrew-Koenig/dp/0201...

Re: Ask HN: Should I learn C?

#56
post #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 wan…

Definitely, and keep W. Richard Steven's 'Advanced Programming in the UNIX Environment' close by.

Re: Ask HN: Should I learn C?

#57
NO to C++! If you want to learn something that is object-oriented, go for Ruby... Much more accessible than C++, and also in demand.

As for C, yes, you should learn C. In several industry segments (such as embedded systems), you cannot even get an interview if you do not know C.

A nice way to do something in C is to write a text editor using ncurses for the GUI. This was something I did in my second year as a Comp Sci major in school, and it was a great experience (with a friend).

Re: Ask HN: Should I learn C?

#58
Yes learn it, you should also learn at least one language per paradigm, it will give you a wider perspective on programming and a flexible mind. IMHO one should learn at least: Haskell(or something ML based like OCaML or F#), C++(regardless of what anyone says it will be an useful insight), Java or C#(also check D if you want), something Lisp based(Scheme is small and simple), perhaps some Prolog, Erland and Ada.

Oh and see something of Forth if you like the looks of it and some assembly.

Re: Ask HN: Should I learn C?

#59
post #34

Earlier quoted context omitted.

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?

malapropism... think he meant 'obscene'.
Post reply on HN