Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Bend 2 and the Vibe-Coding Trap(liampwll.com ↗)
    112comments
  2. An Empirical Study of Harness Design for Coding Agents(arxiv.org ↗)
    2comments
  3. ZCode, the GLM coding agent, silently uploads your Git history(tokenstead.ai ↗)
    42comments
  4. OpenJev(openjev.com ↗)
    163comments
  5. I don't like passkeys(hawksley.dev ↗)
    176comments
  6. The Shadows Lurking in the Equations – Underwater Islands(gods.art ↗)
    2comments
  7. AI chatbots becoming experts at changing people's minds. What's their secret?(science.org ↗)
    discuss
  8. Subnormal floating-point numbers are expensive on Intel processors(lemire.me ↗)
    25comments
  9. Jemalloc 5.4.0(github.com/jemalloc ↗)
    58comments
  10. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  11. Microsoft exec called AI scraping 'the largest theft of labor in human history'(techcrunch.com ↗)
    391comments
  12. Warren Buffett Steps Down as Berkshire Chairman, Names Son to Replace Him(nytimes.com ↗)
    85comments
  13. Replacing Pull Requests with Delta(zed.dev ↗)
    38comments
  14. If materialism is true, the United States is probably conscious(jstor.org ↗)
    21comments
  15. The scourge of x86 emulation(fex-emu.com ↗)
    53comments
  16. Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint(prismml.com ↗)
    158comments
  17. Show HN: Navier-Stokes Visualized as 1kB i386 demos(juandecos.github.io ↗)
    3comments
  18. Astra for Law(openai.com ↗)
    635comments
  19. Bend – A language that blocks AI mistakes via proof, on CPU and GPU(bend-lang.com ↗)
    262comments
  20. Qwen 3.8 Omni Flash(qwen.ai ↗)
    98comments
  21. Hister: A private search engine for the pages you visit and the files you keep(github.com/asciimoo ↗)
    176comments
  22. Wax motor(wikipedia.org ↗)
    85comments
  23. When the fractional part of a float fixes your shader(crocidb.com ↗)
    10comments
  24. Fujitsu launches made-in-Japan next-generation CPU FUJITSU-MONAKA(global.fujitsu ↗)
    239comments
  25. Pre-Greek: The lost language hidden within Ancient Greek(linguisticdiscovery.com ↗)
    55comments
  26. How to Write with an LLM(sockpuppet.org ↗)
    158comments
  27. Dr Julius Neubronner's Miniature Pigeon Camera(publicdomainreview.org ↗)
    discuss
  28. A heap overflow and SSO misconfiguration to compromise OpenAI internal repos(hacktron.ai ↗)
    168comments
  29. Shapelearn Qwen 3.8 27B (13.1 GB VRAM)(byteshape.com ↗)
    24comments
  30. Telstra outage: The night a network decided the year was 2006(netnod.se ↗)
    31comments

The Yoda of Silicon Valley

976 pointsby 7y agonytimes.com
331 comments
7y agoHN ↗

I saw him in a parking lot at Stanford one time; I'd say 6' and change.

7y agoHN ↗

What NYT thinks devs are doing in Silicon Valley: AI and machine learning hacking in VR 3D

What devs are really doing in Silicon Valley: debugging yet another "undefined is not an function"

7y agoHN ↗

Most of programming is just moving shit around; not interesting mathematics like knuth has done

7y agoHN ↗

We're 21st century plumbers.

I tell people this all the time when they ask what I do. I've met quite a few master plumbers, and they are extremely intelligent technical geniuses for the most part. I'm completely convinced that I would have been one of them (or some other trade craft) if I were born 50 years ago.

7y agoHN ↗

- IT: Sanitation engineers

- Developers: Hazmat engineers

- CS: Civil engineers

7y agoHN ↗

Sounds accurate to me, but I'm interested if people will downvote you because they don't like the IT line.

7y agoHN ↗

Looks like it gets worse down the list, so I don't think the IT folk will complain too much.

edit: Yes, whether you feel "Civil engineering" is worse than "Hazmat engineering" is a subjective matter.

7y agoHN ↗

IT: Garbage truck operators

Developers: Garbage truck service/maintenance department

Devops: Mechanic's apprentice who sometimes has to fill in for garbage truck drivers who no-show.

Contractor: Mobile service tech gets called in to weld up stuff when it's broken beyond what the in-house team can handle.

CS: Guys who plan the garbage trucks' route.

Not everything is "engineering".

Edit: You people take yourselves too seriously.

7y agoHN ↗

- IT: Deployment

- Dev: Implementation

- CS: Design

7y agoHN ↗

What NYT thinks devs are doing in Silicon Valley: AI and machine learning hacking in VR 3D.

Funny, the article doesn't mention any of those topics at all (except for AI - but only as a way of introducing John McCarthy). Meanwhile we do do things like "finding all occurrences of a given word or pattern of letters in a text" quite frequently. And we are utterly dependent on technologies (e.g. databases, networks) based very strongly on the bread-and-butter content of Knuth's books.

I agree, though that for most of us, chasing down "undefined is not a function" and its variants tends to rule the day.

7y agoHN ↗

debugging yet another "undefined is not an function"

Hey, you're lucky. I'm not in silicon valley, so I spend all my time debugging "I had a problem with the app but it hasn't happened in about a week and I can't remember exactly what the problem was, I need you to fix it or I'm going to escalate to your manager"

7y agoHN ↗

My favorite one of these was from a coworker having trouble getting his presentation up. "People outside the tech industry ask 'Will a computer take my job?'; people inside the tech industry ask 'why won't this damn projector work?'"

7y agoHN ↗

Hmpf, considering that the author spent a whole day with Knuth there is disappointingly little interviewing going on. Other people (e.g. Norvig) are quoted more extensively.

7y agoHN ↗

At Knuth's current age-related physical state, he probably didn't say much over the course of a day.

7y agoHN ↗

He still looks pretty healthy and mentally sharp.

7y agoHN ↗

That picture with Knuth and TeX is really beautiful to me.

7y agoHN ↗

Ok, so this journalist gets to spend WHOLE day with Knuth and all we get is some bits of history and quotes from couple of Google guys. Massively lost opportunity to provide window in this legends daily life, thoughts and habits...

7y agoHN ↗

To be fair though, Peter Norvig is a lot more than just a "Google guy". I'd happily read an article that's nothing but Norvig quotes.

I thought that the article was pretty decent, considering it is aimed at an audience of people who aren't computer scientists and who have never heard of Donald Knuth.

7y agoHN ↗

At age 19, Dr. Knuth published his first technical paper, “The Potrzebie System of Weights and Measures,” in Mad magazine.

I'd say she did something positive with the opportunity.

7y agoHN ↗

I have a copy of the issue, so when I went to see one of his Christmas Tree Lectures a few years ago I took it with me to get signed after the talk.

Instead of just signing it, he opened to his article and corrected a typo in the Potrzebie article--I think it amounted to two numbers being transposed somewhere around the millionths place (My copy is packed away from a recent move so it's not too convenient to verify).

What was funny was he had a poem he used to remember the order of the numbers after the decimal. He couldn't quite remember it, so he ssh'd into his home machine (or University, dunno), fired up Emacs, and opened a file containing the poem. Then he corrected the typo.

And that's how Donald Knuth "signed" my copy.

7y agoHN ↗

+1 I was behind you in this line and can confirm this story :-) He was surprised someone brought this and IIRC asked you how you got hold of this MAD magazine issue. I remember him not wanting to sign without fixing the typo, and also ssh-ing to find the correct numbers after he wasn't sure he remembered them.

7y agoHN ↗

Wow, that's wild. It makes me happy someone else remembers it. I kinda figured it was just me as I think I attended the lecture alone that year--pretty sure it was 2015.

FTR, the answer to how I got it: I made an off-hand comment to my wife about the magazine and she tracked it down for the next gift-giving occasion.

7y agoHN ↗

That is so cool! He really liked the question!

7y agoHN ↗

Thanks for sharing this. Definitely made my day :D

7y agoHN ↗

I wish the guy would have let him answer as to what the CompSci equivalent of that T-Shirt is.

7y agoHN ↗

Right? Because of that interruption we never get to have Don Knuth approved compsci T-shirts. Think before you act!

7y agoHN ↗

