Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Computer science, historically, has been a field filled with books that encourage you to write code while not particularly having you read much of it. K&R is a good example of this. PAIP went against this notion, and has you spend much of the book reading code.

Yes, this is taking the way learning is done in almost every case and field and applying it to programming. No, it still hasn't really caught on universally in computer science.



Has it not caught on because it might not align with people’s experiences?

I know for me, reading is only the first step in learning. Doing is far more educational, and often when things go wrong, I go back and read it again. So I wouldn’t argue that reading isn’t worthwhile, but at least in my experience reading is only 50% of my learning process, I might I’m even go lower than that, 20-40% range.

As an example, I read the Rust Book beginning to end, but it wasn’t until I started writing code with it that I truly understood some of the concepts, like move-by-default. When I read about move-by-default, I understood what it was saying, but I only grokked it after writing code and experiencing it—and at the same time realizing that it was the first time I’d actually worked with a language that had that as a fundamental piece of it.

I have a lot more examples like that, just happens to be a memorable one.


> K&R is a good example of this.

I don't see how K&R can be a good example (or a bad one or any kind of example at all) in the context of computer science education. Its purpose is to teach the C language to experienced programmers. It has no aspirations of teaching computer science.

K&R is not even about teaching you to code. It says in the preface to the first edition that it assumes you already know concepts like loops and assignment statements. It also says if you're a beginner, you need to supplement the book by seeking the assistance of someone with more experience.


K&R is still an example of computer science education. Programming languages are a subset of computer science, it's a book that tries to teach you a language. There's a substantial body of evidence in linguistics research that input is just as important if not more than output when it comes to learning a natural language; programming languages are no different.


K&R doesn’t even come up in a computer science education. The algorithms class I took 25 years ago now was mostly reading and writing algorithms by hand on paper.

I think maybe you’re referring specifically to learning how to program and not computer science at all. Because nearly every CS curriculum was dominated by a lack of hands-on programming and only in the last decade or so became more code-writing focused, which is exactly the opposite of the narrative you are painting here.


> K&R doesn’t even come up in a computer science education.

K&R was the main textbook for my first university CS class at Caltech in 1990. (Though, to be fair, the bulk of what I would call “computer science” as distinct from “mechanics of programming in the language used for the class” of that class was taught through other means, but still.)


The malloc exercise in K&R is CS.


Seems related to Alan Kay calling it a "pop culture". Or perhaps even "punk", meaning it's not learnt from the classics, or some "Elements" text, you just do it.


> Yes, this is taking the way learning is done in almost every case and field and applying it to programming. No, it still hasn't really caught on universally in computer science.

Man, it's almost like a field accidentally discovered a better way of working and other people are slowly trying to make them more normal. Learning by fast feedback on individual action is better than learning by reading and not acting.


It's not like that. "Learning by doing" predates language much less writing. Apes do it. Many animals do I'm sure. That has never gone away even from the most stuffy old elitist realms of academia, has it?


Hmm. Does language itself come from inventing a way to express what one wants to express? What would Chomsky say? https://youtu.be/hdUbIlwHRkY


That might explain why so many people learning a novel programming language start, but nearly never finish, writing a book or tutorial about it.

For example, there are far more incomplete Common Lisp tutorials than there are working / fleshed out code examples on GitHub. The endless unfinished tutorials and "books" are suspiciously similar, and nearly always give up at the same not-yet-practical level.

The same goes for other technical subjects. Raspberry Pi is another area where you can find different versions of nearly the exact same incomplete tutorials everywhere.


This is because there's a point where you can do something but you don't know how, less even how to explain it. If you ever mentor a more junior engineer this comes up all the time, like "yeah I have no idea why you broke the build, we can fix it together but I am not sure I can step by step explain all my actions".


I find programming is fairly analogous to math, music, classical art and any other endeavor with both complex analytical component and complex practical component - you need both to study examples and prior art, and do lots of exercises yourself (unless one is genious/savant in which case pedagogy conventions seldom seem to apply).


All the code in TAOCP is read-first, since you're not readily going to type it in and run it at all.


This just shot PAIP to the top of my reading list. I’m going to go grab it now.


I hope you enjoy it! I got a lot from checking it out.


I assure you he did not kick start that idea in computer science.


Who did? (If anyone)


I doubt anyone really, a lot of results and major work in computer science came from mathematicians and academia where reading had long been a primary method of teaching. There is a long and rich history of great papers and text books in early computer science.

