Live data from Hacker News

For Donald Knuth, good coding is synonymous with beautiful expression

quantamagazine.org

171–180 of 229 posts

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

#171
post #22

Earlier quoted context omitted.

That's how I read it also. Take for example Kurt Cobain (whatever you think of him and his music). He had major success in music, but his life was a disaster and not something I'd hope for a loved one. I do agree that it seems like the best art is created by "tortured artists".

Tortured artists have produced some great work, true. J. S. Bach had some hardships in his life, but he wasn't tortured. J. R. R. Tolkien, similarly, was not tortured. da Vinci's life doesn't seem to have been horrible either. I think they stand as strong counterexamples to the idea that tortured artists make the best art.

Tolkien wasn't tortured, but he fought in WWI.

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

#172
I think a point is that when you create software there are so many choices how you could create a given piece of program. Trying to figure the best way to do it before you actually do it could take very long, and you still would not be very much wiser because it would all be in your head not in software. Whereas if you just do it you have something you can learn from, and make incrementally better

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

#173

Earlier quoted context omitted.

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…

> is a program from December 2019 that "finds n-bit binary squares that are palindromic". No dis-respect for Donald Knuth (who of course I found orders and orders of magnitude above programmers such as myself) and no dis-respect to people that found those types of programs interesting, but there are also programmers (like me) for whom those programs are just simple riddles, with almost no interest whatsoever. They're…

When the very adjacent sentence is “Poets have to write poems”, I think this question is like asking “what kinds of poems, not for the sake of poems, can you actually write…”, then ask about how they change the world, etc.

Even poets don't write poems just for the sake of poems — they write because it gives them pleasure, because they are moved by some strong feeling or because they have some irresistible urge to say something, etc. (And sometimes because they're being paid for it, or hope to be.) Anyway, here are some reasons (in no particular order, and not mutually exclusive—there's some overlap) for Knuth to write programs:

1. Because it gives him pleasure.

2. Because he wants to find out the answer to some question — for instance, how many knight's tours are unchanged under a 180° rotation?

3. Because he wants to experiment or gain more experience with some algorithm(s) or method(s) that he's learning or writing about.

4. Because he wants to collect data on their performance, so that as a scientist when he makes a statement like “a program using this algorithm finds the answer for N=13 using only 0.3 billion memory accesses”, it is a correct statement.

5. Because he wants to understand something better (e.g. his program for linear programming where he says he understood the simplex method clearly only after implementing it).

6. Because he wants to "debug" or interactively see what sub-components of some algorithm do.

7. Because he has encountered (or been posed) a hard problem and wants the challenge of solving it.

8. Because he has seen a beautiful program and wants to translate it to his preferred style, as he'd like more people to appreciate its clever ideas. (E.g. his reimplementation of the original "Colossal Cave Adventure" game of Crowther and Woods.)

9. Because he wants to provide this program as an illustration of some idea or algorithm mentioned in his books.

10. Because someone has asked him for the program.

One can easily imagine more reasons. Though at the rate of five a week it would be more than 7500 programs over the last 30 years, he has given a few examples on his webpage: https://cs.stanford.edu/~knuth/programs.html (Many of them are in CWEB so to help people who don't have `cweave` installed, I typeset them in 2017: https://github.com/shreevatsa/knuth-literate-programs/tree/m... — I ought to update the repository sometime.)

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

#174
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."

That's about the most depressing thing I've ever heard. So basically if I'm not great at everything I suck. I guess Knuth must be amazing in bed, can play every instrument known, solve top problems in quantum mechanics, compete in all olympic events, etc or he's not having a good life.

Based on similar things he's said in many previous interviews, I think you should read "success in life" as "happiness in life", etc: read the quote as something like: A person’s happiness in life is determined by having a high minimum, not a high maximum. If you enjoy something a lot but there are other things which make you miserable, the latter will hold you back. But if almost everything is enjoyable (or at least tolerable) to you, then you’ve got a good life. — see the example from the article where he got uniforms to make toilet-cleaning more fun.

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

#175
post #129
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?

Stack Overflow is a great place to practice writing short programs or even just code snippets. Just look for interesting problems and solve them.

I'm a frequent user of SO, but I find leetcode [1] much better when I just want to practice coding / problem solving. Their free account is more than enough to have some fun ;)

[1] https://leetcode.com/

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

#176

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"…

Resonates with the rise of USA. A few books about electricity mentionned that Europe was caught in a neverending debate about ideal theories while US was applying simple tricks and improving understanding on the way. I'm also wildly guilty of the analysis paralysis... I did try to set up schedules and goals to iterate but it always die before I did any real progress. Oh and btw, some dude said Wright bros. won the ra…

Reminds me of SpaceX. everytime I see their BF metal tank blow up, I’m like “yasssss progress”.

I absolutely believe that SpaceX will land a human on Mars in our lifetime. Not sure how long they’ll survive and whether a colony is possible but they’ll definitely make it way cheaper to send shit to mars/moon than it is today.

Also I’m bullish that we’ll make big breakthroughs in DNA and protein folding/interaction understanding. Building with the same molecular machines of life opens up so many possibilities.

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

#177
post #175
post #129

Earlier quoted context omitted.

Stack Overflow is a great place to practice writing short programs or even just code snippets. Just look for interesting problems and solve them.

I'm a frequent user of SO, but I find leetcode [1] much better when I just want to practice coding / problem solving. Their free account is more than enough to have some fun ;) [1] https://leetcode.com/

I disagree. Leetcode and related sites have problem descriptions that are often vague or nonsensical. Just figuring out what the author is trying to say is more of a challenge than the actual program sometimes.

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

#178
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 myself writing debugging tools all the time. For example, our logs are overwhelming because our developers use them for debugging and then never remove their logging statements. So finding anything in them is next to impossible, and it's often interleaved with a bunch of other junk that's meaningless to you. And fixing the logging system we use would to make this work better would also be a huge task.

So a little while ago we needed to log some info to figure out where 2 parallel sets of calculations were going wrong. So I wrote some logging that output the info to a file instead of the main log, and then wrote a simple parser to read them in and display them side-by-side in a nice hierarchical tree structure. It made something that normally takes us a week to work out only take a few hours. It's something we'll never ship to customers, but helps us enormously.

I'm finding myself writing more and more stuff like that these days.

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

#180
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."

Are you all claiming that people with one-hit wonders aren't succesful? Like yeah, Baauer isn't especially talented but he's going to be remembered forever for "Harlem Shake" Same with Sir mix-a-lot and baby got back. They have some pretty low minimums. If you make one great work - you can coast on that forever.

One hit wonders are statistical flukes. They seem to achieve something by being at the right place at the right time and delivering an amazing performance.

I remember Harlem shake is a thing but can't remember who Baauer is. I know about Sir Mix-a-lot, but couldn't recall any of his tune.

I think you need more than great work to get me remembered forever.

The Beatles certainly achieved that, in year 3000 some people will probably talk about them. I'm not so sure about Vanilla Ice.

Post reply on HN