A few years ago, while doing a bit of a family history research project (Knuth was my father's PhD advisor at Stanford), I stumbled across a rather awesome t-shirt design. May I humbly submit "Knuth is my homeboy" as my entry to the CompSci t-shirt contest. (not my own design, to be clear, I just came across it on the internet)

https://geekz.co.uk/shop/store/show/knuth-tshirt.html

And here is a shot of the recursive shirt in action: https://laughingsquid.com/jacob-appelbaum-donald-knuth-demon...

7y agoHN ↗

Is there any way we could ask him? I don't wear Compsci T-shirts but I would wear a Don Knuth-designed one.

7y agoHN ↗

The word he used was "a t-shirt that would be an _analog_."

7y agoHN ↗

That's funny. This is the best thing I've ever found on HN. Thank you.

7y agoHN ↗

Reminds me a bit of Professor Neutron (Bob Newhart) in the Big Bang Theory!

7y agoHN ↗

What a wonderful and genuine human being! It helps explain why his books are so incredibly humane while remaining deep on a very broad topic. Thanks for sharing. ️

7y agoHN ↗

that's my favorite gag from the Firefly tv show.

Simon: Are you Alliance?

Early: Am I a lion?

Simon: What?

Early: I don't think of myself as a lion. You might as well though, I have a mighty roar.

Simon: I said "Alliance."

Early: Oh, I thought...

Simon: No, I was...

Early: That's weird.

7y agoHN ↗

I lived in Sweden for a while, Swedes are very proficient in English. Yet, they almost always pronounce ch as sh. They even have TV ads that make fun of this.

7y agoHN ↗

It took me the longest time before I understood that ad, since the sheep speaks fluent "American".

While on pronounciation topics, how does one pronounce "Knuth"? Is the k silent like in "know"?

Edit: According to Wikipedia it is kə-NOOTH.

7y agoHN ↗

My favorite Knuth story, attributed to Alan Kay (if you're around, would love confirmation):

When I was at Stanford with the AI project [in the late 1960s] one of the things we used to do every Thanksgiving is have a computer programming contest with people on research projects in the Bay area. The prize I think was a turkey.

[John] McCarthy used to make up the problems. The one year that Knuth entered this, he won both the fastest time getting the program running and he also won the fastest execution of the algorithm. He did it on the worst system with remote batch called the Wilbur system. And he basically beat the shit out of everyone.

And they asked him, "How could you possibly do this?" And he answered, "When I learned to program, you were lucky if you got five minutes with the machine a day. If you wanted to get the program going, it just had to be written right. So people just learned to program like it was carving stone. You sort of have to sidle up to it. That's how I learned to program."

[0] http://www.softpanorama.org/People/Knuth/index.shtml

7y agoHN ↗

There's another interesting story about Knuth that's worth repeating here.

http://www.leancrew.com/all-this/2011/12/more-shell-less-egg...

The tl;dr is that Knuth wrote an elaborate implementation of a program to solve a particular problem, and Doug McIlroy replaced it entirely with a six step shell pipeline. (Knuth's program was written using his literate programming tools, could be typeset in TeX, and involved some precise work with data structures and algorithms.)

I love this story as an example both of Knuth's genius and perspective, but also as a way to show what his level of dedication can achieve. It's an amazing intellectual accomplishment.

I also love this story as a demonstration what those of us without that skill and dedication can achieve using the advancements built on the work of Knuth and others.

7y agoHN ↗

I love that story, although I think the takeaway needs to be slightly updated. It's quite possible that a sorted word count was easiest to do with bash and unix utilities in 1992. Now, it's easier and more comprehensible in your favorite scripting language (which I'm assuming isn't bash).

The real lesson is to program using the most powerful tools at your disposal.

7y agoHN ↗

That's a good lesson, but we shouldn't stop there. Knuth is a computer scientist, but also an artist: writer, musician, typographer, and creative programmer. His insights into programming-as-literature have infused an often-soulless industry with something soulful. He began with the popular notion that programming should be a creative, playful act, and tried to elevate mere playfulness into the realm of fine art. An incredible detour in an amazing career, and an enriching lesson of a different kind.

7y agoHN ↗

And a theologian, he has has written works on divinity, etc..

7y agoHN ↗

It's quite possible that a sorted word count was easiest to do with bash and unix utilities in 1992. Now, it's easier and more comprehensible in your favorite scripting language

It'd be interesting to see how true this is in reality. I'm not at all convinced that most scripting languages can do this quite as concisely as bash and the Unix userland. (But, being honest, this problem seems very well aligned to that tooling's strenghts.)

7y agoHN ↗

Well, what is easy or comprehensible isn't necessarily concise. Bash is great for code golf but I know few people who prefer to code in it.

7y agoHN ↗

And for completeness, a Ruby implementation:

  puts STDIN.read
    .split(/[^A-Za-z]+/)
    .group_by(&:downcase).transform_values(&:size)
    .sort_by(&:last).reverse
    .take(ARGV[0].to_i)
    .map{ |l| l.join("\t") }.join("\n")

Wordier than the bash script, but still pretty short and fairly trivial. Anyone could make this in five minutes.

7y agoHN ↗

It is easy to do in your favorite scripting language. But is unlikely to be as short. Comprehensibility is in the eye of the beholder.

Here is a Perl solution for comparison.

    use strict;
    use warnings;

    my $limit = shift @ARGV;

    my %count;
    for my $line (<>) {
        while ($line =~ /(\w+)/g) {
            $count{lc $1}++;
        }
    }

    @words = sort {$count{$b} <=> $count{$a} or $a cmp $b} keys %count;
    $limit = @words if @words < $limit;
    print "$_\t$count{$_}\n" for @words[0..($limit-1)];
7y agoHN ↗

Python is relatively short, batteries included and all that:

  import re
  import sys
  import collections
  
  words = re.findall('[a-z]+', sys.stdin.read().lower())
  c = collections.Counter(words)
  for word, count in c.most_common(int(sys.argv[1])):
      print(f'{count:>7} {word}')

Three times the character count of the Unix pipe version, but IMHO a lot more readable (and generalisable).

7y agoHN ↗

You don't want to read all input into memory first.

7y agoHN ↗

Fair enough.

  import re
  import sys
  import collections
  
  c = collections.Counter()
  for line in sys.stdin:
      words = re.findall('[a-z]+', line.lower())
      c.update(words)
  for word, count in c.most_common(int(sys.argv[1])):
      print(f'{count:>7} {word}')
7y agoHN ↗

Just for reference: a Perl 6 version:

    sub MAIN($limit = Inf) {
        my %bag is Bag = words.map(&lc);
        say "{.key}\t{.value}" for %bag.sort( {
          $^b.value cmp $^a.value || $^a.key cmp $^b.key
        } )[^$limit]
    }

And for what it's worth, the `words` function is lazy, so it won't read all of the words into memory first.

7y agoHN ↗

I would have written the sort differently

    %bag.sort({ -.value, .key })
7y agoHN ↗

There is no bash (or any scripting) involved, the complete command from the article is:

  tr -cs A-Za-z '\n' |
  tr A-Z a-z |
  sort |
  uniq -c |
  sort -rn |
  sed ${1}q

The real benefit is that each is a single command that is easy to test in isolation and it's multi-process. That's not possible in most scripting languages.

7y agoHN ↗

McIlroy literally calls it a script in his review (notice the ${1}).

Nothing prevents you from unit testing in scripting languages. Multi-process, sure, but most people aren't looking for that.

7y agoHN ↗

McIlroy literally calls it a script in his review (notice the ${1}).

Ok, there's a single shell substitution, if it was fixed would you still call it a script? Technically the result of that is itself a sed script "3q", but if you count either of those then there isn't a lot of wiggle room between script and command, the arguments to tr are by far the most complex "script" involved.

Nothing prevents you from unit testing in scripting languages.

That is a world away from what I'm talking about. Each line of that command can be executed on the CLI in isolation, you'd be replicating a lot more in nearly any scripting language, except maybe perl and awk.

Multi-process, sure, but most people aren't looking for that.

Neither am I generally, still quite nice when you get it for free though.

7y agoHN ↗

You're really splitting hairs. You can execute a Python command in a REPL. There's little material difference between scripts and commands for our purposes. And scripting languages provide facilities to test functions in isolation.

7y agoHN ↗

There is no bash (or any scripting) involved

What provides the pipe functionality?

7y agoHN ↗

To his great credit, Knuth included McIlroy's critique, in full and without response, when he published Literate Programming. Knuth also conceded in an earlier chapter that literate programming was probably a crazy idea and that promoting it was perhaps an act of madness! It's delightful that we live in a world where there's room both for industrial-strength Fabergé eggs and hack-it-together pipelines. :)

7y agoHN ↗

That's a good one. It's one of the classic examples of the Unix philosophy and how pipelines can be powerful, although of course not applicable in all cases, and they have their issues too - which often becomes an argument on HN (about text streams vs. object pipes a la PowerShell, etc.).

I had seen it a while ago and blogged about it here, with solutions (approx.) in Python and shell:

The Bentley-Knuth problem and solutions:

https://jugad2.blogspot.com/2012/07/the-bentley-knuth-proble...

Also, previous HN thread about it here:

Revisiting Knuth and McIlroy's word count programs (2011) (franklinchen.com)

https://news.ycombinator.com/item?id=15264997

7y agoHN ↗

That was quite unfair criticism, and even Doug McIlroy knew it (as he admitted later). The background is this:

- Bentley, the author of the column, invited Knuth to demonstrate literate programming using a program of his choice.

- Knuth insisted that to be fair, Bentley ought to specify the program to be written; else someone might object that Knuth chose a program that would be good for literate programming.

- Bentley chose (what we'd now call) the term frequency problem (list the top k most frequent words in a text file), and accordingly Knuth wrote a system program for solving just this one particular task. (Did everything from opening the input file to formatting the output, etc.)

- Doug McIlroy was asked to “review” this program, the way works of literature are reviewed. He happens to be the inventor of Unix pipes. Towards the end of his review, along with many other points (e.g. Knuth didn't include diagrams in cases where most of us would appreciate them, something I still struggle with when reading TeX and other programs), he used the opportunity to demonstrate his own invention, a shell pipeline using now-standard Unix tools (tr, sort, uniq, sed).

There are a few things wrong with this criticism:

- The main thing is that DEK wrote the program he was asked to write, so pointing out that he shouldn't have written that program is a criticism of the one who chose the program (Bentley mentioned this when printing McIlroy's review).

- At the time, Unix wasn't even widely available outside Bell Labs and a few places; it definitely wasn't available to Knuth or most of the column's readers.

- Knuth's program, fine-tuned for the task, is more efficient than the shell pipeline.

- Even if you use a shell pipeline, someone has to write the “standard” programs that go into it (the "tr", "sort", "uniq" and "sed" above), and literate programming can be used there. In fact, Knuth did exactly that a few years later, rewriting Unix's “wc” (IIRC) and compared the resulting program with that of Sun Unix's wc, and his LP version had, among things, better error handling. (He's explained it by saying that in conventional programming, if you have a small function and 90% of it is error-checking, it looks like the function is “about” error-checking, so there's a psychological resistance to doing too much of that, while with LP you move the error-handling to a separate section entirely about error-checking and then you tend to do a better job. BTW, TeX's error handling is phenomenally good IMO; the opposite of the situation with LaTeX.)

All that said, there is some valid criticism that Knuth prefers to write monolithic programs, but that works for him. He seems not to consider it a problem that to change something you have to understand more-or-less the entire program; he seems to prefer doing that anyway (he reads other people's code a lot: in Peter Seibel's Coders at Work, he was the only person interviewed who read others' programs regularly).

7y agoHN ↗

re: At the time, Unix wasn't even widely available outside Bell Labs and a few places; it definitely wasn't available to Knuth or most of the column's readers.

At that time, 1986, Unix was widely available - there were more than 100k Unix installations around the world by 1984. AT&T Unix Sys V and UCB 4.3bsd were available. Knuth was friendly with McIlroy, who was head of the Bell Labs computer science research group that begat Unix. Sun Microsystems was formed in 1982 - their boxes ran Unix, and Sun was a startup spun off from Stanford.

7y agoHN ↗

Hmm interesting; I remember checking this for the time when TeX was written (1977, because of questions about building on top of troff) -- what I remember finding is that Unix wasn't widely available at colleges then. Perhaps things changed in the next 9 years. As far as I know, Knuth's access to computers at the time was still through Stanford's AI Lab (that's why the first version of TeX in 1977-1978 was written in SAIL; see also the comment for 14 Mar 1978 in http://texdoc.net/texmf-dist/doc/generic/knuth/errata/errorl...). Do you know if Unix was installed on Stanford lab computers by 1986? What was the distribution of these 100k Unix installations (academia/industry)?

7y agoHN ↗

OK, Unix was probably available to Knuth, but the task given to Knuth was not to promote any already written programs! Had he done so it would be claimed that he missed to do what was requested of him to do.

Even today, if you would get the exactly same task, with the goal to make the most efficient solution when you have to care about the limitations of hardware available to you and to produce the self contained program (e.g. because your algorithm should run with hundreds of billions of words of input) you'd still at the end probably produce something closer to what Knuth did then what McIlroy did.

Which doesn't mean that it's not brilliant. But it's also not obvious, i.e. not something a "normal user" would "know":

- even if you knew that "tr command translates the characters to characters" did you know that you could (and must) write

   tr -cs A-Za-z'
   '

to perform the first operation from 6? What the -c does? What the -s does? That you could and even had to form the command line to contain the newline? I bet a lot of Unix users of today would still not know that one.

- did you know what the fifth line was supposed to do "sort -rn" Would you know that you're to sort "numerically" (-n) and that it would "work"?

- "sed ${1}q" how many people even today would know that one?

And after all that, the first of two sorts needs to sort the file that is as big as the original input! If you have hundreds of gigabytes of input, you'd have to have at least that much more just to sort it. McIlroy's approach is a good one for one-off program or not too big input processing, and if you knew that you can use these commands as he used them. But it's still not "a program" in the same sense a Knuth's program is.

Knuth's algorithm would, unsurprisingly, handle the huge inputs orders of magnitude more efficiently. And that is what McIlroy was aware of and intentionally hand-waved it in his "critique." Read the original text:

https://www.cs.tufts.edu/~nr/cs257/archive/don-knuth/pearls-...

But the major point is still: Knuth's task was not "use the existing programs" (or libraries) but "write a program" that does what's said to be done: The fair comparison would then include the source of all the sort, uniq, tr etc. programs which McIlroy used.

And once that is being done, McIlroy's code would still be both less readable, less efficient and worse overall.

Which on the other side also doesn't mean that for some purposes "worse" isn't "better": https://yosefk.com/blog/what-worse-is-better-vs-the-right-th... But for some purposes, on "better" works and "worse" simply doesn't, e.g. when the scale of the problem is big enough. And Knuth teaches us how to solve such, harder problems. And presents the complete solution v.s. doing tricks (just call that library/executable which I'm going to avoid to explain you how it is implemented and what its limitations really are).

And giving the misunderstanding in the difference between showing how something is implemented (most efficiently) and that "just use pre-written tool X" approach, I understand even more why Knuth uses assembly in his "The Art of Computer Programming" books.

7y agoHN ↗

But it's also not obvious, i.e. not something a "normal user" would "know":

- even if you knew that "tr command translates... "sed ${1}q" how many people even today would know that one?

Are you suggesting it's ever been more likely for people to understand how to manage a trie structure in Pascal than use Unix command line tools? Or look flags up in the manpages?

Personally speaking, I'm comfortable doing both, but can't imagine many scenarios where I'd rather have ten pages of a custom datastructure than six lines of shell. (And they all involve either high volumes of data or situations where I can't easily get to the process-level tools.)

The fair comparison would then include the source of all the sort, uniq, tr etc. programs which McIlroy used.

If you're including the code that provides the surface abstractions, where do you draw that line? If the code for sort, uniq, etc. is fair game, why not the code for the shell that provides the pipelining, the underlying OS, the file system, the firmware on the disk? After all, who's to say that the programs in the pipeline don't just run one after another with temporary files written to disk, rather than in parallel? (Which I've seen happen in reality.)

The same is true for the other side, of course. The 'fair comparison' could easily require Knuth's solution to include the source for weave/tangle, TeX/Metafont/CMR, the OS, etc.

And once that is being done, McIlroy's code would still be both less readable, less efficient and worse overall.

What definition of 'worse' are you using?

* I expect sort/uniq/tr/sed to be more well tested and understood than a bespoke program.

* If there are issues with the program, it'll be easier to find skills/time to maintain a shell pipeline than custom trie-balancing code written in Pascal. (Sitting aside a prose description of the same.)

* The shell pipeline runs on a machine that can be found in a retail store today, rather than requiring an elaborate download/build process.

* It's possible that the custom solution runs faster, but not obvious without testing. (None of which is worthwhile outside of demonstrated need.)

Point being: it's very easy to find a definition of 'worse' that applies more to the custom solution than to the pipeline.

7y agoHN ↗

The shell pipeline runs on a machine that can be found in a retail store today, rather than requiring an elaborate download/build process.

That argument points to the fact that your “view” of the whole topic changes the assumed definition of the problem that was given to Knuth to solve. Read once again the original text: he was supposed to illustrate how the “Literate programming” could be ised while writing a program which solves a given program. It was definitely not “write an example of calling the existing pre-written programs”.

And, of course, it was all in 1986, definitely not “to target the machine which can be found in the retail store in 2018.”

McIlroy already behaved as the goal had been different than it was.

7y agoHN ↗

Absolutely agree - Unix was ubiquitous in academia by 1986. I myself learned C on a VAX running BSD 4.2 in 1986.

7y agoHN ↗

I never saw that as a criticism.

Just an interesting counterpoint.

7y agoHN ↗

He has fashioned a sort of industrial-strength Fabergé egg—intricate, wonderfully worked, refined beyond all ordinary desires, a museum piece from the start.

Curiously, I independently came up with this metaphor in my review of The MMIX Supplement to The Art of Computer Programming [1]:

"You can marvel at its intricacies like one marvels at a Fabergé egg."

[1] https://www.amazon.com/gp/customer-reviews/R25NHN9UP7PLJI/

7y agoHN ↗

McIlroy's critique is both astute on it's own yet perhaps not relevant in the context of what Knuth had been asked to do, namely present an example of literate programming. That's not to say the McIlroy's script can't have a literate form, only that it wouldn't serve as a good exemplar.

It all serves as a good reminder of how Knuth's work should be used & viewed: It shouldn't be taken as insight into how to manage and develop for software projects. It's more useful as teaching tools for how to think about solving problems. In my mind it's the difference between "pure" science and practical engineering, though I'm not sure that's a perfect analogy.

To try another analogy, it's like Knuth was asked to make a custom set of clothes. And McIlroy's critique seems like saying "Not everyone can afford custom made clothes, and the GAP produces perfectly serviceable clothes that are far more practical in most situations" It's correct, sure, but rather besides the point in the context of the original request.

7y agoHN ↗

perhaps not relevant in the context of what Knuth had been asked to do, namely present an example of literate programming.

Agreed... if that was the goal, then McIlroy's example was terrible (in that it didn't use literate programming at all).

7y agoHN ↗

Yes, I love this story too. It really demonstrates so much. And oh, the hackles it raises. :)

7y agoHN ↗

And oh, the hackles it raises. :)

The main reason I like the story is that it's good fodder for discussion about priorities in software development. After all, counting words isn't exactly an interesting problem in 2018, but deciding the effective use of libraries and programmer time is still very interesting.

7y agoHN ↗

I once had to write a program for a class didn't have access to a compiler. I wrote it all in notepad and double checked everything more thoroughly than I ever would have done otherwise. When I got the computer lab the compiler found one or two type-o's and the program ran perfectly the first time. The experience changed how I write code. It's worth trying out at least one time.

7y agoHN ↗

I used to sit in my grade 12 English class working out polygon fill-and-shade routines on graph paper instead of whatever nonsense Shakespeare we were going through at the time.

Worked out really well for me - I'm employed well as a programmer, and I got to come to Shakespeare basically fresh when I was old enough to actually appreciate the work.

7y agoHN ↗

How old is that? I'm over 50 and I still can't get into Shakespeare. Watching a performance is OK, though not something I'd choose to do on my own, but reading the plays? Can't get into it at all.

7y agoHN ↗

Have you tried an annotated one? Shakespeare is full of, essentially, in-jokes and memes from the 1500s. There is a ton of depth in his writing that you'll totally miss if you don't know all of that context.

7y agoHN ↗

Also, lots of bawdy humor that gets glossed over by staid and respectable modern productions. For example: the "bite your thumb" gesture that gets used in a few plays is pretty much the equivalent of somebody from today giving a double middle finger while sticking their tongue out.

7y agoHN ↗

Try watching a movie version - I really like Branagh's Hamlet and I never expected to (long though)

7y agoHN ↗

To me, this is one way to show evidence of mastery of an engineering discipline: The ability to do it once and have it come out right. If you asked a modern software engineer who's used to fast modern tools, they'd tell you this was impossible. Everyone's pretty much settled into this kind of workflow:

Write -> Compile -> Fix Compile Errors -> Compile -> Fix Compile Errors -> Compile -> Fix Compile Errors -> Compile -> Run -> Fix Runtime Bugs -> Compile -> Run -> Fix Runtime Bugs -> Compile -> Run -> Fix Runtime Bugs -> Compile -> Run -> Fix Runtime Bugs -> Compile -> Run -> Fix Runtime Bugs -> Git Push and Pray

With maybe a few "Write Unit Tests" steps intermixed. Totally different mentality. Is it really a faster or more productive way to work?

7y agoHN ↗

Do you really encounter compiler errors that frequently? The compiler stopped barking at me for the most part after my first year or two.

7y agoHN ↗

During big refactorings, I admit I sometimes find myself relying on compiler errors as a crutch to find (for example) which API layer I haven’t added the parameter to yet.

I’ll also rely heavily on my IDE’s function signature completion, to remind me whether some method I’m calling takes an int or an unsigned int, rather than have it memorized like I used to.

This might be why a lot of people (including me) hate whiteboard-coding interviews: we’ve gotten so spoiled by our tools that we can’t code without them!

7y agoHN ↗

During big refactorings, I admit I sometimes find myself relying on compiler errors as a crutch to find (for example) which API layer I haven’t added the parameter to yet.

That's not a 'crutch' - it's literally what those compiler errors are for! The alternative would be for the compiler to do something non-sensical, which would error out at runtime.

And when it comes to white-board coding, you should arguably be using pseudo-code anyway - your goal is then not to come up with something that will run, but to convince your interviewer that the code is 'morally' correct and that any subsequent fixes are well within your skill level.

7y agoHN ↗

My biggest problem with whiteboard coding is writing text in straight lines. You never realize how much of a liability being left handed is until someone asks you to do whiteboard coding (ya, many lefties train for this, but some don’t).

Computers have been a godsend for my penmenship. On the other hand, I guess I relied on them too much as a kid.

7y agoHN ↗

During big refactorings, I admit I sometimes find myself relying on compiler errors as a crutch to find (for example) which API layer I haven’t added the parameter to yet.

Sure, I do the same. I wouldn't call it a 'crutch' though; it's just using the tools you have available to you.

7y agoHN ↗

This might be why a lot of people (including me) hate whiteboard-coding interviews: we’ve gotten so spoiled by our tools that we can’t code without them!

Isn't that like someone saying they've gotten so spoiled by training wheels, they can't ride a bike without them? It's not like I'm one to talk 100% of the time. I think I couldn't get my company's project to build, without a few weeks of reading and understanding a lot more of the build system. However, I've also coded on an 8 bit machine by flipping 8 switches and pressing a commit button for each byte.

It's a worthwhile exercise to do some coding with nothing but a text editor and a debugger once in a while. That isn't going 100% to the bare metal, but it's a level that's very worthwhile for working on basic skills. Entire programming education books have been based on this idea.

7y agoHN ↗

The difference is that training wheels are intended to be a temporary assistance until you've learned to operate without them, while development tools are meant to be a productivity boost. If you're working with a toolchain and aren't leaning on it, you're not working to your full potential.

Whether being able to work without the chain is also important is an independent issue. (I happen to prefer vim+scripting languages over IDEs+compiled. But I recognize it as a personal preference, and not a question of moral superiority.)

7y agoHN ↗

It's like a lumberjack so used to cutting down trees with a chainsaw that they'd have trouble to put down a decent tree with an axe. Powerful tools do certain subtasks for you, if you expect to use them all the time (and it's a reasonable expectation in your domain), then it makes all sense that you'd forget these subtasks.

It's like manual memory allocation and proper deallocation - been there, done that, but after 10+ years of working with GC languages, I would definitely have some memory leak bugs if I suddenly had to do that again. It is a basic skill, but just as many other basic skills, it's one that you can ignore in most domains.

7y agoHN ↗

It's like a lumberjack so used to cutting down trees with a chainsaw that they'd have trouble to put down a decent tree with an axe.

Bad analogy. It's more like a "lumberjack" who thinks all it takes is pressing the controls on a chainsaw. There's some more, very important things to know, and not knowing them can cost time and money or even get someone badly hurt. The chainsaw has to be maintained, with possibly severe consequences if it isn't. You need to know how to get the tree to fall where it's supposed to. You have to know how to cut so the weight of the tree doesn't clamp the chain.

It's a bad analogy, because the important issue is whether someone is letting the tool substitute for understanding. I guess some rube might think their chainsaw is so powerful, they don't have to worry about how they cut down the tree. It's more like sailors who think they can just lean on GPS instead of having skills. Those are the guys who collide their ships and get people killed. It's more like pilots who weren't great student pilots, and they make critical mistakes and program the autopilot into the side of a mountain or do the wrong thing when the plane is stalling or always depend on the auto-landing system and don't really know how to do a manual landing and wreck the plane. (Those are all things that really happened.)

Just because some big fraction of time being a "professional" is just being an end user doesn't mean there isn't something more beyond that which is very important. I guess it just has to do with what level of "professional" you aspire to be.

It's like manual memory allocation and proper deallocation - been there, done that, but after 10+ years of working with GC languages, I would definitely have some memory leak bugs if I suddenly had to do that again. It is a basic skill, but just as many other basic skills, it's one that you can ignore in most domains.

If you're doing something hard enough, you still have to think about stuff like that in a GC environment. I know, because I worked for a Smalltalk vendor. You can even have memory leaks in a GC environment. There's a lot of stuff you can ignore -- most of the time -- but can come and bite you real hard if you're not prepared for it.

7y agoHN ↗

Do you really encounter compiler errors that frequently?

He skipped the "ctrl+enter" part of the workflow.

7y agoHN ↗

Yes. A real feedback loop is better than a mental one in your head. “Turn off your targeting computer and use the force, Luke” only works if you hone a lot of mental power into it (like Knuth), but it would have also discouraged a lot more people without that ability from programming at all.

In the past you had to be Hawkeye to program, now most of us just put on our Ironman suit and get on with it.

7y agoHN ↗

Nevertheless, the more complete and accurate your picture of what you are attempting to achieve, and where you are, is (at every level of abstraction), the fewer iterations it will take to get done - or the fewer bugs remaining after a given elapsed time.

It's like situational awareness: https://en.wikipedia.org/wiki/Situation_awareness

7y agoHN ↗

The number one thing I try and build up for my teams is a mental picture of the entire system. It is amazing, to me, how much resistance I get to the idea.

7y agoHN ↗

If we want to go there, modern tooling allows you to forget some of the details you used to care about and focus more on other things, the tooling is rarely comprehensive and there will always be more to consider until the entire programming process is automated.

7y agoHN ↗

As modern tooling chips away at the accidental difficulties of software development, systems-level situational awareness becomes relatively more central to the process.

7y agoHN ↗

The difference is other people.

Yes, if you're writing your -own- code, learning to envision what the system must do in your head first is very, very valuable.

When you're on a team, however, you -have- to compartmentalize. You have to create abstractions, black boxes, functionalities that you -could- dive into, but which you will accept only understanding at a contract (interface) level. The skill of envisioning the system is still useful, of course, but there will be black boxes.

The problem that causes, of course, is that every abstraction is leaky. You didn't know that calling this method also fired off this event, and so you -also- triggered that event. Or whatever. Hence, bugs and iteration. You also have to deal with -bad- interfaces, a bajillion parameters, or a parameter object that isn't intuitively obvious how to initialize, and you start having to iterate.

7y agoHN ↗

The problem is not just, or mainly, leaky abstractions - you can't make a system out of a collection of opaque abstractions. An important part of Knuth's genius is seeing deeply and clearly how they have to interact. Leaky abstractions are just one sort of problem that arises when this doesn't happen.

7y agoHN ↗

Sort of. I've seen these productivity-enhancing tools used by people who have absolutely no clue what those tools are doing on their behalf produce some nightmares that sort of work sometimes. To get geekier with the analogy, a lot of people are like spiderman (the Tom Holland spiderman) who need to learn to use the powers of their suit before they're given access to the more powerful, more dangerous stuff.

7y agoHN ↗

Put an untrained person in a bulldozer and there will be a lot of damage.

7y agoHN ↗

In the past you had to be Hawkeye to program, now most of us just put on our Ironman suit and get on with it.

This is an amazing metaphor, thank you for sharing!

7y agoHN ↗

If Knuth worked on a large code base (e.g. Windows), I'm sure he'd have the exact same workflow.

7y agoHN ↗

It is much more impressive that Knuth came up with and wrote TeX than that it was bug-free or written all in his head.

Computer time is no longer at a premium and bugs can be fixed.

Useful, creative, and clear solutions usually trump perfectly correct ones, except in special cases such as when life is on the line or you're writing programs to fly to the moon where getting it right the first time is of utmost importance.

7y agoHN ↗

"Useful, creative, and clear solutions usually trump perfectly correct ones"

Actually I've found that the most useful solutions are those that are creative and clear.

But yeah, it totally depends what one is doing. Usually if the algorithm is mission critical and the component is mission critical you can weasel out enough time to make it right (so you don't have to return it to ever again and you get a reputation as a guy who's code just works).

7y agoHN ↗

There are individuals out there who possess sufficient cognitive capabilities such that they do not require much in the way of cognitive load mitigation tooling even when working on very complex and technical tasks.

These individuals are uncommon.

7y agoHN ↗

The ability to do it once and have it come out right.

One coworker of mine was the son of one of the engineers of the XC-142 tiltwing aircraft. He started a project to make a functional scale model, and this was before Arduino, so we decided to use a Gumstix Linux board. (Because of its generous number of GPIO outputs.) I wrote a bit-banging implementation of the flight surface control mixing in C. It "just worked." No errors. It just ran the 1st time. It was even flown on a simpler aircraft.

This isn't my usual way, however. Usually, I'm quite iterative. If you're going to write a program that works the 1st time, then it helps if the control flow is relatively simple, there isn't a lot of complexity that can come about with interaction with state, and it does just one thing.

7y agoHN ↗

In some domains it is, for example you won't create fun arcade game without iterating 1000s of times on the basics (control scheme, physics, etc). Often it isn't.

I learnt programming writing small games, so quick iteration is my first instinct, and I can see myself sometimes jumping to write code too quickly.

7y agoHN ↗

I know you probably exaggerated, but isn't causing so many feedback loops still the sign of a bad programmer?

I wouldn't trust someone to deliver quality software who produces multiple syntax and multiple runtime errors while coding, especially when modern IDE's fix typos on the fly? What about all the runtime errors he didn't test for?

Is that flow really that common?

Sure, I cause errors all the time, but my workflow includes a compile time error maybe once in 2 trys and an obviously fixable runtime error once in maybe 10 times. Sure there are these countless of edgecase errors I don't even know about, but that's not the thing catchable with this workflow and I wonder if someone with that workflow, who misses the obvious, does miss even more edgecases.

Also don't a lot of tech companies require (mostly) correct whiteboard coding exactly because of this for quite some time?

7y agoHN ↗

When I was a kid, I learned Pascal from a book. We didn't even have a PC at home (it was the 80s) but my mother was a college professor and had access to the mainframe there. I wrote out a whole program to run Conway's Game of Life on a bunch of notebook paper, and one day when I was off from school I came in and typed the whole thing in at a terminal. I ran the command to compile it, and it spit out hundreds of syntax errors. Then it was time to go home.

It was not an auspicious start to my career in computer science.

7y agoHN ↗

It was not an auspicious start to my career in computer science.

I'd argue the opposite!

Learning how to "run" code in your head, cover edge cases and invariants, is a great skill to practice. When I was at a hospital after a difficult operation, I used to write down pages and pages of C64 programs in my notebook, too :-)

Even if I never even typed all them out later, I like to think this made me a better programmer. It trains your brain in a way that REPL doesn't.

7y agoHN ↗

I sometimes worry that I've become REPL-dependent.

7y agoHN ↗

That's how I learned C. I bought a copy of K&R, but didn't have access to a Unix system with a C compiler for about a month (when my new job started). I read the book and wrote out all the exercises in a notebook.

When it came time to try my code, I spent a while correcting some basic misconceptions that I had developed but that hadn't been corrected by an actual compiler.

7y agoHN ↗

I originally learned to program in 6502 machine code. Typically I would write code in spiral notebooks while watching the late late late show and hexkeypad it in afterwards. made it a little easier to edit things that way...

7y agoHN ↗

I got into this type of thinking/habit by working for a couple startups and programming live on prod...

7y agoHN ↗

I had a similar experience! When I first learned programming, it was through a book I borrowed from a teacher, who would only let me access her computer once a week. So I basically wrote all the programs I wanted to write with pen and paper, and then typed them and ran them once a week. It definitely gave me a much thorough understanding of many algorithms, as I basically have to simulate execution on paper.

7y agoHN ↗

He did it on the worst system with remote batch called the Wilbur system.

I think you mean WYLBUR.

I had the "opportunity" to work with WYLBUR once in 1993, and I remember it to this day. "the worst system with remote batch" dramatically understates how bad it was. Hearing this raises Knuth even higher in my estimation.

https://en.wikipedia.org/wiki/ORVYL_and_WYLBUR

7y agoHN ↗

He did it on the worst system with remote batch called the Wilbur system.

How funny, because Wylbur was a large improvement on the default at the time, MVS's TSO (Time-Sharing Option). Wylbur was miles easier and faster than TSO.

So, not actually 'the worst system with remote batch' because that trophy would go to TSO.

7y agoHN ↗

I’ve posted this comment on HN before, but this is my best Knuth story:

In the 70's I had a co-worker, perhaps the best programmer in the department, that had gone to school with Knuth. He told me that one day while in college Knuth was using one of the available key-punch machines to punch his program on cards. My friend was ready to punch his program so he stood nearby to wait for Knuth to finish. Knuth, working on a big program, offered to Keypunch my friends program before finishing his own because my friend's program was shorter and Knuth could keypunch quite fast.

While watching over Knuth's shoulder, my friend noticed Knuth speeding up and slowing down at irregular intervals. Later he asked him about that and Knuth replied that he was fixing the bugs in my friend's Fortran as he punched it out.

7y agoHN ↗

Probably my favourite is along similar lines: read “The Summer Of 1960 (Time Spent with don knuth)” for a great story of Knuth as “this tall college kid” (consider the fact that Knuth first encountered a computer at college), from “Stories about the B5000 And People Who Were There”: http://ed-thelen.org/comp-hist/B5000-AlgolRWaychoff.html#7 (PDF scan: https://www.computerhistory.org/collections/catalog/10272464... page 7)

And about the story you shared, Knuth has elaborated in an interview (with typical humility, he plays it down): http://www.informit.com/articles/article.aspx?p=1193856

7y agoHN ↗

Most people who learned to program on batch-oriented systems developed those habits. When you had to wait hours or even overnight for your compile to run, you spent a lot of time at your desk checking the code for syntax errors, and running the logic in your head.

7y agoHN ↗

Knuth has said that the story as told above is apocryphal. I quote from here (http://www.informit.com/articles/article.aspx?p=1193856): > Donald: The story you heard is typical of legends that are based on only a small kernel of truth. Here’s what actually happened: John McCarthy decided in 1971 to have a Memorial Day Programming Race. All of the contestants except me worked at his AI Lab up in the hills above Stanford, using the WAITS time-sharing system; I was down on the main campus, where the only computer available to me was a mainframe for which I had to punch cards and submit them for processing in batch mode. I used Wirth’s ALGOL W system (the predecessor of Pascal). My program didn’t work the first time, but fortunately I could use Ed Satterthwaite’s excellent offline debugging system for ALGOL W, so I needed only two runs. Meanwhile, the folks using WAITS couldn’t get enough machine cycles because their machine was so overloaded. (I think that the second-place finisher, using that "modern" approach, came in about an hour after I had submitted the winning entry with old-fangled methods.) It wasn’t a fair contest.

As to your real question, the idea of immediate compilation and "unit tests" appeals to me only rarely, when I’m feeling my way in a totally unknown environment and need feedback about what works and what doesn’t. Otherwise, lots of time is wasted on activities that I simply never need to perform or even think about. Nothing needs to be "mocked up."

7y agoHN ↗

“Here at Google, sometimes we just throw stuff together,” Dr. Norvig said, during a meeting of the Google Trips team, in Mountain View, Calif. “But other times, if you’re serving billions of users, it’s important to do that efficiently. A 10-per-cent improvement in efficiency can work out to billions of dollars, and in order to get that last level of efficiency, you have to understand what’s going on all the way down.”

I'm interested in this low level systems opimization. What type of jobs hire for this work? What areas in graduate school should one focus in? Is this type of skill set still employable?

7y agoHN ↗

SRE (Site Reliability Engineer) is one such track.

7y agoHN ↗

Amongst other things, know your hardware.

For example, you could read the C++ spec forwards and backwards for a year and know your data structure big O notation just as well, but they will never tell you that inserting into the middle of a vector is faster than inserting into the middle of a linked list in a great many common cases.

Sure, ideally you'd measure, but you need to have some idea of what options to even compare with your measurements.

7y agoHN ↗

I may be missing something here, but your example seems to be a textbook case for big-O analysis. Writing in a vector is O(1), while linked list is O(n), isn’t it?

7y agoHN ↗

Writing into a vector is O(n), writing into a LL is O(1), assuming you have an iterator to the location to write to. If you don't, then it becomes O(n), and writing into a vector can be O(1) if you're writing to the end.

C++ stl, LL appending is always O(1) and writing into a vector is O(n). There are plenty of caveats to this and the documentation should be referenced.

He's right btw that insert into a vector is generally faster in the C++ stl than insert into a LL. I don't recall off the top of my head why that is, just remember it's the case.

7y agoHN ↗

Data locality is a big reason. Sure, it's O(N) writes, but those writes are neatly lined up in such a way that the likelihood of a cache miss is low. As opposed to a linked list, where just traversing to the middle may entail multiple round trips to main memory.

7y agoHN ↗

Yeah -- O(1) and O(n) are definitely simplifications and never tell the whole story.

7y agoHN ↗

It's not strictly related to C++ and/or STL. This is how computers work nowadays.

7y agoHN ↗

Well, my comments were specifically based on C++ and the STL. There are so many implementations that one has to define the discussion.

7y agoHN ↗

It's about inserting in the middle of a vector, which requires to shift every element after that one (so, O(n)), and for a linked list it can be done by allocating a new element, which, if you have the pointer to the place where you want to insert, is O(1) - and really, just a few operations.

However, in practice, the O(n) operation will be faster - since doing a hundred reads and a hundred writes to shift a hundred numbers within a single cache line will be much faster than reading a single byte to an out-of-cache memory in the linked list case; the processor can do a lot while waiting for any new data from RAM.

7y agoHN ↗

There's a position like that in my company, open to new hires (only bachelor's needed). The goal is to optimize algorithms and data analysis models that run on our HPC cluster. It basically boils down to changing compiler settings and seeing what runs the fastest.

7y agoHN ↗

Can you post a link (if there are no anonymity concerns)? Sounds like more fun than my current job.

7y agoHN ↗

Working in any of the big cloud services (AWS, Azure, GCP) will involve this sort of work. Some services probably have more interesting scaling problems than others. (e.g. I bet AWS DynamoDB is more interesting than AWS CloudTrail).

7y agoHN ↗

It's not necessarily low level optimization. You get better optimization results if you're willing to change things at all levels of the software stack (including user expectations); so it's really about understanding what's going on all the way down and all the way up.

As with all things, the way to get experience and knowledge is to try things. Take a look at some software that you use that does something slow, and try to make it faster; it's easier if you have the source available. Lots of applications these days are slow to start, and that's easy to time, and probably easy to bucket things into things that don't need to be done or things that can be done later. If you interact with any long data processing loops, those are often good choices for optimization as well.

This skill set is most employable for companies that have scale; when you have ten servers, being able to turn off one of them because of efficiency gains doesn't help that much; but it's nice to turn off ten percent of your 10,000 node cluster. It also leads to nice claims on resumes "made efficiency gain in X, leading to Y% cost savings on servers", and since you're likely to spend a bunch of time on a single issue, you'll be able to have a good discussion when it comes to 'discuss some of your interesting projects' in interviews.

The only downside is you'll be super frustrated about everyone else's software being slow. You'll likely gravitate towards classic games because they don't have load times; I hope you like pixel art. :D

7y agoHN ↗

Funny, The NeXT Book by Bruce Webster referred to Knuth as the "Obi Wan of Computer Science".

I guess we can split the difference and agree on Jedi. :-)

7y agoHN ↗

My NeXT Cube was my introduction to TeX, and one for which I will be forever grateful.

I just wish that there was a machine running OPENSTEP 5.0 (as I think of Mac OS X) which I wanted to buy --- I prefer pen computers (the highwater mark of my computing experience was an NCR-3125 running PenPoint paired w/ a NeXT Cube w/ a Wacom ArtZ graphics tablet).

7y agoHN ↗

"I was sitting in Steve's office when Lynn Takahashi, Steve's assistant, announced Knuth's arrival. Steve bounced out of his chair, bounded over to the door and extended a welcoming hand.

"It's a pleasure to meet you, Professor Knuth," Steve said. "I've read all of your books."

"You're full of shit," Knuth responded.

http://www.folklore.org/StoryView.py?project=Macintosh&story...

7y agoHN ↗

No way; I worked for him from 1978-1986, and never heard him say a naughty word. Also, I tagged along when he went to Apple to meet Jobs, who wanted to show him a late prototype of the Mac, and don’t recall hearing any such thing at the time (and it would have shocked me).

7y agoHN ↗

Well the website is called "folklore", so I think your skepticism is well placed. ;)

