27 ms·
I never understood the appeal of this book.
by adamnemecek 6y ago
I never understood the appeal of this book.
- spekcular 6y agoI never understood the appeal of this, or SICP, or Scheme in general. I learned much more about computer science reading algorithms and data structures textbooks, especially Knuth. There's a reason MIT uses Python for its intro courses now, after all.
- ska 6y agoMIX/MMIX are close to how CPUs work physically. scheme is close to how computation works theoretically. The pedagogical approach that appeals to individuals tends to align with how they are most comfortable thinking about it.
- spekcular 6y agoLet me say something that may reveal my ignorance, but which I'm very happy to be corrected on: for the purpose of writing moderately-sized, everyday programs, I've never needed to understand how computation works theoretically (more abstractly than introductory algorithms and data structures). And that's not because I'm not comfortable with abstraction, or because I don't know how it works theoretically, I just haven't. Further, the obstacles I face when coding are mostly tightly coupled to the fact that I'm programming on physical hardware – again, nothing to do with the theory of computation. Even in a high-level language like Python, if you program the Sieve of Eratosthenes in a naive way without understanding what's going on under the hood with deleting an element from a list, you're going to have a bad time [0]. To caricature SICP-style instruction a bit, I'm imagining someone learning that recursion is useful (Scheme peeps seem to love it) without also being taught it generally has poor performance characteristics. Perhaps a better criticism is the mostly useless emphasis on immutable data structures. The example I like to bring up is how Haskell for a long time didn't have a readily-available hash table implementation for completely ideological reasons. No, hash maps are strictly worse, thank you. [0] https://stackoverflow.com/questions/3939660/sieve-of-eratosthenes-finding-primes-python https://stackoverflow.com/questions/3939660/sieve-of-eratost...
- Jtsummers 6y ago> To caricature SICP-style instruction a bit, I'm imagining someone learning that recursion is useful (Scheme peeps seem to love it) without also being taught it generally has poor performance characteristics. SICP teaches that recursion can have bad performance and how to use it without blowing the stack or wasting time with unnecessary computations. Scheme, the language, requires tail call elimination so compilers will transform tail recursion into something as fast as a conventional loop.
- spekcular 6y agoYes, I agree, that is a caricature. More seriously, I think leaning on this language-specific feature in a book that's supposedly teaching "general programming 101," or whatever, is in bad taste. As it says: > One reason that the distinction between process and procedure may be confusing is that most implementations of common languages (including Ada, Pascal, and C) are designed in such a way that the interpretation of any recursive procedure consumes an amount of memory that grows with the number of procedure calls, even when the process described is, in principle, iterative. As a consequence, these languages can describe iterative processes only by resorting to special-purpose ``looping constructs'' such as do, repeat, until, for, and while. The implementation of Scheme we shall consider in chapter 5 does not share this defect. It will execute an iterative process in constant space, even if the iterative process is described by a recursive procedure. An implementation with this property is called tail-recursive. With a tail-recursive implementation, iteration can be expressed using the ordinary procedure call mechanism, so that special iteration constructs are useful only as syntactic sugar. This is an example of a point where an algorithms book is helpful + clarifying and SICP is really not. (fake quote: "Be conceptually sloppy and let Scheme take care of it, kid.") It has a few pages on orders of growth, but the coverage is not amazing.
- chongli 6y agoI wouldn’t really call tail-call elimination a feature, language-specific or otherwise. Instead, I would describe the lack of it as a bug. If you examine what’s actually going on in compilers that lack tail call elimination, what you witness is the saving of registers to the stack whose values are provably never going to be used.
- bogomipz 6y ago>"MIX/MMIX are close to how CPUs work physically." What is MIX/MMIX? Is this something specific to the SICP book?
- Jtsummers 6y agoFrom Knuth’s The Art of Computer Programming. MIX is the earlier version, MMIX is the more recent (though now 20 or so years old) version. They are descriptions of a computer architecture and machine instructions used to explore algorithms in his books. https://en.m.wikipedia.org/wiki/MMIX https://en.m.wikipedia.org/wiki/MMIX
- astrange 6y agoKnuth's TAOCP was originally written in an imaginary 60s-style CISC assembly called MIX (with some oddities like being decimal) but newer editions are in a RISC style one called MMIX (which Knuth claims is more practical but really isn't.)
- disgruntledphd2 6y agoWell, all I can say about that is that I read through the MMIX supplement and did a bunch of the exercises, and I know have enough knowledge to vaguely understand assembly. It hasn't been massively useful to me in my professional life (I'm a data scientist), but it definitely has helped me to gain a deeper appreciation of how computing works.
- astrange 6y agoBy practical I meant it's hard to implement in hardware. As far as I know it's easy to learn, having register windows is just kind of weird.
- disgruntledphd2 6y agoAh OK. I guess that makes sense (especially as Knuth implemented its interpreter in C, as documented in MMIXware).
- vram22 6y agoBoth understandings are needed for best results.
- deleted 6y ago[deleted]
- flatline 6y agoSICP introduced a lot of fundamental concepts in CS to me as a junior, self-taught developer. Building everything up using immutable functions and then introducing mutable state was revelatory and still influences my design decisions 15+ years on. Scheme was somewhat beside the point.
- qbasic_forever 6y agoSICP for me was the missing link between learning syntax and code to designing actual programs that solve real problems. It made me step back and look at a problem not as something that just needs a layer of code thrown at it, but as a task to complete, with requirements, constraints, etc. to consider before a single line of code is even written.
- wjossey 6y agoWhile I have friends (and many colleagues) who graduated from MIT CS and are very competent engineers, I don't think MIT is the shining beacon of the best SE/CS graduates. Their program is certainly very good, but if someone asked me (for CS/SE specifically) about going to MIT or NU, I'd point them to NU. For almost everything else, it would, of course, be MIT.
- aiisjustanif 6y agoWhat university is NU?
- wjossey 6y agoNortheastern University, which is where the roots of HTDP can be found.
- aiisjustanif 6y agoAh, thank you. I was thinking of Northwestern. To the point of comment you replied too. I do believe there is value in what can be more understood between learning via HTDP vs an easy to understand language, Data Structures, and Algorithms. From stand point of teaching CS to beginners maybe MIT is going for breath and Northeastern is going more for depth. Then again what do I know, I didn’t go to university remotely in that realm of prestige.
- webmobdev 6y agoWhat about Carnegie Mellon or Berkley?
- TeMPOraL 6y ago> There's a reason MIT uses Python for its intro courses now, after all. Yes, and IIRC, that reasons were, roughly: a) Python is more popular, b) Python has better robotics libraries, which is what kids coming to MIT care about these days. Notably, I don't recall the reasons they given having anything to do with giving students a good fundamental understanding.
- spekcular 6y agoBut this is exactly my point. I think it's essentially a myth that Scheme/SICP are somehow more well-suited to providing a "good fundamental understanding." And Python is, as you point out, more practical and accessible.
- ralphc 6y agoHere is Gerald Sussman, creator of SICP and the course, explaining exactly what happened with the switch - https://www.youtube.com/watch?v=cblhgNUoX9M&t=3578s https://www.youtube.com/watch?v=cblhgNUoX9M&t=3578s
- naringas 6y agoI see two sides: the numericals and the algebraists. I've talked with people who also see these two sides but call them differently. As I see it, this book is closer to the algebraists side. Thus, you probably lean closer to the nuemerical side. I also like to think about it as the Turing perspective (numerical, algorithmic) and the Chruch outlook, which is more algebraic-symbolic. At the end of the day, it's both "contrasting" viewpoints coming together that truly animates the science of computing.
- mmcdermott 6y agoThe part about the two mindsets sounds vaguely familiar. Is there an article or blog post that lays this out in more detail?
- SourPatch 6y agoThis might be what you're thinking of: https://en.wikipedia.org/wiki/Worse_is_better https://en.wikipedia.org/wiki/Worse_is_better
- linguae 6y agoA good paper describing functional programming and also talks about the differences between these two mindsets is "Conception, Evolution, and Application of Functional Programming Languages" by Paul Hudak (1989). You can find a copy at https://courses.cs.washington.edu/courses/cse583/00wi/p359-hudak.pdf https://courses.cs.washington.edu/courses/cse583/00wi/p359-h....
- tjr 6y agoSome people prefer not to commingle the functional, lambda-calculus part of a language with the parts that do side effects. It seems they believe in the separation of Church and state. --Guy Steele
- jimhefferon 6y agoThank you. One of the funniest things I've ever read.
- billfruit 6y ago'Concepts, Techniques and Models of Computer Programming' by Peter Van Roy and Hadidi may be a better book than this and even SCP, since it presents a well organized "science" of computer programming..
- notapenny 6y agoI've read both SICP and CTMCP and would recommend the latter as a first read. Sure the language it teaches in is not practical, but I actually found that to take away the distractions of reading a book in whatever your target language is. Also its the first book that got me thinking about how programming languages actually work and what actually happens under the hood when you're writing code. Great book.
- billfruit 6y agoI also like that it is a very comprehensive book, it covers almost all fundamental approaches to programming, and clearly sets out their scopes and limitations.