5 ms·
Python is so ideological it is not even funny. It has a crippled lambda because Guido couldn't find a syntax he liked for it. It doesn't have tail call eliminat
by PuercoPop 11y ago
Python is so ideological it is not even funny. It has a crippled lambda because Guido couldn't find a syntax he liked for it. It doesn't have tail call elimination because Guido is under the, mistaken, impression that they inhibit backtraces. The zen of python spouts explicit is better than implicit as a marketing slogan to cover up a design wart with Python's lolscope. It only had local and global scope. Python Scope is still broken[0] btw. But don't worry, it is not a bug because it is documented. (╯°□°)╯︵ ┻━┻. The only reason Python passes as a language with good design is because people compare it to PHP or Javascript.
How is the numerical tower impractical? Having to check for overflow/underflow after every addition is what is impractical in my book.
> I am big fan of ... Common Lisp ... There is so much beauty and elegance.
Idk where to people get the idea that Common lisp is 'beatiful and elegant' (in opposition to practical I may add). It is eminently practical. Have you seen loop and format (which btw Python has adopted with some glaring _practical_ omissions like list iteration ~{~}.)? The whole anything but nil is true to allow functions like digit-char-p to return a number instead of t is another practical design choice. Do you think there is anything elegant in modifying the readtable? I could go on and on. CL is a practical language that, apparently due to ESR's nirvana bullshit quote, people who haven't used it have a misconception about its design.
But back to the point, Scheme's design (ideology if you want) is to play to pick features that synergize as to allow discard others as they can be expressed with the previous features/concepts. You don't need iteration, as it is a special case of recursion. You need iterators, you have map, which is just a function the user can define, etc. And this is relevant to teaching computation as it allows the teacher to waste as little time teaching a language and allows him to focus on CONCEPTS. The amount of scheme knowledge needed to finish the SICP can be taught in 15 minutes (It doesn't use macros). All the difficulty lies in the concepts it deals with. Getting the language out of the way allows to cover a lot of ground, for example in the SICP one implements a Virtual Machines and a compilers targeting it.
Now if you want to argue that nowadays the student needs to learn how to pipe software together and has less need for concepts that is another thing altogether[2], but saying that Python is practical (as opposed to ideological) and Scheme's 'ideological' choices hampers the students learning is bullshit.
[0]: https://bugs.python.org/issue24321#msg244357 https://bugs.python.org/issue24321#msg244357
[1]: https://twitter.com/whitequark/status/604088954816716800 https://twitter.com/whitequark/status/604088954816716800
[2]: Of which I'd quote Dijkstra: "It is the university responsibility to give society not what it wants but what it needs."
- dalke 11y ago"Python Scope is still broken[0] btw" Yes, it's working as designed, and I see how it can be considered broken, but it's not due to a scope issue. The "except X as x" is specified (with Python 3.x and PEP 3110 at https://www.python.org/dev/peps/pep-3110/ https://www.python.org/dev/peps/pep-3110/ ) as doing a "del x" at the end of the except clause, and that was done for garbage collection reasons.
- asgard1024 11y ago> The only reason Python passes as a language with good design ..because ability to compromise is a good design, in a sense. I kinda agree about the scope though, but I don't think it's a big deal. Sometimes having a hierarchy is overrated, and two levels of names is good enough. But you will find design mistakes in all languages. Every designer errs. Python doesn't actually have that much warts because the designer is quite conservative. > Idk where to people get the idea that Common lisp is 'beatiful and elegant' Maybe from the paper that introduced Lisp, of which CL is descendant? I am aware about CL's warts, but these are result of Lisp's success rather than its original design goals. > Scheme's design (ideology if you want) is to play to pick features that synergize as to allow discard others as they can be expressed with the previous features/concepts I understand. But the reason for that is that people consider it beautiful when you start from small subset of features. It doesn't however reduce the need to know the more practical concepts. Like in mathematics. The fact that we can build everything from set theory doesn't mean we don't need to know about integrals. Some universities skip the basics (set theory) and teach only the practical concepts (integrals). Perfectly fine in my book. > Now if you want to argue that nowadays the student needs to learn how to pipe software together I have said it on HN before, it depends on your goals. If you're teaching future programmers/computer scientists, sure, starting from Scheme or even Lambda calculus is better. Because you can assume people will do the real work in other languages. But if you teach a general non-programmer audience to program (like scientists), why not teach them just one language, which they can use in practice?