6 ms·
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
by 0x008 6y ago
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?
- enriquto 6y agoJust read K&R for 10 minutes.
- vkazanov 6y ago:-) 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.
- icedchai 6y agoI taught myself C using K&R when I was a teenager... back in 1991. The second edition was only a couple of years old.
- redprince 6y agoMaybe there aren't any good alternatives to "read this go to book as the first book on the topic". Prove me wrong. (Please)
- shadowofneptune 6y agoIf an absolute beginner were to use K&R as a start they'd be learning C from 35 or so years ago. It's well written, but not helpful as a reference. Even something as simple as how a function is organized has changed. C Programming: a Modern Approach teaches C89 and C99, pointing out the differences in features when appropriate. Having used it myself this year, I found it much more helpful than K&R
- icedchai 6y agoIf you start with the second edition (C89 / "ANSI C"), you'll discover that C has barely changed.
- shadowofneptune 6y agoYes, that's true. C Programming is largely a C89 book with small segments about C99.
- rightbyte 6y agoThe book is fine. It is way better to start off by sorting words from stdin with K&R than to follow a tutorial to do a GUI window.
- wsc981 6y agoI thought the book by K.N. King was a great introduction to (modern) C [0]. Easy to follow, nice questions at end of each chapter including a few challenges. ——— [0]: http://knking.com/books/c2/index.html http://knking.com/books/c2/index.html
- 0x008 6y agoI assume you mean this: https://en.wikipedia.org/wiki/The_C_Programming_Language_(book) https://en.wikipedia.org/wiki/The_C_Programming_Language_(bo...
- enriquto 6y agoExactly. It's a great read, even if you don't plan on programming in C.
- pjc50 6y agoThe companion Programming in the UNIX Environment has some outdated details but a surprising amount of it still works.
- qsort 6y agoIt 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.
- 0x008 6y agoWell 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.
- qsort 6y agoIf 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.
- pjc50 6y agoI 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?)
- opheliate 6y agoIt'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.
- learnstats2 6y agoCS50 online course uses C from “Week 1” and it’s set up for you in a controlled learning environment while you learn concepts. If you have some programming experience you can probably jump straight to the Problem Sets.
- a-nikolaev 6y agoI have lecture notes for the intro programming course I taught a few years ago: https://a-nikolaev.github.io/cpp-spring-2015/ https://a-nikolaev.github.io/cpp-spring-2015/ It is actually in C++, but the goal was to cover C features first as the foundation, before going into objects, strings, and similar more advanced concepts. (It still uses C++ I/O from the very beginning, since it's was a C++ course.)
- cle 6y agoPersonally I think C isn’t useful to know topically. It really only became useful once I had a basic grasp on computer architecture, assembly language, and operating systems. Then suddenly its use made a lot more sense to me. If you’re not thinking about those things when writing C then you’re probably using it for the wrong reason, and there’s probably a better tool for the job.
- m1cl 6y agohttps://github.com/mcpcpc/kirc/blob/master/kirc.c https://github.com/mcpcpc/kirc/blob/master/kirc.c read this.