Live data from Hacker News

For Donald Knuth, good coding is synonymous with beautiful expression

quantamagazine.org

91–100 of 229 posts

Re: For Donald Knuth, good coding is synonymous with beautiful expression

#91
post #4

I like this: "A person’s success in life is determined by having a high minimum, not a high maximum. If you can do something really well but there are other things at which you’re failing, the latter will hold you back. But if almost everything you do is up there, then you’ve got a good life."

I've heard it said (maybe by Frank Zappa? can't remember for sure) that the difference between a professional musician and an amateur is not how well they play at their best, but how well they play at their worst.

Amateurs focus how to get things right, Professionals focus on how to make sure things aren't/don't-go wrong.

Re: For Donald Knuth, good coding is synonymous with beautiful expression

#92
post #87

Earlier quoted context omitted.

>The ceramics teacher announced on opening day that he was dividing the class into two groups. All those on the left side of the studio, he said, would be graded solely on the quantity of work they produced, all those on the right solely on its quality. His procedure was simple: on the final day of class he would bring in his bathroom scales and weigh the work of the "quantity" group: fifty pound of pots rated an "A"…

Cool but fake.

You should really post a source.

Re: For Donald Knuth, good coding is synonymous with beautiful expression

#93
post #32

A thing I never knew before: Donald Knuth, the paragon of scholarship and of a life well spent, not only cleans his own toilets but bought a specific janitorial uniform to make the process more efficient. I find this inspiring enough that I am going to clean my toilet now.

I believe you misunderstood a very important point.

The uniform isn't for "efficiency". For cleaning one toilet, changing in and out of uniform would ruin the efficiency of having a pocket for 409 spray.

The uniform is for fun.

"Jill and I got uniforms that have a slot where the 409 cleaner fits. You go over there and squirt and feel good cleaning the toilet!"

Re: For Donald Knuth, good coding is synonymous with beautiful expression

#94
post #78

> I write an average of five new programs every week. Poets have to write poems. I have to write computer programs. It seems more obvious now that I read it. A lot of programmers out there, including myself, are looking for ways to improve their skills and I never thought to myself to write more programs. And not just programs for the sake of programs, but programs that force you to explain to the computer that you u…

What does it mean though? What programs? I can't write new programs at work where I maintain existing applications for the most part. What kind of programs, not for the sake of programs, can you actually write almost daily?

I think what he has in mind are small programs that do some kind of nontrivial computation without much in the way of IO or UI. For example, [1] is a program from December 2019 that "finds n-bit binary squares that are palindromic".

A great way to get into this kind of thing if you're stuck for ideas is to go through the Online Encyclopedia of Integer Sequences [2] and just write little programs to print out the first n entries or whatever for a particular sequence. As other comments have suggested, don't worry about making them perfect, just get the numbers right and then move on to the next one.

[1] https://www-cs-faculty.stanford.edu/~knuth/programs/squarepa...

[2] https://oeis.org/

Re: For Donald Knuth, good coding is synonymous with beautiful expression

#96
post #60

Earlier quoted context omitted.

Totally agree. It doesn't help at all. Pseudocode would have benn sufficient. Fake machine code? Nope.

MMIX programs can actually be run, and MMIX has multiple simulators. Actual MMIX chips can be made. MMIX also allows students to reason about the properties of modern chips without experiencing quite the complexity they'd have to deal with normally. This is valuable for many reasons.

Yes, that's part of the tradeoff between (what could theoretically be) actual machine code and pseudocode. The other advantage of a language like MMIX is, as another comment stated, you can't ignore things in the cost model. This allows more precise calculations of what the runtime of these algorithms is.

OTOH, pseudocode is easier to understand, partially because you don't have to think about some of those extra things that don't actually matter in the cost model. For an expository text (and, TACOP is an expository text), I think MMIX comes down on the wrong side of the tradeoffs.

Re: For Donald Knuth, good coding is synonymous with beautiful expression

#97
An interesting book interviewing high-level programmers is https://en.wikipedia.org/wiki/Coders_at_work. The book starts out with JWZ and ends with Knuth. In addition to covering their work, Peter also asks each one whether or not they have read TaoCP, how they feel about C++, and whether the use a debugger.

Only one of the people has read the book, with even Knuth saying that he hasn't read it. Of course, he is joking.

But this is a fun read.

Re: For Donald Knuth, good coding is synonymous with beautiful expression

#98
post #78

Earlier quoted context omitted.

What does it mean though? What programs? I can't write new programs at work where I maintain existing applications for the most part. What kind of programs, not for the sake of programs, can you actually write almost daily?

I think what he has in mind are small programs that do some kind of nontrivial computation without much in the way of IO or UI. For example, [1] is a program from December 2019 that "finds n-bit binary squares that are palindromic". A great way to get into this kind of thing if you're stuck for ideas is to go through the Online Encyclopedia of Integer Sequences [2] and just write little programs to print out the firs…

Along these lines, Project Euler is great.

Re: For Donald Knuth, good coding is synonymous with beautiful expression

#99
post #88
post #78

Earlier quoted context omitted.

What does it mean though? What programs? I can't write new programs at work where I maintain existing applications for the most part. What kind of programs, not for the sake of programs, can you actually write almost daily?

We're business application/infastructure maintainers, not programmers. It's a different world from Knuth's expressions of mathematical ideas. Outside of work, it's easy to write whole programs. Project Euler, LeetCode, etc. These are the kinds of programs Knuth is talking about -- example programs to illustrate algorithms from TAOCP.

I understand that but those don't fall into the "not for sake of programs" category.

Under that category, I imagine something where the resulting program itself is of any, however minuscule, use to me.

Re: For Donald Knuth, good coding is synonymous with beautiful expression

#100
post #78

> I write an average of five new programs every week. Poets have to write poems. I have to write computer programs. It seems more obvious now that I read it. A lot of programmers out there, including myself, are looking for ways to improve their skills and I never thought to myself to write more programs. And not just programs for the sake of programs, but programs that force you to explain to the computer that you u…

What does it mean though? What programs? I can't write new programs at work where I maintain existing applications for the most part. What kind of programs, not for the sake of programs, can you actually write almost daily?

I find lots of little utilities fit the bill. They are oftentimes sufficiently narrow in scope to be of little use to anyone but the author, but that shouldn't necessarily eliminate their use.

For example, here is a Gist with a shell script I wrote that, given a set of Maven coordinates, works with a few other tools to build out a docset for use in Zeal / Dash.

https://gist.github.com/michaeljmcd/5564758537946963e946806e...

I had to dig into some corners of Maven I didn't know well to pull it together and it formalized some random bits of minutae.

Nothing elegant or crazy, perhaps, but it is a bit of coding apart from the normal day job that taught me a couple of tricks.

Post reply on HN