Live data from Hacker News

Programming book authors: put all the code in the book

logicgrimoire.wordpress.com

61–70 of 83 posts

Re: Programming book authors: put all the code in the book

#61
post #47
post #15

Earlier quoted context omitted.

A cheap USB drive sells for under $10 and you can seal a book in plastic so I'd imagine it'd be feasible to just add the $5-$10 to the price of the book. People who buy books, especially programming books, generally aren't very price sensitive anyway.

Can we attach an attack vector to the book cover? Sure. I wouldn't let that USB anywhere near my computer if I'd bought it let alone a library copy of it. I'm with the author on this one. Any code needed to for it be useful should be printed in the book (perhaps complete code in an appendix rather than right there in the chapter). That said I haven't bought a programming book in years.

The universal nature of USB is a huge drawback for its usage for storage.

But well, the trend has been to consolidate anyway. Now even power comes through an universal interface, so you can't use power outlets in places that you don't trust.

Re: Programming book authors: put all the code in the book

#62
post #29

Bring back the 90's antipattern of making the book so thick you use it as a monitor stand.

"Teach yourself J2EE in 21 days, 2nd edition" remains marvellous for this :-D

Mine (archived by still in possession) are FreeBSD 6.0 Unleashed and some compendium of Computer Science articles from ACM circa 2004.

>FreeBSD is extremely robust and powers some of the largest internet sites in world including Yahoo!. FreeBSD 6 Unleashed provides complete coverage of everything you need to know to use FreeBSD to its full potential, including coverage of FreeBSD 6.0. This edition includes updated coverage of Apache, MySQL and Sendmail, as well as added coverage of PowerPC support for Macintosh G3 and G4 platforms. This is the most up to date, comprehensive reference on the market covering FreeBSD 6.0.

Re: Programming book authors: put all the code in the book

#64
post #59
post #8

Just glue an envelope with a CD to the backcover, this is what people were doing before your fancy internets became a thing. But really, if you a writing a book on a modern language, and your code has external dependencies, chances are it will not build 5 years forward, even if there are no URLs directly in the book.

It's 2024, books must also come as digital-only. I agree that the obsolescence rate has skyrocketed, as a side-effect of always-online development.

I have many hundreds of tech book PDFs (largely due to Humble Bundle and a Manning subscription) and I’m confident I’ll have no difficulty opening those PDFs far into the future.

Re: Programming book authors: put all the code in the book

#65
post #29

Bring back the 90's antipattern of making the book so thick you use it as a monitor stand.

I don't think I'd call that an antipattern, tbh. Lots of things did this - I remember our CIO bought us all fancy IDE thingies back in the early J2EE days; I forget what it was, JBuilder, maybe? Everyone was using Eclipse (or us greybeards sticking to our emacs and ((neo)v)im, by then so we ALL used them as monitor stands.

I think copying fifteen pages of code by hand, then going back through everything to find the typos you made, is the anti-pattern.

Re: Programming book authors: put all the code in the book

#66
post #50
post #25

Bugs emerge. Tools change. How do you update code printed in a book? If a book can be written in such that it does not need to change, then by all means, carefully proof and test all the code and hard code it into the book. But that's simply feasible in many cases. Better a book with some external resources than no book at all? (Oh, and let's set aside the cases where the links to external resources are done in a hor…

this is a fully general criticism of printing anything in a book; it's not an argument against printing code in books, but against books themselves

I really don't think you read and understood my post.

I thought I made it clear, but I'll try again:

There are two cases.

One, where a book can be written in a self-contained manner, without urls to external resources. As you can see, I am happy with this case (which means you really can't conclude I'm criticizing printing thins in a book.)

And another case where it isn't feasible to write the book in a self-contained manner. In that case, the choice is between a book with urls to external resources or no book at all. OPs blanket stance against URLs in books is short-sighted because the only way it can be realized is to simply have fewer choices of books.

Probably OP should argue that books should have as few urls to external resources as possible, and the subject of those urls should be inherently dynamic and fundamental to the book, and the book should include a credible plan for maintaining the external resources for the useful lifetime of the book (which could be a long time).

Sorry, this may be too nuanced for the internet.

Re: Programming book authors: put all the code in the book

#67

1. Print the source code in a micro-barcode in a physical appendix. 2. Make the first exercise in all books be to code a simple barcode image interpreter. And just include the walkthrough and source as typed text. You should be able to get a few MB on a page easily. Future proof as long as there are cameras on phones.

> You should be able to get a few MB on a page easily A few hundred Kb, maybe, but a few MB seem unlikely. If I take the best case scenario (no optical aberration, perfect sensor...), my phone has a 48MP camera. We cannot have 48M * 3 colors as those 48MP are after Bayer matrix handling. We also cannot have more than one bit of information per pixel, due to printing often not having "real" greyscale but some kind of…

I think you confused printed pixels with camera pixels along the way.

Re: Programming book authors: put all the code in the book

#68
post #29

Bring back the 90's antipattern of making the book so thick you use it as a monitor stand.

"Teach yourself J2EE in 21 days, 2nd edition" remains marvellous for this :-D

My copy of 'Programming Perl' is the thickest book on my shelves, narrowly beating out 'The Peloponnesian War' (though the latter is taller, so it's hard to say which is the longer read).
Post reply on HN