Even getting to the more applied side of things, books are common. Perhaps the most well known one https://en.wikipedia.org/wiki/The_Art_of_Computer_Programmin... predates Norvig by several decades (not that I think Knuth kick started the idea either). Yes it does have exercises after each chapter but these are far less than the very dense extensive reading content including application of algorithms (and questions are obviously optional, and in the typical style of math text books).


TAOCP uses a significantly different methodology of teaching, and it's also very explicitly aimed at a significantly different market of programmer and in a significantly different area of endeavor within computer science.

It's a great work (I'd be lying if I'd said I'd poured into the entirety of it extensively, but I've spent weeks on certain portions, like the MMIX fascicle and Sorting and Searching), but PAIP has a significantly better claim at "kickstarting" the "read code instead of write it" trend, because in TAOCP the code doesn't take center stage, and it was never the point for it to (hence the creation of MIX & MMIX).


I didn't say it attempts the same thing, I said it's an example (just one of many) of learning by reading in computer science that long predates 1992.

Pointing to examples (K&R) advocating learning by writing is not evidence that learning by reading was not widely known and used in computer science. That's a logical fallacy.


I edited my comment pretty significantly to clarify; you might want to give it another look. Putting this comment here to avoid the "Wow, what an irrelevant comment" problem. You might find your comment, while a decent literal reading of my initial comment, might not hold up to the new one.

I will point out, though, that I never said anything along the lines of "was not widely known [...] in computer science." What an absurd thing to accuse a comment of saying! I do insist that it wasn't widely used, though, and TAOCP, a series that's infamous for not actually being read often, isn't a great example of it being widely used, even if TAOCP did fit the criteria (which in my updated comment above, I contest).


> I edited my comment pretty significantly to clarify; you might want to give it another look. Putting this comment here to avoid the "Wow, what an irrelevant comment" problem. You might find your comment, while a decent literal reading of my initial comment, might not hold up to the new one.

I did not find that. This is the first paragraph of your edited comment:

> For anyone not in the loop, Norvig was the author of Paradigms of Artificial Intelligence Programming. This was a substantial contribution to the field of educational computer science literature, and helped to kickstart the idea that the way to learn is to read, not just write.

It's still wrong. It did not kickstart that idea in computer science.


They said:

> "Computer science [..] filled with books that encourage you to write code [..] PAIP [..] has you spend much of the book reading code."

You replied:

> "There is a long and rich history of books in early computer science."

which seems to be missing the point, it's not reading books they are talking about, it's reading code as something to learn from, compared to learning by writing code, as the change which PAIP kick-started. "no you're wrong" is a low quality rebuttal, even moreso when it's backed by nothing more than the "assurances" of a throwaway account.


> has you spend much of the book reading code.

I went back to the original post that said it was edited, rather than that one. If it was there all along and I missed that part about reading code specifically then that doesn't really change what I wrote at all. TAOCP has vast amounts of code you are expected to read and understand (pseudo assembly and a fairly rigorous algorithmic specification language even if it may not be a "real" language).

But reading real code has long been a "thing". Why do you think UNIX and derivatives were so popular and widely used as teaching aids in universities in the 70s and 80s?

> which seems to be missing the point, it's not reading books they are talking about, it's reading code as something to learn from, compared to learning by writing code, as the change which PAIP kick-started. "no you're wrong" is a low quality rebuttal, even moreso when it's backed by nothing more than the "assurances" of a throwaway account.

I don't think it's worth getting too upset over. The "assurance" is a figure of speech, not appealing to my authority. And I don't see why you're getting calling out a low effort response because it is in response to a low effort claim. I didn't think it required anything more.


In throwawaylinux's defense, they've been using the account consistently for three months, and have a sizeable portion of karma (roughly (* 3 x) my own current 222, and (* 40 x) my own two days spent here). I believe, if I'm not mistaken, enough to use every point-based tool on the site (flagging, downvotes, colorbar). It's perhaps less than fair to wipe away a person who seems to be giving a good-faith effort like that, even if they're ultimately wrong about something.

I completely agree with everything else you said, though.


"When was the last time you spent a pleasant evening in a comfortable chair, reading a good program?" -- the famous opening sentence of the column on Literate Programming by Jon Bentley with guest Don Knuth. Communications of the ACM, Volume 29, Issue 5, May 1986 pp 384-369 https://doi.org/10.1145/5689.315644




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: