Live data from Hacker News

For Donald Knuth, good coding is synonymous with beautiful expression

quantamagazine.org

71–80 of 229 posts

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

#71

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

Something that I found useful is taking the concept of katas from martial arts. Writing the "same" program multiple times, but trying to refine the parts I didn't like in the previous iteration (e.g. try writing in less code, with smaller functions, with less libraries, in a more testable way, etc).

It's specially rewarding to do this exercise with utility libraries, as it teaches you about the nuances one abstraction level below (both in terms of learning what is possible but not exposed by the abstraction and in terms of learning what pitfalls exist). Many times I find that it's more elegant to drop down one abstraction level to accomplish something than to add more abstractions on top due to lack of understanding outside my primary abstraction level.

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

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

Interestingly a lot of the self-helpy books coming out recently say the opposite: that investing effort into improving strengths has a higher return than improving weaknesses.

Initial impressions are driven by strength while lasting impressions are formed by your weaknesses. So building up those strengths will get you the job offer, but bolstering your weaknesses is what gets you the promotion.

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

#73
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.

This is similar to skateboarding. If someone wants to go from zero to landing one kickflip in a couple of days, he can (albeit a terrible one), yet while the best skateboarders may very well miss their tricks more often than videos would make you think, but their overall consistency is incredible. When one lands a trick for the first time, the saying goes: "Two to make it true".

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

#74
post #70

As Paul Dirac so eloquently put, > “I think that there is a moral to this story, namely that it is more important to have beauty in one's equations that to have them fit experiment. If Schrödinger had been more confident of his work, he could have published it some months earlier, and he could have published a more accurate equation. It seems that if one is working from the point of view of getting beauty in one's eq…

Isn't this line of thinking which has held physics back for the past few decades? I thought that physics is gradually moving to being more data driven than being driven by ideas of beauty. Sabine Hossenfelder has written quite a bit about this.

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

#75
post #24

Earlier quoted context omitted.

I feel like this is often a distinction between engineering and science books. I'm used to reading books on physics where the authors (even the Russians) give a bit of background and (usually made up) history but when I go to read a book on something like Finite Element Analysis (For engineers) it feels like the author is literally just dumping his life's work into LaTeX without any thought beyond A->B. Don't get me…

Matlab by itself isn't the problem, it's just that a lot of professors write pretty terrible code in their textbooks. Python won't fix that. None of the mathematics, physics, or engineering texts had much history outside of some occasional excerpts. I'd like to see more of that though as it helps things click for me.

I think MATLAB is a little bit of a problem. Or at least, I want to kill myself whenever I have to use it. Python too although in more subtle ways (I like to abuse the type system, Python is just a hacked together pile of shit with tolerable syntax)

Physics textbooks tend to get "unique" when you get to topics like Quantum Field Theory. Basic Textbooks are usually fairly to the point.

"Advanced Engineering Mathematics" is a good book with a fair amount of history (and written by a mathematician so no Engineering-isms e.g. Notation recognizable to other human beings)

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

#76

Earlier quoted context omitted.

I agree that Knuth's exposition is a joy to read, and there are a lot of significant mathematical insights to be had within those volumes. I just wish he could get away from MIX/MMIX. I don't find it very useful or interesting as a pseudocode, and I think it gets in the way of understanding.

Yeah that’s actually what I found intimidating about TAOCP when I was in undergrad. But I stuck with it, and it was a genuinely good read. I feel like SICP is a better introductory text, though.

TAOCP was never intended to be an introductory text, so that's unsurprising.

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

#77
post #48
post #20

Earlier quoted context omitted.

> Seems like an interesting way to get into programming. This would be an iconoclastic route into programming, to say the least. If you are looking for a more approachable or practical book that gets you programming and introduces some theory I recommend “Classic Computer Science Problems in Python” by David Kopec. Reading TAOCP to get into programming is sort of like reading a physics textbook in order to build a do…

Iconoclastic? What idols are being smashed by our hypothetical TAOCP-reading novice?

perhaps the learn how to program X in Y days "icon"?

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

#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?

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

#79
post #57

Earlier quoted context omitted.

This is why it's important to identify your weaknesses. Once identified they are no longer weaknesses but areas to work on.

I've heard that it's better to leave weaknesses be and instead utilize your strengths. The reason is because if you just work on your weakness, you end up being just mediocre. What's your opinion on this?

My opinion is that you can do both. Working on your weaknesses doesn't mean ignore your strengths.

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

#80
post #75

Earlier quoted context omitted.

Matlab by itself isn't the problem, it's just that a lot of professors write pretty terrible code in their textbooks. Python won't fix that. None of the mathematics, physics, or engineering texts had much history outside of some occasional excerpts. I'd like to see more of that though as it helps things click for me.

I think MATLAB is a little bit of a problem. Or at least, I want to kill myself whenever I have to use it. Python too although in more subtle ways (I like to abuse the type system, Python is just a hacked together pile of shit with tolerable syntax) Physics textbooks tend to get "unique" when you get to topics like Quantum Field Theory. Basic Textbooks are usually fairly to the point. "Advanced Engineering Mathematic…

With Matlab, you can immediately create a Matrix and transpose it, find the inverse...etc. I think it is optimized really well for undergraduate excercises that are really simple (I have two numerical methods textbooks which use Matlab fine). I agree that anything more complex than a couple of functions and a loop is probably better off somewhere else in a lot of cases. With that being said, it has built-in support for GUIs, sparse matrices and other stuff which is a lot harder in C++, so easy to see why it is popular for academic and R&D type work. For a student, the commercial cost is only ~$30 or free at a lot of schools, so usually not a barrier.
Post reply on HN