5 ms·
To be fair, and definitely a part of its appeal, the K&R is only 312 pages long. It covers the language and most of the standard library you’ll need. As oppos
by vonwoodson 4y ago
To be fair, and definitely a part of its appeal, the K&R is only 312 pages long.
It covers the language and most of the standard library you’ll need.
As opposed to say, “Learn You a Haskell for Great Good! A Beginner's Guide” which is 881 pages and doesn’t even moderately cover the prelude.
Anyway, C is an amazing language and I keep a K&R on my phone as a pdf
- 1-more 4y agoMy copy of Learn You a Haskell ends on page 360 and the index is another 16 pages. Is this some weirdly shaped PDF of it with tiny phone-sized pages?
- sli 4y agoAccording to its listing on the No Starch website[0], the PDF is (currently) 400 pages. I'm not a fan of that particular Haskell book but it's in no way even close to 881 pages. [0]: https://nostarch.com/lyah.htm https://nostarch.com/lyah.htm
- b112 4y agoThat's 800 pages double sided! Simply because the back side is blank, is no reason to nitpick.
- tremon 4y agoI don't get it. Wouldn't 800 pages double-sided require a PDF containing 1600 pages?
- b112 4y agoSorry, been looking at new cars, and salespeople have been explaining new car, extended warranties to me.
- stonemetal12 4y ago400 single sided printed pages. If you are trying to inflate the page count that is 800 pages, but every other page is blank.
- deleted 4y ago[deleted]
- Kalq 4y agoWhy don't you like that book and which Haskell book would you recommend then?
- vonwoodson 4y agoCould be, now that you mention it. Which, now, makes me wonder if my K&R is even shorter.
- zh3 4y agoJust checked my first edition K&R (copyright date 1978, last page number is 228 (end of index) after which there is a single tearout page for other "High Quality C and Unix system titles" from Prentice Hall. There's also a front section that has about 10 pages in roman numerals (2 pages of prefix starting with 'ix') so about 240 pages total. Page 1 starts: "Chapter 0: Introduction".
- checkyoursudo 4y agoPage 1? What, it's not zero indexed?
- DonHopkins 4y agoIt looks like it's 1-indexed, but it core dumps when you get to the last page.
- DonHopkins 4y agoThere's one thing that's usually true about every well used copy of K&R, and that's that it always opens up easily and by default to the page with the huge operator precedence order and associativity table, because that's the page everyone needs to refer to the most often, which is usually bookmarked, but in an old copy doesn't even need to be. That says something about the C programming language design, that I as a deeply stack based FORTH programmer and explicitly parenthetical LISP programmer find horrible.
- dahfizz 4y agoJust use parentheses if you're doing many operations on one line? This is common sense in any programming language. I've been programming in C for years and never had an issue with operator precedence.
- wiseowise 4y agoComparing C to Haskell is like comparing razor to laser scalpel.
- bryanrasmussen 4y agoAnd not just any razor, a really useful one!
- pjmlp 4y agoOne of those that always cuts the user no matter how carefully they try to get hold of it.
- benj111 4y agoNo it's a tool. I suppose you could compare it to a table saw. C is one without a guard or any other safety measures, so you need to be careful not to cut your fingers off. More modern languages have the guard and break etc. For general use you probably do want all the safety bits, but occasionally it is useful to be able to take it off to do a weird cut on a weird bit of wood. None of that necessarily means you will cut your fingers off though.
- deleted 4y ago[deleted]
- pjmlp 4y agoWhich is why most workloads bring POSIX for the ride as means to make anything actually usefull.
- dahfizz 4y agoPOSIX is an OS API. You're complaining that C interacts with the operating system to do useful work? What language do you use that can do useful work without interacting with the OS?
- pjmlp 4y agoPOSIX is the part of the C standard library in UNIX, that should have been part of ISO C as well. It wasn't, so any C application that is more than a toy hello world with stdio, pings back into POSIX for any kind of meaningful work, that wants to stay cross platform. Basically it the the C runtime library, that wasn't part of ISO. I use JVM, .NET, Web and C++, not caring if the runtimes are bare metal or running on top of an OS, type 1 hypervisor, or whatever.
- salawat 4y ago>I use JVM, .NET, Web and C++, not caring if the runtimes are bare metal or running on top of an OS, type 1 hypervisor, or whatever. If you're downloading a JVM binary, you're missing out on the build step. It's C dependent, friend. How do you think that VM interfaces with the OS? Go on. Try it. ldd the java executable. It's libc all the way down. C itself is a sort of "VM" specification utilized to create the tools to run the tools to build the tools that make other high level languages possible. Unless you create something entirely custom in platform specific assembly, you're running on C at some level.
- dahfizz 4y agoI don't think you really understand what POSIX is. POSIX is an IEEE standard (example [1]). POSIX defines the Operating System API. You can see the C implementation of this API here[2]. > so any C application that is more than a toy hello world with stdio, pings back into POSIX for any kind of meaningful work Simply calling printf relies on writing to a file descriptor. A "Hello world" application on linux uses posix. ANY hello world application uses posix. Even your Java Hello world App will call into the posix APIs. `System.out.println` isn't magic. It calls into the C posix implementation. If you want to do anything in any language (write to files, create threads, allocate memory, network communication), you need to go through the OS. POSIX is what defines that OS interface. > I use JVM, .NET, Web and C++, not caring if the runtimes are bare metal or running on top of an OS, type 1 hypervisor, or whatever. So you use POSIX, you just don't think about it. [1] https://standards.ieee.org/ieee/1003.1/7700/ https://standards.ieee.org/ieee/1003.1/7700/ [2] https://en.wikipedia.org/wiki/C_POSIX_library https://en.wikipedia.org/wiki/C_POSIX_library
- metafunctor 4y agoMy Second Edition K&R (purchased in the mid-90s) is only 272 pages, including the index.