7y agoHN ↗

Is there a way to dispute the story on folklore? drfuch's comment should be appended there.

7y agoHN ↗

The story is 100% veritably folklore. I know this since I've been hearing the story for at least 20 years starring a good half dozen different characters. The fact that is almost certainly not true (and Knuth has denied it) seems quite irrelevant.

7y agoHN ↗

I've also heard that story with several different people in the place of Jobs (mid 90's it was almost always Bill Gates, for example), making me believe it to be apocryphal.

7y agoHN ↗

Also, it seems unlike Jobs to be reading algorithm books or to claim so - he was not interested in writing software. Jobs would involve himself in the user-facing functions of software.

Whereas I recall Gates claimed to have read them, or at least some of the volumes, and found them mind-expanding. Gates wrote a fair amount of software himself early on and later would still challenge people on very technical points.

7y agoHN ↗

My guess is that this is a paraphrase by Tom Zito using his own speech patterns (and the general style of the Apple group). Since you were there you might remember Don's actual words, or we could always ask him.

7y agoHN ↗

Perhaps everyone misheard when he said "you're full of t-shirts."

7y agoHN ↗

Knuth was asked if this was true by R Munroe (xkcd) on a talk on campus at Google, and Knuth denied it.

7y agoHN ↗

As they say, "never let the truth spoil a good story."

7y agoHN ↗

..that the Don was the one who really revived Apple by inventing the iMac and the iPhone ? Yes, yes, we know all that.

7y agoHN ↗

More likely Knuth made an earnest comment about being impressed about reading all his books.

That comment was then misinterpreted as sarcasm, which is what the folklore author remembered. Later having forgotten the words, and only remembering the mistaken interpretation's overall feel, it was paraphrased, poorly.

7y agoHN ↗

I like this response because it doesn't put the blame into anyone.

7y agoHN ↗

Never attribute to malice that which can be explained by incompetence.

7y agoHN ↗

Or entropy. (In this case, social entropy?)

7y agoHN ↗

It is very unlikely that Steve read all of the TAoCP that were published at the time.

7y agoHN ↗

I like these two quotes of Knuth where he lets us know how hard he worked.

--

From this small interview [1]:

"When I'm working on a research problem I generally begin by filling dozens of sheets of scratch paper with partial calculations. When I eventually get to a point where I can think about the problem while swimming, then I'm often ready to solve it."

--

From this other interview [2]:

"So I went to Case, and the Dean of Case says to us, says, it’s a all men’s school, says, “Men, look at, look to the person on your left, and the person on your right. One of you isn’t going to be here next year; one of you is going to fail.” So I get to Case, and again I’m studying all the time, working really hard on my classes, and so for that I had to be kind of a machine.

