It made me so sad when I found out CS61A was being taught in Python. I love Python, but I also know that I would have missed out on so much wonderful information if I hadn't learned Scheme. It was truly mind blowing when they had us implement a Scheme interpreter in Scheme, and then add infix operators. I think the original SICP was perfect for an intro course. It was also the great leveler, because even if you enter…
When did you attend? I heard from a mentor who'd gone way before me that it used to be taught in Lisp but I wonder if they actually meant Scheme.
SICP in Python
101–110 of 136 posts
Re: SICP in Python
#102It made me so sad when I found out CS61A was being taught in Python. I love Python, but I also know that I would have missed out on so much wonderful information if I hadn't learned Scheme. It was truly mind blowing when they had us implement a Scheme interpreter in Scheme, and then add infix operators. I think the original SICP was perfect for an intro course. It was also the great leveler, because even if you enter…
When did you attend? I heard from a mentor who'd gone way before me that it used to be taught in Lisp but I wonder if they actually meant Scheme.
As far as I know it was taught in Scheme since SCIP came out in the 80s.
Re: SICP in Python
#103Earlier quoted context omitted.
I concur, this book is a terrible way to introduce anybody to Python. I imagine they want to teach general programming skills, and hence want to give you a "way to think" that is low level enough to let you work with any language, using Python as a pseudo-code to demonstrate it. This approach is doomed to fail. It's much better to teach the language properly, then introduce other languages as a comparison point, if t…
SICP shouldn't really be taught in any language other than Scheme, or a language designed specifically for teaching SICP. It doesn't make sense otherwise.
Re: SICP in Python
#104Earlier quoted context omitted.
In line with this, list comprehensions are one area of python I find particularly clunky. They work fairly well for a single map or filter operation, alright for both mapping and filtering, and are absolutely unreadable for anything more complicated. A big part of this in my opinion is how they scramble the flow. Instead of taking a piece of data and performing successive operations on it, both in logic and in syntax…
map(lambda x:x^2, filter(lambda x:x%6==0, map(lambda x: x*2, getNumbers()))) Would probably be a more pythonic way to do that, avoiding list comprehensions. Easier to read with added lines and indentation. But tbf I do appreciate the ability to chain operations in JS without subclassing objects like list.
Re: SICP in Python
#105Earlier quoted context omitted.
For what it’s worth, I’m not a Python programmer and I got that correct. The answer is: [1] [1, 1] [1, 1, 2] [3] It relies on knowing something about how python applies default arguments. I’ve only written about a hundred lines of python in my life, so possibly I just got lucky - still, I would have thought an actual Python programmer should get this?
It is different from how Ruby and Javascript handle default arguments. I'm surprised Python does that, since I would expect function arguments to be reset to their defaults each call. That's a major side effect.
Re: SICP in Python
#106I'm so used to syntax highlighting that it feels odd to try to read code without highlighthing A bit off-topic, now that legacy.gitbook.com will be read-only from next month, anyone else just giving up on the platform? I used it mainly to allow readers to easily get pdf/epub versions and as far as I know, that won't be possible with new gitbook site.
Remember: when the course was introduced (ca 1981) few of the freshman had ever used a computer before they arrived at MIT. The first lecture included an second on "how to program in scheme" and after that it was assumed you could do all the assignments. This book has to include a much more complex (and I would imagine to the new programmer, daunting) introduction to dealing with Python.
I feel like the scheme version was a more nuts and bolts class full of practical information while this Python version feels less practical. But that could be a bias on my part.
There are good reasons to switch the instruction to Python (the libraries, mainly) but in exchange something is lost. Engineering is all about dealing with such tradeoffs :-).
Re: SICP in Python
#107Manual of Ice-Fishing rewritten for desert nomads.
in the software world, one can avoid the monster that is c++ rather successfully, but it's gotten to the point that no matter what, python is thrust upon you to deal with. "hey here's this thing that is barely working" (in large part because it's written in python) "and we'd like you to maintain it but not switch from python" (because anything besides python makes us uncomfortable). meanwhile, python makes me uncomfo…
The languages and their power are so different that in the end it wasn't worth trying to use any of the quasi-automated linkage tools and instead the Python interface is built by hand. NumPy and such had to take this tack as well.
Re: SICP in Python
#108Earlier quoted context omitted.
This relates heavily to the "what language should be taught in schools" argument. I usually answer "Java". And it's not even that I particularly like Java, it's just that the discussion often neglects that the course involved is all about classes, getters and setters, inheritance and so on. It's nonsense to shoehorn this into many other languages.
Dijkstra once said: "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration." I find much the same to often be true for many Java programmers. Programmers who start out with a course all about classes, getters and setters, inheritance and so on often end up with their minds wedged such…
Dijkstra was good at many things, but there's no need for an argument from authority when we have actual data and not just opinions made to sound stronger because they are phrased more aggressively.
Re: SICP in Python
#109Unfortunately 'distributed and parallel computing' is no where to be seen in R*RS. I hope we can change that soon.
Re: SICP in Python
#110It made me so sad when I found out CS61A was being taught in Python. I love Python, but I also know that I would have missed out on so much wonderful information if I hadn't learned Scheme. It was truly mind blowing when they had us implement a Scheme interpreter in Scheme, and then add infix operators. I think the original SICP was perfect for an intro course. It was also the great leveler, because even if you enter…
I believe the "self-paced" version is still in Scheme. I did it a couple years ago and it was awesome. The final project was changed to a python interpreter in Scheme which I thought was fantastic.
That is fantastic! ;-)