9 ms·
21st Century C (new book)
- bsg75 14y agoAny opinions on the book? I have been away from C for about 15 years, and would like to get back into it. This sounds like it may be a good place to (re)start.
- reedlaw 14y agoI've been reading the early release. So far it's the best resource on C I've come across, although I am a C beginner. It's quite practical, focusing on basic tools at the start and then getting into syntax, code structure, and libraries.
- roco 14y agoIt is not bad. It could be better and go into more depth I feel. If you are curious, here are some things I found. Rather damn good advice. And free like beer should be. http://c.learncodethehardway.org http://c.learncodethehardway.org C grammar pocket reference. Pure cheating. Actually has the sample code on how to use C. http://www.amazon.co.jp/dp/4774146102 http://www.amazon.co.jp/dp/4774146102 Messing with C programs makes things easier. http://nostarch.com/debugging.htm http://nostarch.com/debugging.htm I hate it. Mainly because the layout and design gets to me. But I can't deny that it has good info. http://shop.oreilly.com/product/0636920015482.do http://shop.oreilly.com/product/0636920015482.do The next book to read after your intro to C. Actually explains how to write C programs after you know the grammar. http://www.amazon.co.jp/dp/4774146129 http://www.amazon.co.jp/dp/4774146129 Says object oriented C. But actually it is about using scoping in C to organize your code. http://www.amazon.co.jp/dp/4798121134 http://www.amazon.co.jp/dp/4798121134 Just about every way you can debug your C program. www.amazon.co.jpdp/4774133620 Starting Linux programming. Shows how to use system calls. And make a simple web server. http://www.amazon.co.jp/dp/4797328355 http://www.amazon.co.jp/dp/4797328355 100 Examples of C programs. Brute force yourself into using learning C. http://www.amazon.co.jp/dp/4798017396 http://www.amazon.co.jp/dp/4798017396 How to use various C libraries like BLAS and Cairo in C. http://www.amazon.co.jp/dp/4797361204 http://www.amazon.co.jp/dp/4797361204 I know what you are saying, most of these are in Japanese. But the code is not. And rather easy to look at the code and see what they are doing. Anyhow, live dangerous I say. Not many books in English explain this stuff it seems. However, if anyone has nice C related info in any language, I would be appreciative.
- mitchi 14y ago"It's only in Japanese". You realize your language is crazy-hard? I wish you had no kanji, it would make my life easier. nihongo ga muzukashi desu...
- cperciva 14y agoUse Autotools, C’s de facto cross-platform package manager Seriously? There is a world outside of GNU...
- shin_lao 14y agoCMake for example, is IHMO, a better choice.
- cperciva 14y agoDifferent tools for different tasks. Autotools is horrible, but there are times when it is less horrible than any other options. The same is probably true of CMake. Personally, I stick to POSIX make for most of my code -- and handle cross-platform issues by assuming POSIX compliance and telling people to fix their damn OSes if they're not POSIX compliant.
- kstenerud 14y agoYeah, that's right! Blame the user! That'll teach 'em!
- jlgreco 14y agoFrankly, depending on the nature of the product, that is the best option. Projects with small teams who have programmers as audiences can reasonably target POSIX and let their users work out their personal issues themselves. If they are using something particularly weird, that is their own damn fault and they should take responsibility for that. If not, chances are they won't have a problem. Running HP-UX with a GNU Hurd kernel on your toaster? Fix it yourself. Sure, I'm sure autotools could cover that situation, but seriously, just fix it yourself.
- kstenerud 14y agoIt's fine to have a limit to what you'll support, but please lose the arrogance and condescension. A user's choice of OS is made based on a number of concerns, some of which he has no control over. Disparaging his choice or saying it's their own damn fault or "fix it yourself" is incredibly rude, especially when you can tactfully say "We currently support the following systems:" or "We currently only support systems that can run autotools, which includes the following popular operating systems:" and maybe even add "Code contributions to expand support are of course welcome!" That's a damn sight nicer than "but seriously, just fix it yourself."
- meaty 14y agoI was excited until I saw "use autotools". edit just bought it. Quick scan reveals some GNU extensions being used, lots of tripe about pkg-config, autotools, how to write a makefile properly without autoconf (commendable), gdb tutorial (looks resonable), short valgrind mention, unit testing, doxygen, proper assertions (woot!), short bit on VCS with git (looks reasonable), integration with python (looks reasonable), decent discussion on aliasing and copying, some serious standard-breaking things (bad), how not too shoot yourself with macros (good), linking discussion (looks ok), an odd quote from pussy riot, lots of discussion of gotchas, unicode (good!), some stuff to do with glib (yuck), OOP in C (looks ok), more glib stuff (yuck), posix threading (some mines in there), GSL (good), SQLite (good), libxml (yuck - personal preference though), libcurl (good). So generally a mix of good and bad. Probably worth it though.
- pja 14y agoIs there an alternative that actually works?
- meaty 14y agoYeah: make and knowing what you are doing. I've built some seriously complicated stuff which builds on Linux, Solaris and FreeBSD in the past with no autoconf magic required. Autoconf is just a massive Rube Goldberg machine in disguise.
- mhd 14y agoIt arose out of a different time. Linux/Solaris/BSD are trivial, compared to all the differences of the commercial unices of ages past, with their idiosyncratic libraries, BSD vs. SysV vs. POSIX, never mind all the different compilers. People would've sacrificed their firstborn to get something running on both HP/UX and SunOS, compared to that autotools was a blessing. I think there are more papers on build systems than on sort algorithms.
- meaty 14y agoI've been through that as well. I have in the past just provided a different Makefile for each platform and run as follows: make -f Makefile.osf1 make -f Makefile.sunos4 make -f Makefile.sunos5 There is usually little difference between them - mainly compiler names/flags and the occasional def for code. Occasionally make is broken at which point you have to frig something. Keep It Simple is the #1 rule. Rule #2 is every bad thing you do will do two things bad back to you in the future.
- konstruktor 14y agoUnicode is part of the TOC. That's a good sign.
- Jach 14y agoLooks potentially interesting, though I think I'd still recommend Zed's Learn C the Hard Way instead. http://c.learncodethehardway.org/book/ http://c.learncodethehardway.org/book/ Zed's book is supposed to be a "beginner" book but it sure does cover a lot...
- meaty 14y ago+1 for Zed's book. I wish he'd finish it though :)
- marquis 14y agoAnything similar to this for C++? We're looking for good teaching books at the moment.
- fusiongyro 14y agoThe new edition of the C++ Primer is helping me quite a bit. It explicitly notes which things are from C++11 and which aren't, and they talk quite a bit about the new stuff. I had tried to learn from Stroustrup before C++11 and didn't get as far.
- fceccon 14y agoI'm reading C++ Primer 5/e at the moment and I'm enjoying it so far. I like how it starts using the hight level containers before introducing other more low-level structs. The second part is a nice overview of the C++ Library so you won't end reinventing the wheel when writing your first programs. Also the Kindle edition is really well done. The biggest flaw of this book is that's huge.
- fusiongyro 14y agoIt would be hard to write a short introduction to C++ that didn't leave you pretty unprepared though.
- mhd 14y agoFirst or second books? Stroustrups Programming Principle and Practice is quite good as a starter book. Not quite C++11, if I remember correctly, but further along than just C with Classes. There's also Alexandrescus "Modern C++" book, but even that is now a decade old. We'll have to see what turns up in the wake of the recent standard, so far it's mostly introductions to new features and some updated references, useful for someone getting reacquainted with modern features, but no K&R of C++11 yet.
- law 14y agoModern C++ Design (Andrei Alexandrescu)[1] is wonderful, but C++11 has "simplified" much of what he covers. If you want to be able to read the C++11 standard[2] with little effort, Alexandrescu's book is nevertheless a good primer. [1] http://www.amazon.com/Modern-Design-Generic-Programming-Patterns/dp/0201704315 http://www.amazon.com/Modern-Design-Generic-Programming-Patt... [2] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n333...
- chanux 14y agoOn O'reilly - ebooks minus the DRM - http://shop.oreilly.com/product/0636920025108.do http://shop.oreilly.com/product/0636920025108.do
- fusiongyro 14y agoFor an extra $10.
- ConstantineXVI 14y agoWhich gets you guaranteed platform independence (as well as the PDF edition, if you want the print-like layout). Fair price for some.
- cydonian_monk 14y agoWhich is why I now buy O'Reilly books direct from them. However, while digging around in my older ebooks, I discovered the O'Reilly books I bought through Apple or B&N were also drm-free. Not sure if that's now also the case with Kindle versions... but as mentioned there are other perks of buying direct from O'Reilly.
- ConstantineXVI 14y agoI remember hearing Amazon now allows publishers to opt-out of DRM. .mobi doesn't always cleanly convert to ePub though, so having multi-format from the source is still helpful.
- ansible 14y agoAnd O'Reilly gives you free updates forever. And if you subscribe to their newsletter, you'll occasionally see 50% off promo codes. This HN posting was particularly ill-timed, they had a promo code for this particular book that expired on Nov 13th.
- ConstantineXVI 14y ago
- benihana 14y agoSo I'm a web developer, as I imagine a large portion of the Hacker News community is. I learned to program on C in college, but am interested in learning a more proper (in the engineering sense) way of programming C. Should I look at this book? Should I just read Zed's Learn C the Hard Way?
- trippplezz 14y agoI would recommend "C: A Modern Approach", 2nd ed by King (http://www.amazon.com/Programming-Modern-Approach-2nd-Edition/dp/0393979504/ref=sr_1_1?ie=UTF8&qid=1353084145&sr=8-1&keywords=c+a+modern+approach http://www.amazon.com/Programming-Modern-Approach-2nd-Editio...) It's a hefty tome but that's not necessarily bad if you want to (re-)learn the language and the tricks in a proper way. Easily in my personal Top 5 books for C (The others are in no particular order: "Pointers on C", "Expert C Programming: Deep C Secrets", "The Standard C Library", "C Interfaces and Implementations".)
- pav3l 14y agoI just ordered it 2 days ago directly from O'Reilly website (they currently have "buy 2 get 1 free" promotion, just use code OPC10, http://shop.oreilly.com/product/0636920025108.do http://shop.oreilly.com/product/0636920025108.do). Really excited to read it when it comes. In case you're curious the other 2 books I ordered were "Python for Data Analysis" and "JavaScript Web Applications" which also look very promising. Edit: Sorry, not a referral link.
- acangiano 14y agoActually this doesn't appear to be a referral link (e.g., an affiliate link). http://www.amazon.com/21st-Century-Tips-New-School/dp/1449327141/ref=sr_1_1?ie=UTF8&qid=1353079717&sr=8-1&keywords=21st+century+c http://www.amazon.com/21st-Century-Tips-New-School/dp/144932... There is no associate tag.
- acangiano 14y agoSorry for the shameless plug, but to discover books like this people can use my project, http://anynewbooks.com http://anynewbooks.com. If you subscribe to the category Programming, either via feed or via email, you'll definitely learn about new gems coming out. For example, 21st Century C was picked as the Staff Pick for the Programming category last week.
- siodine 14y agoPlease implement RSS.
- acangiano 14y agohttp://anynewbooks.com/category/programming/feed/ http://anynewbooks.com/category/programming/feed/
- dmlorenzetti 14y agoI wouldn't call this a shameless plug. AnyNewBooks is a great resource; indeed, I already have this book based on your website.
- mej10 14y agoSo, I studied C in college and really enjoyed it. It really fit my style of thinking at the time (having a mental model of what the machine is doing is really valuable). I wrote a game in C/OpenGL, but really didn't learn much about "modern C" or much of the ecosystem other than doxygen/make/gdb. These days I primarily program web services and iPhone apps in Ruby, occasionally using Java for performance issues. Is there any good reason for me to further my C knowledge?
- natemartin 14y agoLooks really interesting. I mainly use C while working on embedded code, how applicable is this book to embedded C? If this isn't a great resource for embedded C, can anyone recommend a different book?
- drudru11 14y agoI know C well, but check out links like these on news sites occasionally. (Just like this story) This book reminded me of an online C tutorial that proceeded to teach C in a functional style. I don't remember if they explicitly stated it was FP when presenting the material. The style was really clean. The author avoided assignment as much as possible. All variables were initialized as if they were 'let' statements. Variables were never re-used. I just can't find the link anywhere. Does anybody know that web page that I'm referring to?
- e12e 14y agoNot sure if I'm thinking of the same thing, but I believe Cornell's former introduction to computer science used C and a functional style. I'm also unable to find a description online, now. I was handed a few lecture notes by my former professor who interned there in the 90s or so. edit: To clarify, I looked, but couldn't find the notes right now either. Not sure if I still have them.
- e12e 14y agoSome relevant links I did find: "The Function Pointer Tutorials": http://www.newty.de/fpt/index.html http://www.newty.de/fpt/index.html "Functional C" http://eprints.eemcs.utwente.nl/1077/ http://eprints.eemcs.utwente.nl/1077/ "The C Language is Purely Functional" - a satirical, but also, thoughtful post that I don't think has been submitted to HN before (or the search system is rubbish): http://news.ycombinator.com/item?id=4800922 http://news.ycombinator.com/item?id=4800922 or: http://conal.net/blog/posts/the-c-language-is-purely-functional http://conal.net/blog/posts/the-c-language-is-purely-functio...
- deleted 14y ago[deleted]