TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How We Wrote a Textbook

164 pointsby Mageekover 6 years ago

8 comments

pjscottover 6 years ago
This is awesome, and (since it looks like he came up with the setup) I declare Tim Wheeler personally to be awesome.<p>The thing kind of reminds me of the setup that Robert Sedgewick used for his algorithms textbooks. They&#x27;ve got code snippets, plus a <i>ridiculous</i> number of diagrams that visualize the algorithms step by step on toy inputs. They&#x27;re an incredible aid to understanding, and nobody would possibly have the patience to draw all those. The book even has extra-wide margins to hold them all!<p>Somewhere in the book (the preface?) he explains how the hell he drew all of those, and it&#x27;s a real story. He wrote the code snippets as full self-contained programs that `printf()` some algorithm visualization data as they go along. Then he used some literate programming tool to chop out the inessential parts for the book -- but he runs the programs also, somewhere in his makefile, and gets them to spit out their big list of numbers. He then converts this to a diagram using a widely-known command-line tool called &quot;cat&quot;: he wrote a bunch of diagram-drawing programs in PostScript, and they&#x27;ll have the necessary data waiting on the stack if he just appends them to the output of the code snippets.
评论 #18290083 未加载
babahoyoover 6 years ago
I weirdly love reading about other people&#x27;s workflow. This is really cool thanks for sharing.<p>One issue I have with literate programming is that its difficult enough to write code, now you have to worry about writing code in the middle of writing prose. For that reason I prefer to just have all my code output a bunch of latex files so I can separate the code-writing from the paper-writing. Which I guess is against the philosophy of literate programming as a whole...<p>How did you get around this? Do you share the same frustration that you are constantly being distracted by one or the other?
评论 #18290106 未加载
cossatotover 6 years ago
(Assuming that the author posted the page)<p>What is the license for the code samples? I seem to remember that the code in Numerical Recipes, which is stated as a similar book to some degree, is actually fairly restrictive [0].<p>[0]: <a href="http:&#x2F;&#x2F;mingus.as.arizona.edu&#x2F;~bjw&#x2F;software&#x2F;boycottnr.html" rel="nofollow">http:&#x2F;&#x2F;mingus.as.arizona.edu&#x2F;~bjw&#x2F;software&#x2F;boycottnr.html</a>
评论 #18290149 未加载
z4chjover 6 years ago
This looks like a great piece of hard work covering topics that are not easy to grasp. I am wondering why the author(s) chose to write their code samples in Julia. Most algorithm textbooks I have come across use their own &quot;pseudocode&quot; which often ends up being challenging to read, but in a perfect world, I would selfishly like to have all of the code snippets in Python. Even though this textbook doesn&#x27;t do that (although let&#x27;s not rule out future optimizations!), the amount of work that went into this was clearly astounding and well done.
评论 #18289588 未加载
评论 #18290125 未加载
评论 #18292175 未加载
gazarullzover 6 years ago
Can anyone recommend any good tools to generate diagrams&#x2F;visualizations of algorithms ?<p>Even better, some documentation&#x2F;article to build such a tool.
评论 #18291388 未加载
vedtopkarover 6 years ago
As a grad student that has started and re-started writing a textbook for a couple of years, this is super inspiring! I love hearing about clever LaTeX tooling too.
budadre75over 6 years ago
Looks like a great book, is there an online draft available?
评论 #18290432 未加载
deerpigover 6 years ago
Site is down for me....
评论 #18288813 未加载