Live data from Hacker News

Getting started with C

not.cafe

11–20 of 106 posts

Re: Getting started with C

#11
post #5
post #3

Introducing newbies to GTK is a great way to show them a lot of code they don't understand, will take a while to understand, and will break in non-obvious ways.

I would be really interested in a course that actually holds true to the premise in the title here. I know my way around the JVM and python and started learning a little Rust on the side. However, I feel the need to at least dive my toes into C for a couple of weeks for completeness sake. Do you have a recommendation for something that is a little less than a book and a little more than learnCin10minutes?

It kind of depends on what you need out of C. The only real reasons left to use C in the wild are:

* Legacy code

* Embedded (including drivers, bare metal etc.)

* Portability, FFI, etc.

Performance used to be another major reason, but in $CURRENT_YEAR, if that's your goal, C++ and Rust are just as performant and there's very little reason not to opt into them.

The other major reason to learn C is that it's a great "hardcore introductory" language that will expose you to foundational concepts like pointers and memory management (it's really hard to understand what problems Rust is trying to solve if you're not familiar with malloc and free, for instance), but if you're already programming that's less of an issue.

Re: Getting started with C

#12
post #6
post #5

Earlier quoted context omitted.

I would be really interested in a course that actually holds true to the premise in the title here. I know my way around the JVM and python and started learning a little Rust on the side. However, I feel the need to at least dive my toes into C for a couple of weeks for completeness sake. Do you have a recommendation for something that is a little less than a book and a little more than learnCin10minutes?

Just read K&R for 10 minutes.

:-) I wish people would stop recommending this outdated book, along with a few other default goto books (say, the Dragon book).

Its super optimistic approach is more about the language K&R wanted C to be than the real thing.

Re: Getting started with C

#13
post #6
post #5

Earlier quoted context omitted.

I would be really interested in a course that actually holds true to the premise in the title here. I know my way around the JVM and python and started learning a little Rust on the side. However, I feel the need to at least dive my toes into C for a couple of weeks for completeness sake. Do you have a recommendation for something that is a little less than a book and a little more than learnCin10minutes?

Just read K&R for 10 minutes.

I assume you mean this: https://en.wikipedia.org/wiki/The_C_Programming_Language_(bo...

Re: Getting started with C

#14
post #5
post #3

Introducing newbies to GTK is a great way to show them a lot of code they don't understand, will take a while to understand, and will break in non-obvious ways.

I would be really interested in a course that actually holds true to the premise in the title here. I know my way around the JVM and python and started learning a little Rust on the side. However, I feel the need to at least dive my toes into C for a couple of weeks for completeness sake. Do you have a recommendation for something that is a little less than a book and a little more than learnCin10minutes?

It's a fairly controversial pick amongst the C community, and it is a full book, but the first few chapters of 'Learn C the Hard Way' by Zed Shaw are (imo) a great resource to get started with the language, and also point you towards tools like Valgrind which you might not come across otherwise.

Re: Getting started with C

#16
post #11
post #5

Earlier quoted context omitted.

I would be really interested in a course that actually holds true to the premise in the title here. I know my way around the JVM and python and started learning a little Rust on the side. However, I feel the need to at least dive my toes into C for a couple of weeks for completeness sake. Do you have a recommendation for something that is a little less than a book and a little more than learnCin10minutes?

It kind of depends on what you need out of C. The only real reasons left to use C in the wild are: * Legacy code * Embedded (including drivers, bare metal etc.) * Portability, FFI, etc. Performance used to be another major reason, but in $CURRENT_YEAR, if that's your goal, C++ and Rust are just as performant and there's very little reason not to opt into them. The other major reason to learn C is that it's a great "h…

Well for me one objective definitely would be to better my understanding of gnu tools, gcc etc.

But for the most part, yes it is about "foundational concepts". A lot of the time when you learn system level programming people will refer to certain quirks or terms from the C world.

Re: Getting started with C

#18
post #11
post #5

Earlier quoted context omitted.

I would be really interested in a course that actually holds true to the premise in the title here. I know my way around the JVM and python and started learning a little Rust on the side. However, I feel the need to at least dive my toes into C for a couple of weeks for completeness sake. Do you have a recommendation for something that is a little less than a book and a little more than learnCin10minutes?

It kind of depends on what you need out of C. The only real reasons left to use C in the wild are: * Legacy code * Embedded (including drivers, bare metal etc.) * Portability, FFI, etc. Performance used to be another major reason, but in $CURRENT_YEAR, if that's your goal, C++ and Rust are just as performant and there's very little reason not to opt into them. The other major reason to learn C is that it's a great "h…

I would still suggest that people learn C before attempting C++; while someone with C# or Java experience could probably do well in a "modern C++" codebase, as soon as they go off-piste into memory allocation and pointers they're in for surprises.

(Is there anyone who learns Rust who isn't already a proficient but frustrated C++ programmer?)

Re: Getting started with C

#19
post #6
post #5

Earlier quoted context omitted.

I would be really interested in a course that actually holds true to the premise in the title here. I know my way around the JVM and python and started learning a little Rust on the side. However, I feel the need to at least dive my toes into C for a couple of weeks for completeness sake. Do you have a recommendation for something that is a little less than a book and a little more than learnCin10minutes?

Just read K&R for 10 minutes.

The companion Programming in the UNIX Environment has some outdated details but a surprising amount of it still works.

Re: Getting started with C

#20
post #16
post #11

Earlier quoted context omitted.

It kind of depends on what you need out of C. The only real reasons left to use C in the wild are: * Legacy code * Embedded (including drivers, bare metal etc.) * Portability, FFI, etc. Performance used to be another major reason, but in $CURRENT_YEAR, if that's your goal, C++ and Rust are just as performant and there's very little reason not to opt into them. The other major reason to learn C is that it's a great "h…

Well for me one objective definitely would be to better my understanding of gnu tools, gcc etc. But for the most part, yes it is about "foundational concepts". A lot of the time when you learn system level programming people will refer to certain quirks or terms from the C world.

If you're just looking for a cursory introduction to the underlying concepts, I agree with the other comments that K&R is what you are looking for. I'd add the caveat that due to the fact that C is a tiny language with a tiny standard library, most code you'll see in the wild uses custom concepts/libraries/object models on top of C. So for most practical purposes, there isn't really "C" as much as there is "unix programming C", or "embedded C", or whatever else have you, and all of them add a thick layer on top of the core language.
Post reply on HN