3 ms·
In The Art Of Computer Programming, one of the most influential and comprehensive series of books on the subject, Knuth uses a fictional assembly language calle
by gregjor 5mo ago
In The Art Of Computer Programming, one of the most influential and comprehensive series of books on the subject, Knuth uses a fictional assembly language called MIX in the examples. The reader does "just run the program in their head."
In Software Tools Brian Kernighan and P.J. Plauger describe a pseudo-language called RATFOR (Rational Fortran), and then throughout the book implement RATFOR in itself.
Getting feedback while learning to program has a lot of value, but so does learning to think through code in your head. People old enough to remember when you had to wait a day to run your program and get results back (very slow turnaround) know the value of that skill, we used to call it "desk checking" -- reading through your code and running it in your head and on paper.
- ergocoder 5mo agoSure it is useful to run code in your head. I didn't say we must not think through code. But to unable to run actual code at all? Come on. Who learns programming that way?
- gregjor 5mo agoI don't think anyone suggested that.
- jmalicki 5mo agoI suggested that. You should be able to look at algorithmic code and prove it correct without worrying about running it.
- rramadass 5mo ago> But to unable to run actual code at all? Come on. Who learns programming that way? Edsger Dijkstra was a proponent of that approach i.e. develop program and proof by hand in a language for which there is no compiler/interpreter. I wrote about it here - https://news.ycombinator.com/item?id=47985605 https://news.ycombinator.com/item?id=47985605
- disgruntledphd2 5mo agoThe newer versions use MMIX which is much closer to ARM assembly. There's a compiler plugin for gcc, and when I worked through volume 1 I did type the code in and run the exercises. I found it incredibly useful, but obviously YMMV.