I, the calculus book that I had, in high school we — in high school, as I said, our math program wasn’t much, and I had never heard of calculus until I got to college. But the calculus book that we had was great, and in the back of the book there were supplementary problems that weren’t, you know, that weren’t assigned by the teacher. The teacher would assign, so this was a famous calculus text by a man named George Thomas, and I mention it especially because it was one of the first books published by Addison-Wesley, and I loved this calculus book so much that later I chose Addison-Wesley to be the publisher of my own book.

But Thomas’s Calculus would have the text, then would have problems, and our teacher would assign, say, the even numbered problems, or something like that. I would also do the odd numbered problems. In the back of Thomas’s book he had supplementary problems, the teacher didn’t assign the supplementary problems; I worked the supplementary problems. I was, you know, I was scared I wouldn’t learn calculus, so I worked hard on it, and it turned out that of course it took me longer to solve all these problems than the kids who were only working on what was assigned, at first. But after a year, I could do all of those problems in the same time as my classmates were doing the assigned problems, and after that I could just coast in mathematics, because I’d learned how to solve problems. So it was good that I was scared, in a way that I, you know, that made me start strong, and then I could coast afterwards, rather than always climbing and being on a lower part of the learning curve."

[1] http://authenticinquirymaths.blogspot.pt/2015/11/maths-in-sc....

[2] Transcript from here: https://github.com/kragen/knuth-interview-2006

7y agoHN ↗

I was also scared in the first year of college next to all these accomplished programmers and math wizards and it definitely helps!

7y agoHN ↗

Good article, two things: I noticed looking at the pictures after reading the whole thing in a go...

He looks nothing like Yoda! Wondering what made the author pick that title!

He has/had a standing desk at home!

7y agoHN ↗

Somebody actually changed the title of the post, so now it only says Yoda and doesn't reference Knuth at all. Seems backwards to me.

7y agoHN ↗

yeah that's even worse: it's super click-baity now

7y agoHN ↗

My favorite Knuth quote:

One of the first times I was ever asked about the title of my books was in 1966, during the last previous ACM national meeting held in Southern California. This was before any of the books were published, and I recall having lunch with a friend at the convention hotel. He knew how conceited I was, already at that time, so he asked if I was going to call my books "An Introduction to Don Knuth." I replied that, on the contrary, I was naming the books after him. His name: Art Evans. (The Art of Computer Programming, in person.)

7y agoHN ↗

Knuth has enormous patience for someone so productive.

My son used to refer to Knuth as "that amazing harpsichord player" and didn't care about the computer science "stuff" I tried to tell him was really important. And he had plenty of time to sit down with a kid and go through the score of Fantasia Apocalyptica and laugh together at the musical jokes in the score.

OTOH I either have to consciously decide not to stress about all the things I want to get done or else...stress and push hard. Yet the things I feel driven to accomplish are quite minor compared to Knuth's to do list!

7y agoHN ↗

It looks like a Logitech Gaming Keyboard G110

7y agoHN ↗

Looks like a Logitech G19 to me. I wouldn't have thought Knuth would have a gaming keyboard, let alone one with a screen.

EDIT: I think the other comment is correct, a Logitech G110

7y agoHN ↗

I'm an old-school programmer (though not as old as Knuth) and I use a gaming keyboard. I like the "click click" and full travel and the new "buckle spring" keyboards I can get aren't as good as the cherry clicky ones.

I learned to type on a a mechanical typewriter in High School and in college punched programs on keypunch machines. A lot of us old-timers use gaming keyboards.

7y agoHN ↗

Gaming keyboard also have extra keys, which you can map to macro or other things you find useful.

I usually remap the control keys to act as a modifier for Unicode characters (as Caps and Enter are my "Control" keys) but that's not much. I need more keys.

I have 2 keys to switch to the next/previous tab, in browsers, consoles and programming environments- the same keys can switch virtual desktop with a modifier.

I also have a key to invert my screen (black on white vs white on black), a key to either switch to a terminal doing a ssh to a specific server or spawn a terminal and start that ssh, etc.

It takes some time but offer greater productivity. I dislike the ticking of mechanical keyboard, and I really prefer "chiclets" keyboard as they generally require less force to be applied, but I would consider a mechanical keyboard if only for the extra keys.

7y agoHN ↗

That hex notebook! I got one of those at his 80th birthday celebration, cool that he is also using it!

7y agoHN ↗

“He’s a maximum in the community. If you had an optimization function that was in some way a combination of warmth and depth, Don would be it.”

I love that quote.

7y agoHN ↗

Donald Knuth shaved the ultimate yak. He wanted to write a book with mathematics in it so he implemented what for decades has been industry-standard mathematical typesetting system: TeX.

That's remarkable. I just wish he'd finish the book.

7y agoHN ↗

The details are even hairier.

He wrote TeX82 (modern TeX) in WEB, a literate programming language he invented that could be tangled into the Pascal machine code or weaved into literate documentation in ... TeX itself.

In fact he wrote WEB itself in WEB and by hand compiled the output of the tangle program, which he ran on the tangle source to get the same output.

He also wrote the program METAFONT to produce the typefaces, which he used to design the Computer Modern font.

And then he used that to write instruction books for TeX and METAFONT as well as new editions of The Art of Computer Science and others.

TeX is still in regular use in the academic community (ported via Web2C) over 35 years later, despite the changes in technology in that time (with hacks to deal with modern fonts, outputting PDFs instead of DVI, including images and the like).

He taught the yak to shave itself, and it's still clean shaven 35 years later.

7y agoHN ↗

"In regular use" is an understatement. Virtually all manuscripts published on Arxiv.org, which comprises a large portion of all contemporary physics research output, is typeset in Latex.

7y agoHN ↗

Dr. Knuth has gone so far as to argue that some computer programs are, like Elizabeth Bishop’s poems and Philip Roth’s “American Pastoral,” works of literature worthy of a Pulitzer.

I'd love to know which programs he's thinking of.

Any ideas?

7y agoHN ↗

I'd vote for at least some parts of PostgreSQL.

7y agoHN ↗

I was unsure of what to get for christmas. Now I know, I want the full collection of "the Art of Computer Programming".

7y agoHN ↗

I actually put that on my amazon wish list two years ago and presto it was successful.

I put the four volumes next to the three first editions that I have.

7y agoHN ↗

It's not a novel to read through, front to back.

Even Dr. Knuth says to skip around and read relevant chapters.

7y agoHN ↗

It can also be read through fine though. I’ve gotten the first volume and read through the beginning without too much trouble, although the whole book is so long and dense I don’t think I’ll be able to finish for a while...

7y agoHN ↗

True Jeff Dean story time (this was directly related to me): when Jeff spoke at Stanford, it was so crowded, Knuth had to sit on the floor (I think somebody eventually noticed and offered him a seat).

7y agoHN ↗

Just out of curiousity, does anyone know what kind of notebooks and paper he’s using in the photo captioned “A few notes”?

7y agoHN ↗

Yes the notepaper with triangular tiling was gifted at Knuth's 80th birthday celebration in Piteå, Sweden: http://knuth80.elfbrink.se/ (Sorry I don't remember where I read/heard about this.)

7y agoHN ↗

Ah one place I ran across this: see 16:05 of Knuth's 2017 Christmas lecture (https://www.youtube.com/watch?v=BxQw4CdxLr8):

I got a nice piece of paper here to work with. They had a conference in Poland last year [BachoTeX 2016] and they sent me this nice pad of paper and I like it so much that I decided at my birthday party next month I gotta give out notepaper that's... [audio drowned by laughter] But actually the notepaper at my birthday party is going to be triangle... paper. Because I have a feeling that all kinds of mathematics has never been invented yet because people haven't been given triangle... [laughter].

7y agoHN ↗

“I am worried that algorithms are getting too prominent in the world,” he added. “It started out that computer scientists were worried nobody was listening to us. Now I’m worried that too many people are listening.”

cheers!

7y agoHN ↗

These books are truly amazing and I refer to them often. What I like the best is that they are so thorough that you know they are right, vs. the first google search hit.

7y agoHN ↗

There are a few names in CS that stand out to me as legendary. Some examples are Von Neumann and Turing. IMO, Knuth stands among them.

7y agoHN ↗

I always had hard time imagining how Von Neumann can be so intelligent? There were geniuses and then there was von Neumann.

7y agoHN ↗

"Following Dr. Knuth’s doctrine helps to ward off moronry. He is known for introducing the notion of “literate programming,” emphasizing the importance of writing code that is readable by humans as well as computers — a notion that nowadays seems almost twee."

I liked a lot of this profile, but this came off as kind of weird.

7y agoHN ↗

I seem to remember older programming languages (COBOL?) being far closer to English-as-spoken as they are today, using, for example Do/END instead of today’s more common c-style { and }.

7y agoHN ↗

Literate programming has next to nothing to do with “English like grammars” or “self documenting” tongue twister symbol table names.

It has to do with writing documentation, and embedding little bits of code to do what the documentation describes, with a special build process to create the compiled program from the snippets within the documentation.

It’s kind of the inverse of Javadoc.

7y agoHN ↗

I had the pleasure to attend his 80th birthday conference (http://knuth80.elfbrink.se) in Piteå, Sweden where he also premiered his piece Fantasia Apocalyptica for church organ.

We attended the conference as students but still got to see the conference, listen to the music and be at the birthday dinner free of charge. When I talked to Knuth I was amazed by his humility. Every presentation was about how grand he was, but he still was humble and friendly.

They say you shouldn't meet your heroes, but they're obviously not talking about Knuth!

7y agoHN ↗

My favorite Knuth quote: "Email is a wonderful thing for people whose role in life is to be on top of things. But not for me; my role is to be on the bottom of things. What I do takes long hours of studying and uninterruptible concentration. I try to learn certain areas of computer science exhaustively; then I try to digest that knowledge into a form that is accessible to people who don't have time for such study."

source: https://www-cs-faculty.stanford.edu/~knuth/email.html

7y agoHN ↗

Thats an amazing quote.

Reminds me of a "hermit-like wizard in his tower in solitary uninterrupted study of their craft."

7y agoHN ↗

I once used two weeks of vacation to learn category theory - that was a really fun and rich time. It really relaxed me, but it also brought me more knowledge than one year of shallowly engaging with the topic.

7y agoHN ↗

I've heard many times on HN people bring up category theory and how beneficial it has been to learn it, so I've recently ordered a textbook on it.

Can I ask how has it benefited your thinking?

I'm curious to know not only how it benefits an understanding of software development, programming languages and functional programming, but also has it helped you understand the world at large in new and novel ways?

7y agoHN ↗

If category theory is your first exposure to proofs and logic it can benefit you a lot, although number theory might be a more fun and more concrete way to get the same result. If you know a lot about more than one field of math, as a great big generalization over everything category theory can also help.

I should warn you that there is a social bias towards saying that you found a lot of insight in studying something, and a bias against saying that studying it was a waste of time, irrespective of whether or not the thing is actually helpful. Aristotle could stare at a rock and end up with some insight, so anyone who stares at a rock and admits it hasn't helped them has to publicly admit they are not as smart as Aristotle. They say this is how geology got started. ;)

7y agoHN ↗

Aristotle might have been able to stare at a rock and say something clever, but most of his ideas about science were wrong, starting from the very definition of science, which he believed should be based on unprovable first principles (like mathematical axioms).

He rejected atomic theory, believed the Earth was the center of the universe and the four fundamental elements were air, fire, water, and earth, and thought heavy objects fell faster and moving objects would tend to come to a stop if nothing interacted with them.

These were observations that Aristotle and his audience accepted as "obvious". It took more careful and patient observers to discern the less obvious truth.

7y agoHN ↗

It's an iterative process. Anthro-centricism is powerful in terms of what it makes "obvious". The universe spins about the earth. That atoms are made up of objects. That we are the pinnacle of local evolution. That reality is really real.

7y agoHN ↗

Not qualified to speak on this myself, but I asked a similar question to a friend and he said something like:

Part of good software development is knowing where and when to create abstractions. Category theory has a collection of interesting and very general abstractions - if you can spot these patterns in your software development then they will be good candidates for abstraction/generalisation

7y agoHN ↗

It's this vogueish thing among a certain set of programmers to go around saying they learned category theory. I studied category theory as a math graduate student and frankly, if your goal is simply to become a better programmer, there are much more direct and productive ways to achieve that goal.

7y agoHN ↗

I can certainly appreciate ways that there are more direct and productive ways to become a better programmer.

My goal is to become a better thinker in general. Specifically with regards to seeing how one type of thing relates to another type of thing.

I'm actually more interested in better understanding and reasoning about the ecology of software development than becoming a better programmer per se but only because on some level I think that's actually necessary in order to achieve the writing of better software.

To put that into English... we don't write software in a vacuum. We write it in a team, in a company, in a world full of other programmers and there is a rich set of relationships among all of those things that is exerting pressure on the final shape the software takes.

Category Theory seems like fun and useful tangent that might help me understand the world better and be mildly useful in an abstract way.

7y agoHN ↗

I'm curious to know not only how it benefits an understanding of software development, programming languages and functional programming

It did and does that too (not much, since I am still a learner): It helps me to write APIs that behave well; usually, that means being an API which outward facing parts compose well. (The opposite would be an API where you configure it's internal state until it does what you want - the more complex the API, the harder it gets to mantain the suiting mental model). To be honest, it will help me getting the theoretic motivation behind many FP-concepts like monads, but I am not yet deep enough, I would not say I reaped a practical benefit in my haskell-writing. Reading (and implementing) "Category for programmers", which is a great blog, should take me there tho.

but also has it helped you understand the world at large in new and novel ways?

On a local scale, it was fascinating to see how you get logic and algebras by putting a little bit of additional order onto some abstract concept. These formal logic rules I leard? Turns out they are not only funny ways to play with symbols, but also funny ways to play with arbitrary finite sets. It was also nice to see how in category theory, you can "fix" nice properties by creating a new structures where these nice properties are objects. It is all pretty handweavy, since I am mostly going by my intuition unless I am pressed to prove something formally. This thread might help you: https://www.reddit.com/r/haskell/comments/16i322/whats_the_i.... Globally, I am a christian, so I see everything and everyone in relation to God anyways. Category Theory might at best helped me to identify God as the intitial and terminal object in the Category `Human` ;)

To give a short answer: I think CT is another tool in the box to gain a more connected view of the world, the main ingredients being age and observation of processes.

7y agoHN ↗

Now imagine having a year of this kind of intensive study of category theory (or similar), that is, graduate-level classes in math.

7y agoHN ↗

I envy those. I pity not having done my undergrad in maths! I have to say tho that we the examples learned in math department category theory are often not that important or interesting to programmers, and the same is true for the abstractions being studied.

7y agoHN ↗

I did actually do graduate studies in math. Early on I went to Paris for 2 semesters where I tried to follow a course on category theory, in preparation to algebraic geometry. Even though I did lots of abstract algebra before that, the intensity was too much and I could not keep pace.

Interestingly, the Chinese students in that class did fairly well, even though they could not follow the actual lectures (given in French) and were studying exclusively from the lecture notes (given in English).

7y agoHN ↗

I feel completely the opposite.

Not that email or any of the million other apps don't produce constant interruptions - but in terms of what I want my role to be and what I find pleasure in.

A world of high stimulation and constant social interaction? A million things shouting at me and I have to sort through them and grab the most important one and hop from thing to thing fast? That's what I like.

Focusing on one topic for hours, days, even weeks to really understanding every facet of it? I think it'd kill me. I know people theoretically need these big blocks of uninterrupted time to get work done, but I'd much rather have a bunch of meetings where we can figure out the path forward.

I have mad respect for him... but I never could have been an academic.

I like to take in all those digested kernels of knowledge, I like to digest as many of them as I can; I know I lose the details, but integrating them all into something bigger has always been my dream; it's just how I live my life.

7y agoHN ↗

It's only after you've developed a deep understanding that any efforts at integration would be successful. If you just like orchestrating, that's fine but I've met too many managers/product managers who think up lofty ideas on how to integrate various pieces without a deeper understanding of the underlying technology.

7y agoHN ↗

Yup, been around a lot of them, they are the ones who love to sling words around and are a prime definition of tech bros always looking to debate not on the basis of firm knowledge but as a cover-up for their inadequacies.

7y agoHN ↗

One of the signs that you're actually good at operating at this level is you spend more time listening than talking. You need people who actually know more than you - if you are always arguing and trying to prove you actually do know best, you're definitely not looking for that.

7y agoHN ↗

I have seen the other side of this where the developers trying to implement business requirements in code are making bad assumptions and end up in confrontations with middle management because their technically "pure" vision for how something should work doesn't solve the business goal.

7y agoHN ↗

Yeah. Seen this happen too. That usually points to a lack of (good) senior leadership in the dev team (senior developers not product/managers).

7y agoHN ↗

I like both.

The problem I find with surface level knowledge is you make a lot of mistakes. When I have a surface level knowledge of a piece of tech and make a decision based upon that, then talk to someone with deep knowledge it's pretty common for them to say "why didn't you just do XYZ, it's easier/more robust".

Ultimately you can produce OK or even sometimes good solutions to problems but not great ones, unless you have direct access to people that know more than you.

This becomes even more pronounced when different pieces of tech can be combined with eachother.

7y agoHN ↗

Me too.. in fact I just started imposing on myself last week a MWF: on top of things, TTh(plus weekend if available): on bottom of things. Hence here I am on HN on Monday!

7y agoHN ↗

I simply do make a lot of mistakes in most domains of my life.

I'm ADHD (diagnosed, etc), and medication did help, but didn't solve it. For much of my life, I fought against this natural tendency. But for most part I essentially kept telling myself "pay more attention"! It didn't work.

Compensation is important. Detecting the mistakes I make, and avoiding situations where the cost of them is very high. One part of that is accepting things I can never do, like be an academic :).

In the engineering world there's lots of means of compensating. One you mentioned; knowing people who know more than you. Another one would be automated testing; at almost every workplace I've had, I have put a lot of effort into expanding and increasing it, and generally detecting errors wherever they might occur. I'm always asking "what if there's a typo somewhere, will we know, will that go to production?" Might I create a PR I think I've tested but I haven't? The odds I've done this are higher than my peers, so I need to protect myself from that.

If I'm at a workplace that values accuracy above else - that views being able to focus on the code and get the best (not "good enough") solution to every problem as the main trait that I'm evaluated on, I will not succeed. I'm never going to be the guru of anything. This kind of sucks, because a lot of places view being really good at those things as necessary before you can move to another area (IE, management) where you don't use those skills.

I'm a "good not great" or "move fast and break things" kind of person. My usual working style is to produce prototypes very fast; then whoever I'm making it for can see that I didn't quite read the design thoroughly and miss something before it's a huge disaster.

I need the feedback of fast release cycles. I can detect errors fast, take action fast, fix them fast. But "take your time and make sure it's perfect before you throw the switch"? That's just not my personality. I'm high volume (when not artificially constrained) but error prone.

I'm smart enough to know it, smart enough to insist that my code gets reviewed, smart enough to say we really have to test for these cases, things like that. But it's absolutely something I have to compensate a lot for.

7y agoHN ↗

I don’t have ADHD but I can relate to feeling that deep knowledge is inaccessible to me. My issue has always been around some kind of internal optimization function that is always asking “how will this help me”?

A solution that’s worked well for me is to only study deeply when I have a concrete need.

For example, when I felt my work suffering because I didn’t deeply understand z-index, it was easy to sell my brain on reading the complete z-index spec.

One of my hobbies is music, and I’m just starting to feel the limitations imposed by not understanding music theory deeply. That means it’s a good time for me to study music theory.

Some people feel compelled to learn things. I feel compelled to do things, and if I can’t do something as well as I want to for lack of knowledge, then I know I’m ready to learn things.

7y agoHN ↗

Motivation is a super important factor for me. The gap between what I can accomplish when I care about somethin versus when I feel it is an obligation or requirement is huge. Thankfully the latter, combined with being smart enough to cover mistakes, has been good enough to keep me from failing things or getting fired, but it's a definite challenge.

Confuses the hell out of employers, too. "You did a great job on X, you really improved things, but when we put you on Y, you totally halfassed it" - because X was my idea, and Y was forced on me. I respect the (social) contract that you are my employer and I should do what I'm told; I know at least mentally I should try to excel on any task given me, but it's just so hard to invest in those kind of things.

Anyone can get demotivated; it's just that the gap for me is bigger than people are used to. I'm not blaming my employers here, to be clear - thinking that way does me no good, anyway(+). While the vast majority do a terrible job of recognizing the motivations of employees - and anyone can get demotivated - I'm going to be way worse at this than the average employee and it's up to me to compensate.

Another strategy: I learned early on ANY social context is motivating for me. So I try to schedule regular checkins, even if the org doesn't mandate them. Even a few minutes of a manager explaining the next project will yield much better work than getting a ticket thrown over the wall. Constantly engaging with others and feeling like they are personally depending on me is one of the most motivating things out there - so I have to keep reminding my bosses that YES, I do want to be in all those meetings.

I will say on the subject of learning - I mostly agree with you. I learn all the time in a huge variety of fields, and when I need to learn new tech to accomplish a task I relish it. But if I try to make myself learn something because it would push my career ahead? Force myself to devote some number of hours to a project in a new language, something like that? It's like pulling teeth. I can't get into it.

(+: In general, if the world discriminates against you, is difficult for you, etc - whether or not it's truly worse for you or a perception you have, it doesn't matter to you - what matters is how you react to it. Sitting at home crying how about how it's not fair will never benefit you.)

7y agoHN ↗

Thanks, as someone else with ADHD this is almost entirely spot-on with regards to myself, although I'm perhaps overly anal about the code I work on as a defence mechanism - which sometimes leads to focusing on the minutiae and missing other issues :)

I need the feedback of fast release cycles. I can detect errors fast, take action fast, fix them fast. But "take your time and make sure it's perfect before you throw the switch"? That's just not my personality. I'm high volume (when not artificially constrained) but error prone.

So true, and it's made past jobs very hard work, most especially before I was diagnosed at age 31 and had the benefit of medication and being able to formulate better coping strategies :)

7y agoHN ↗

Out of curiosity, what is your profession?

7y agoHN ↗

Software Engineer who dreams of being in some kind of management some day.

7y agoHN ↗

My thing is. Those meetings are great, but they are pointless until we know what we’re talking about...

7y agoHN ↗

I like how it's a nice articulation of a preference that doesn't denigrate people who have the opposite preference.

7y agoHN ↗

There are actually two of those in that sentence. The one about emails, and the one about doing the long understanding study.

7y agoHN ↗

Stanford CS has at least a couple of people who seem to be really decent humans as well as great computer scientists. Besides Don Knuth, John Ousterhout is another person who comes to mind. Both of them have a humility combined with humor that I find quite admirable.

7y agoHN ↗

Really? So everyone else in CS isn't even a "decent human being" by default for you?

7y agoHN ↗

They were simply commenting that there were a couple people they especially admired, who they think are really decent (i.e., better than average at being decent). It is neither a necessary nor a natural reading to think that means they believe everyone else is below average.

7y agoHN ↗

I just read the outline for volume one, sounds really interesting. Has anyone read V1? What sort of mathematical background is required to understand it? Is it proof heavy and really terse like CLRS?

7y agoHN ↗

I've read the first three, and attempted every single exercise (besides the few he marks as "suggested research problems"). It took me four years to finish, and I had a MSCS when I started. The first volume is probably the most math-intensive, but also the easiest, since a lot of the math is review. V1 is split into two parts: a pure math half, and then a programming half. All of the programming examples and exercises are done in a custom assembler that he calls MIX, but you can find emulators online to run your programs. I've read CLRS and Knuth and I definitely enjoyed Knuth a lot more - there's just something about his writing and exposition that makes the books compelling. They dare as well as entice you to understand them. It's not really as proof-heavy as CLRS IMHO, and TAOCP covers different ground that CLRS does; the only real overlap there is that volume 3 covers sorting algorithms.

7y agoHN ↗

If you like the math in Volume 1, or find yourself having difficulty with it, Concrete Mathematics is a good companion (though also challenging). It goes into greater depth on some of the topics in Chapter 1 of TAOCP and some additional directions. It started as a course aimed at providing the mathematical basis for going into TAOCP.

7y agoHN ↗

Yep, that's on my (very long) to-read list.

7y agoHN ↗

Literally a good understanding of high school mathematics (or, at least, what was high school mathematics back when I were a wee lad) is all you need. There may be a lot of math, and some of it may be used in ways you haven't encountered before, but none of it is tremendously difficult or impenetrable, and the unfamiliarity mostly boils down to "I didn't know you could do that" rather than "I don't know what's going on here".

7y agoHN ↗

Golang comes to mind when I read this:

"He is known for introducing the notion of “literate programming,” emphasizing the importance of writing code that is readable by humans ... "

7y agoHN ↗

I believe he was thinking far more of something like Jupyter Notebook.

I’m waiting for VSCode to implement a bit of API that would allow me to start on an extension turning comments into first-class citizen, with, for example, diagrams, links, or images.

7y agoHN ↗

But it's not really literate programming as Knuth envisioned it. A very important point was that you could write things in any order, and then use tangle to produce source code in the correct order for execution. Jupyter notebooks don't enable this, and in practice evaluating cells in the wrong order is a common mistake if you aren't careful (I've often just given up and restarted the kernel).

Imagine if they did, though. You could do something like put all your imports and preprocessing in an appendix. Or even more complicated: something like writing the inner loop of a function first, discussing it, and only afterwards writing the rest of the function and all the scaffolding.

This would be great, but I've yet to see a true literate programming tool that would actually be usable for my day to day tasks.

7y agoHN ↗

TempleOS has this, sort of.

The normal fileformat for code on TempleOS allows embedding images into the code and directly referencing it. The documentation also automatically generates links to the correct functions and you can generally find all relevant code bits to some piece of documentation.

The terminal in TOS also natively supports images.

7y agoHN ↗

Golang is not what Knuth has in mind. Literate programming is primarily long explanatory comments written around code snippets in a narrative form. Such that you could sit down and read a whole listing as you would a book.

When I interviewed Knuth in 2008 [1], we discussed the failure of literate programming. As you'd expect, he was realistic about the reasons. (About half way down the page)

[1] http://www.informit.com/articles/article.aspx?p=1193856

7y agoHN ↗

Knuth is just ONE section away from writing about my (current) topic of study: Constraint Programming.

His 4th volume of TAOCP is so big that its beginning for him to take decades to write sections. Backtracking search + 3-SAT solvers is really interesting (and very closely related to Constraint Programming), but I'm deeply curious to know what his take on Constraint Programming will be.

Its really odd to be "waiting" for the next chapter of TAOCP. Its a serious body of work that has spanned decades of research and writing... I really hope he finishes the next section sooner.

Maybe I'll go and buy the fascicle for 3SAT and read it while waiting.

7y agoHN ↗

In his recent Dancing Links talk (a couple of weeks ago), he mentioned a generalization of exact cover that also covers constraint programming. You may want to look into that (XCC) in the meantime, in Knuth's fascicle on Dancing Links (https://cs.stanford.edu/~knuth/fasc5c.ps.gz).

I know the feeling of waiting for new chapters of TAOCP; I'm waiting for Chapter 8 on recursion because his idea of it is so different from everyone else's.

7y agoHN ↗

What makes his idea different from everyone else's? I know he covers coroutines, being something not really available in most languages. That said, I thought it was an accepted term and I didn't think that was his invention.

7y agoHN ↗

What makes his idea different from everyone else's

Depth and coverage.

Case in point: Knuth's coverage of Quicksort doesn't calculate the Big-O. It calculates the precise average running time. He literally counts the assembly-language statements. You might say "But arrays might be randomly sorted", and yeah, Knuth averages the runtime across all possible ways that an array can be sorted. Its a beautiful work of math.

There's almost no room for questions once Knuth finishes a subject. Its so exhaustively covered that I can't even imagine questions I have on any subject after he's done writing about it.

The few questions I do have are the "Difficulty 40+" questions that Knuth puts at the end of each section, which would serve as excellent questions for Masters Thesis or a PH.D Thesis. IE: There's no answer to those questions yet.

Anyway, while most textbooks hand-wave the idea of "Quicksort is faster than Mergesort, even both are O(n*log(n))". Knuth is pretty simple, he says: Look at these two precise numbers I've calculated (and proved). Quicksort is faster (or at least, the Assembly-language version of Quicksort he wrote on his imaginary computer is faster)

Basically, Knuth got "to the bottom of it", there's no hand-waving involved in the explanation. He just tackles the hard questions head on and solves it more precisely than everyone else.

----------

Some of the older chapters are going out of date, which is natural for a work so complete. There is so much material out there that Knuth has to make a decision on whether to revise older stuff (which he does occasionally) or to write about subjects which don't have a major unifying work yet (ie: Constraint Programming has some textbooks here and there, but most of its ideas are only in academic journals, and haven't really been unified into a singular work yet IMO. Even the textbooks on the subjects are mostly introductions + references to papers)

And sometimes, Knuth gets lucky. Knuth's Book3 "Searching and Sorting" includes a HUGE table of sorting methods applied to tape drives.

