3 ms·
I've been digging into Clojure and reading Paul Graham's On Lisp. So I've been wondering about Python vs. Lisp lately, esp. on the topic of dynamism. I wish I k
by wonderzombie 14y ago
I've been digging into Clojure and reading Paul Graham's On Lisp. So I've been wondering about Python vs. Lisp lately, esp. on the topic of dynamism. I wish I knew more about Lisp to delve into this further, but your first para caught my eye.
Is it not the case that in Lisp people tend to use values — lists of (probably immutable) data — rather than objects? Objects are in and of themselves their own flavor of custom, specialized language for interacting with a data structure. In Lisp, the language for interacting with lists of lists or what have you is, well, Lisp.
IME duck typing is not a real answer in this situation; that helps when you are programming to an interface in the standard library, or in an API you are using. Otherwise I end up hunting down information about a data type through N layers of method and function calls. Not a good time. :( This actually drove me towards Go as a language with comparable productivity but with a type checker, et al.
I'm not sure where Lisp macros fit into this, if they do. I expect they have a tendency to boil down frequently repeated patterns into something very compact and less error-prone.
As for IDE support, Rob Pike suggested (not in so many words) that if you need an IDE for your programming language, it suggests that something's probably wrong with that language. He's not disputing that people genuinely need them, because yes, jesus h, I really do need Eclipse when you're programming against a reasonably large API. I think I find this line of reasoning more convincing than I would have, say, a year or two ago.
Anyway, for my part, ST2 was enough of a Python IDE for me. And thanks for the tip about Pyflakes, by the way. There's guard[1], which I figured you could rig up with python -c or whatever the flag is to compile. Pyflakes looks easier.
[1]: https://github.com/guard/guard https://github.com/guard/guard
- masklinn 14y ago> Pyflakes looks easier. Look up flake8, it runs both pyflakes and pep8, and can optionally warn about cyclomatic complexity as well.
- cdavid 14y agoI would say that idiomatic python code often does not overuse objects. Lack of immutable data is indeed something I miss (especially COW dict/list/set). One thing that is clearly overused in python code is dictionaries to pass data where the set of keys is fixed and known, or worse passing dict with different set of keys instead of proper 'modelling'. Things like traits (http://code.enthought.com/projects/traits http://code.enthought.com/projects/traits - disclaimer, I work for Enthought ), or even simple libraries like remoteobjects (https://github.com/saymedia/remoteobjects https://github.com/saymedia/remoteobjects) can be helpful in those cases. I myself don't use IDE much: I am too entrenched with vim to gain enough from an IDE, although pycharm is quite nice. I would much rather see libraries around things IDE do ('live' 'AST' of a whole project, good refactoring, debugging) so that one can integrate them in whatever environment people use. I think we are going there (https://groups.google.com/forum/?fromgroups#!forum/python-static-type-checking https://groups.google.com/forum/?fromgroups#!forum/python-st...). Go does look nice, but it misses two killer features for me: NumPy and the whole scipy ecosystem, and C integration (in both directions). I think the python community itself does not realize how big and significant the scipy ecosystem is (nothing comes anywhere near in any common language AFAIK).