Next it will be SICP for Java. Is nothing sacred?
SICP in Python
41–50 of 136 posts
Re: SICP in Python
#42Earlier quoted context omitted.
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…
I have my misgivings about Python and C++ too, but when writing them for my job I think how much worse things could be. I could have a job that didn't involve coding, or no job, or even something involving Java.
Re: SICP in Python
#43Manual 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…
If Scheme (or whatever language you use) was as popular as python you would think it is bad too since most code out there would be made by amateurs, and its flaws (which all languages have) would be unavoidable.
Re: SICP in Python
#44Earlier quoted context omitted.
SICP is about deeply understanding computation. Scheme is a good language for SICP because it's simple. You can build a Scheme interpreter as a class project. You can analyze it formally. Etc. Python is a good language because it's readable and writeable. But it doesn't work for SICP since it's too complex for that. Python also intentionally omits things critical to SICP (like tail recursion). Calling this book "SICP…
> Python is a good language because it's readable and writeable. https://github.com/satwikkansal/wtfpython
Re: SICP in Python
#45Earlier quoted context omitted.
Thank you for explaining why you think Scheme is a better langauge for SICP than Python. As a fan of Python, my reaction to seeing this course was: "oh cool, a course on interesting things in a language I'm comfortable with". I was then somewhat discombobulated to see the Python bashing in the comments.
SICP is about deeply understanding computation. Scheme is a good language for SICP because it's simple. You can build a Scheme interpreter as a class project. You can analyze it formally. Etc. Python is a good language because it's readable and writeable. But it doesn't work for SICP since it's too complex for that. Python also intentionally omits things critical to SICP (like tail recursion). Calling this book "SICP…
After taking a course which used SICP, I was so inspired I wrote a functioning Scheme interpreter in a couple of evenings - in C, with no external libraries. It was pretty limited (no tail recursion), but could run examples from the book.
That is not going to work with python - even just parsing the program will need a whole bunch of extra knowledge.
Re: SICP in Python
#46It 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…
Thank you for explaining why you think Scheme is a better langauge for SICP than Python. As a fan of Python, my reaction to seeing this course was: "oh cool, a course on interesting things in a language I'm comfortable with". I was then somewhat discombobulated to see the Python bashing in the comments.
verb [ T ]
UK
/ˌdɪs.kəmˈbɒb.jə.leɪt/ US
/ˌdɪs.kəmˈbɑː.bjə.leɪt/
informal mainly humorous
to confuse someone or make someone feel uncomfortable
Re: SICP in Python
#47Earlier quoted context omitted.
SICP is about deeply understanding computation. Scheme is a good language for SICP because it's simple. You can build a Scheme interpreter as a class project. You can analyze it formally. Etc. Python is a good language because it's readable and writeable. But it doesn't work for SICP since it's too complex for that. Python also intentionally omits things critical to SICP (like tail recursion). Calling this book "SICP…
> Python is a good language because it's readable and writeable. https://github.com/satwikkansal/wtfpython
(It is still not the good fit for SICP, but that’s a different conversation)
Re: SICP in Python
#48Earlier quoted context omitted.
One thing I have felt is that python doesn't embrace the functional way of thinking, even to the extent that JavaScript does. I personally find that once I have been exposed to a modern functional approach like in Clojure, etc, I find python lacking. Not just syntactically, but conceptually. For example, IIRC, many list methods in python modify the list they are working on, instead of returning a new list.
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…
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
#49Earlier quoted context omitted.
One thing I have felt is that python doesn't embrace the functional way of thinking, even to the extent that JavaScript does. I personally find that once I have been exposed to a modern functional approach like in Clojure, etc, I find python lacking. Not just syntactically, but conceptually. For example, IIRC, many list methods in python modify the list they are working on, instead of returning a new list.
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…
flattened_list = [for x in list_of_lists: for y in x: y]
This is essentially the same re-arrangement that was made in C#‘s LINQ: it uses from-where-select instead of SQL’s select-from-where.Re: SICP in Python
#50https://opendocs.github.io/sicp/sicp.pdf
which is based on the MITPress HTML version, released under a permissive CC-by-SA license.
https://mitpress.mit.edu/sites/default/files/sicp/index.html
(nb. The pdf starts out with a curious little 'texinfo foreword'. Being able to type `info sicp` in one's shell? I wonder ...)