But today's RAM is now faster sequentially rather than random-access. So Knuth's calculations on Tape-Drive sorts actually applies to modern DDR4 RAM better than any other treatment on the subject. No one else calculated the cost of "internal movements" (aka: cache on modern systems, but it was RAM on older computers) + "external movements" (which was Tape Drives in Knuth TAOCP / Book 3, but is really DDR4 RAM on today's machines).

So yeah, Book 3 is out of date and focuses a huge amount of time on external sorting methods. But... it just so happens that if you know a bit about the sequential nature of modern DDR4 RAM, it is actually super-relevant to today's computers.

7y agoHN ↗

That doesn't sound like it is different, so much as just more complete. His analysis of permutations in order to analyze runtimes is, as you say, truly a wonder.

This doesn't feel different from everyone else's idea, though. Unless you just mean in the general complexity analysis, where most of us are basically taught to stop at the highest order terms. It is interesting, because Knuth seems credited with pushing Big-O analysis, but he never stopped at the highest term when analyzing an algorithm. Far as I can tell, he never has. He has done this to compare some algorithms, but even then he has always been empirical for actually comparing things. Treating the Big-O as a hypothesis to test, if anything.

7y agoHN ↗

Oh sorry, to be clear, by "his idea of it" I meant "the way he thinks about it [recursion]". What's different is that when most people learn programming, they pick up the idea that iterative structures (loops etc) are simple, and recursion is something more "advanced", harder to understand. Knuth thinks that recursion is the simpler thing (what comes to humans/children naturally), and the mark of a better programmer is being able to translate recursion into iterative structures.

This seems to tie in with his attitude towards programming in general: while in the zeitgeist the idea is that a good program builds better abstractions until the structure of the program reflects human thought, Knuth seems to think that a good programmer is one who starts with a human-level description of the solution and carefully refines it until it translates into a good set of instructions (in machine code). (There's no contradiction, but the point of view seems different from the usual.)

He briefly mentions something related in his Structured Programming with Go To Statements (1974) https://pic.plover.com/knuth-GOTO.pdf#page=21

I have always felt that the transformation from recursion to iteration is one of the most fundamental concepts of computer science, and that a student should learn it at about the time he is studying data structures. This topic is the subject of Chapter 8 in my multivolume work; but it's only by accident that recursion wasn't Chapter 3, since it conceptually belongs very early in the table of contents.

7y agoHN ↗

I think some of this is likely to be a product of the times. The vast majority of early programming languages were not friendly to recursion. It wasn't at all uncommon for functions not to be reentrant, and to rely on self manipulation to set the return stack, if I recall.

Even today, for many "systems level" programs, you have to take extreme care around recursion, since you are likely to blow the stack limits. (That is, you can't just use recursion freely, but instead have to prove the maximum depth that you will trigger it.)

That is to say, I don't see what makes this different than how most others view recursion. If you can afford to do it, then you should do so. If you can't, then you should be ready for a lot of his other tricks. (Threaded trees being my personal favorite, at the moment. DFS with no stacks? Crazy talk! :) )

7y agoHN ↗

Definitely a product of his times (like everyone). Let me put it this way: to my knowledge, Knuth is the only programmer from his times, still writing, programming, and writing about programming. So you get a 1960s perspective from someone who's seen (and programmed in) 2018; that's not very usual.

(BTW I'm not sure that Knuth would wholeheartedly agree with “If you can afford recursion, then you should use recursion”. Perhaps he'd consider the program half-written. That's in some sense the crux of what I think is different.)

Let me put it another way: I thought I knew how to generate all permutations of a set of numbers. When I saw questions about it on Stack Overflow or Quora, I answered. When I opened Volume 4A, it disposed of what I knew in the first half-page, and proceeded to discuss the problem for over 50 more pages. I thought I knew about backtracking, having written backtracking programs hundreds of times (always implemented using recursion). Knuth's section on backtracking obliterated everything I knew (and with no recursion in sight). So I'm looking forward to when he gets around to writing about recursion, to see what I can (un)learn about something so fundamental.

7y agoHN ↗

His dlx algorithm makes heavy use of recursion. As do many of his cweb programs. In one, he comments it as "textbook" stuff.

Your point on him being one of the main programmers from his time still programming is fair.

7y agoHN ↗

I spent meaningful amounts of time this summer with TAOCP. The unusual ways of thinking, the diligence, and building solutions from the ground up were astounding. There are ways of thinking in there that, I think, can be ported into the modern world which would revolutionize the systems they touch.

7y agoHN ↗

It's completely bizarre that it is taught in this way. Knuth is absolutely right. Recursion is easy but the problem is computers don't actually work that way. I don't understand how anyone who has programmed for a while can think recursion is the cool or tricky thing to do.

Even worse is that recursion is taught using stupid examples like the fibonacci numbers rather than something that actually needs it like quicksort.

7y agoHN ↗

I agree: as much as I love the Fibonacci numbers, it's better to teach recursion with something like (say) implementing directory traversal (printing all files under a current directory, like ls -R) -- some problem both where the recursive nature of the problem itself is obvious, and where it would be more awkward to implement without recursion. I'm looking forward to seeing what problems he thinks really merit recursion.

7y agoHN ↗

For some reason on this particular article I found it amusing to realize several times that a given concept they were talking about was something I'm familiar with, but it had been translated first from "nerd language" into "layman." Pretty common practice for a general audience, so I'm not sure why it stood out this time. Examples: bytecode, assembly language, frameworks, machine learning. Counterexample: Libraries, where they used the actual word, denying me the silly little pleasure of going "Oh you mean libraries."

7y agoHN ↗

I actually thought this article did a really good job (certainly better than most) at explaining complex CS concepts.

7y agoHN ↗

The world would be such a better place if there were 1000 more people like him. What a wonderful human being.

7y agoHN ↗

Donald Knuth, Noam Chomsky, David Attenborough. I don't see why we need more arguments to allow human cloning :p

7y agoHN ↗

Once met Yoda himself on the 59th street platform of the Metra next to the University of Chicago. He needed to get to the airport within 45 minutes. I told him he needed to call a cab. Now I get to tell people I once helped him optimize an algorithm. ;-P

7y agoHN ↗

Don't have time to look through the code right now, but it seems like a lot of these effects could be implemented as cellular automata (a la Conway's Game of Life). Obviously there are some more advanced simulations going on here though.

7y agoHN ↗

More worrisome, perhaps, are the algorithms that are not written by humans, algorithms written by the machine, as it learns.

Can anyone show even one example of a computer writing an original and useful algorithm on it's own? Total misunderstanding of deep learning and "AI" is so common in today's PopSci.

7y agoHN ↗

When weights are tuned you are technically left with a different behavior of an algorithm than when it started. When this tuning happened automatically, it's not really a misunderstanding.

7y agoHN ↗

Weights are just input data so you are still left with the same algorithm.

7y agoHN ↗

I actually think this is a pretty literal description of automatically learned decision trees, which are used in practice (directly or as sub parts of state-of-the-art techniques like gradient boosting). It is basically learning a series of complex nested if statements.

Edit: also, there is actual work done in so-called “program synthesis”, especially employing Bayesian techniques, although it’s way more experimental and I haven’t heard of it being used “in the wild”.

7y agoHN ↗

Decision tree models are trained by a machine learning algorithm that a human implemented. DTrees don't create new algorithms, they are calculated/trained through the application of an algorithm on data.

You can find these DTree-generating algorithms in any decent machine learning algorithm textbook, and you can execute the steps by hand. For example, on page 56 (or pdf page 68) of [0], you can step through the ID3 decision tree algorithm. At no point is a new algorithm generated.

[0]: https://www.cs.ubbcluj.ro/~gabis/ml/ml-books/McGrawHill%20-%...

7y agoHN ↗

to my understanding, a bunch of nested if-else statements is an algorithm, and if you change all the conditions in the if statements, you get a different algorithm.

so e.g. ID3 is an algorithm, designed by a human, that produces new algorithms, only indirectly designed by a human. we may be talking past each other, though. i just think it's reasonable to apply the word "algorithm" to things that are simple/stupid enough to be generated automatically, and so it's no big deal to talk about algorithms writing algorithms.

7y agoHN ↗

to my understanding, a bunch of nested if-else statements is an algorithm

A bunch of nested if-else statements can be reduced to a boolean expression and a boolean expression is hardly an algorithm. If you change the conditions you simply get a different result not a new algorithm.

7y agoHN ↗

https://en.wikipedia.org/wiki/Program_synthesis

It's quite clear from the Wikipedia page that program synthesis is not producing new algorithms.

If I'm wrong, it should be easy to show. Simply point out one concrete example. Not research or articles discussing the idea but an example of actual original computer generated algorithm.

7y agoHN ↗

I really think we're talking past each other, and that you must have some more restrictive definition of "algorithm" than me, because I'm reading that page and it walks you through an example in excruciating detail of how given a specification for "maximum", program synthesis produces an algorithm for computing "maximum".

7y agoHN ↗

One thing I found really fascinating in the article is, the author when trying to provide an example of an algorithm used the "Command+F" combination to suggest searching on a page. This is distinctly a mac thing. Not just that it doesn't exist on Windows. Have we moved to a point where using Mac only things is acceptable in a general article like this? I mean, even now the bulk of the machines in the world run Windows, so is that an error in proof reading or is that ok now? I couldn't have imagined someone doing that 10 or even 5 years ago.

7y agoHN ↗

Not sure why I'm engaging this...

I think it was allowed because that knowledge of the shortcut is ubiquitous enough that it is understood by most everyone.

I imagine the offices at the times use Macs.

I'd also argue that "the bulk of the machines in the world" run unix-like operating systems by no small margin.

It's true though that for most of the past few decades 'Ctrl+F' would make more sense, and it still remains an interesting editorial decision.

7y agoHN ↗

My Uncle is a researcher and has one of those famous checks from Knuth for pointing out an error in the book. Needless to say, he never intends on cashing it in, and treats it like a little trophy.

7y agoHN ↗

One fine spring afternoon, I saw Don Knuth at the Golden Gate Park. I think he and his partner were out bird watching or some such thing. I decided not to approach them and let them be.

Seeing him in person is something I'd never forget and take it with me to my grave. Such is the mastery of their craft that even a glimpse of their presence from a distance leaves a lasting impression.

Don Knuth is simply too precious.

7y agoHN ↗

When Java was new, James Gosling and I gave a talk about it to a group that included Don. When we gave the talk I was in the process of leaving Sun for a startup. A couple of years later Don mentioned to me that the talk was the first time we met and, at the time, he couldn't figure out if I was really smart or really stupid for leaving Sun right after Java shipped. In 2010 we both agreed that in the long term, it was the right choice for me, but neither he nor I could have predicted that at the time.

7y agoHN ↗

At some point, I loaned out Vols 1 & 3 of my 1981 edition to a co-worker then forgot about it. Adios! Same thing happened to my DVD set of "The Prisoner" series with Patrick McGoohan.

Let that be a lesson: If you loan something out, consider it a gift.

7y agoHN ↗

Irony: “literate programming” means pretty much the opposite of “self documenting code” (AKA - undocumented code)

First write the documentation, then embed relevant bits of code next to the relevant discussions, then have a special compiler / build process create the binary / program.

7y agoHN ↗

I remember when I took the programming algorithm class back in college. That was the first time I saw Dr. Knuth's book the art of programming... and I was thinking "what the? Are we supposed to read this?"

7y agoHN ↗

Knuth says in the Preface to Volume 1 that "A shorter version of Volumes 1 through 5 [chapters 1-10] is planned, intended specifically to serve as a more general reference and/or text for undergraduate computer courses; its contents will be a subset of the material in these books, with the more specialized information omitted."

I realize he can't shorten what he hasn't written, but I wish he had been able to write this shorter version years ago, and then work on filling in the details in the now-ever-expanding sequence of in-depth volumes.

7y agoHN ↗

I've been at one of his Ask Me Anything-lectures. They are pretty cool, but I feel that they are limited by the audiences questions. If he doesn't get interesting questions then he can't provide interesting answers.

I wanted to ask if he had Autism because he looks, talks and walks as if he had, but I didn't get the chance. I wonder if Knuth has elaborated on the subject? Anyone knows?

7y agoHN ↗

It's really rude to ask someone about their medical conditions, even more so in public. Please don't do that. It is also not a good idea to attempt to diagnose psychological issues from a distance.

(But if we're playing that game, Wikipedia defines "autism" as "a developmental disorder characterized by troubles with social interaction and communication, and by restricted and repetitive behavior", and Knuth is supremely good at communication and remarkably good at social interaction for a (self-described) "geek" -- if you go over his life history (e.g. https://www.youtube.com/playlist?list=PLVV0r6CmEsFzeNLngr1Jq...) and consider all his activities -- being part of social clubs and fraternities, helping with the basketball team, dating and getting married, playing pranks on people, the affection with which he talks about his wife and children, his humorous outlook, etc -- then there does not seem to be any evidence of what you're thinking. Even the current article speaks of his warmth. But really, we shouldn't be doing this.)

7y agoHN ↗

I love all the Knuth stories in here, shows how much of an impact this man had on us.