Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Ted Leung on the air: Open Source, Java, Python, and ...
Thu, 17 Jul 2003
Is Python crufty?
Russell is digging in to Python, and has found some things he doesn't like:
[00:32] |
[computers/programming/python] |
# |
TB |
F |
G |
3 Comments |
But the problem is that Python is definitely crufty. There are so many spots where you can see how the language has been expanded - by force if necessary - throughout the years. Things like the way running an app works: you write a function that tests to see if matches "__main__", instead of an actual main() function. The fact that *every* method in a class needs to refer to "self" first (i.e.: method(self, otherParam) ) is ugly. And self isn't actually a reserved word, just a "strong convention". Ugh. As I learn more, I find more. In my opinion, Python could definitely use a new version rev, drop backwards compatability and clean up the cruft.I agree that the __main__ thing is crufty. I don't agree about the explicit self argument to methods. If you are coming from a single dispatch O-O language, like Java or Smalltalk, then you will feel this to be crufty. If you are coming from a multi dispatch language like Lisp's CLOS, Dylan, or Cecil, you will find this to be entirely natural. The pill is still red.
This argument can be repeated. If you are coming from an O-O language, the _main_ thing is crufty. If you are coming from a scripting language, the _main_ thing is natural.
I like learning new languages. I find that languages shape my assumptions. New languages challenge these assumptions.
In this case, the question is "what does import mean"?
Posted by Sam Ruby at Thu Jul 17 01:37:55 2003
I like learning new languages. I find that languages shape my assumptions. New languages challenge these assumptions.
In this case, the question is "what does import mean"?
Posted by Sam Ruby at Thu Jul 17 01:37:55 2003
Even Python advocates don't think it's totally perfect - see Python Warts and Python Warts Updated.
Posted by Simon Brunning at Thu Jul 17 07:19:09 2003
Posted by Simon Brunning at Thu Jul 17 07:19:09 2003
While I'll admit that Python has its share of cruft, I'll also have to weight in on the _main_ thing. Testing for _main_ is only necessary if you want to create a module that can either be used as an application itself, or be imported into another application. If all you want to do is write an application, just start coding. (This is a "scripting" language after all)
Posted by Wilhelm at Thu Jul 17 09:49:37 2003
Posted by Wilhelm at Thu Jul 17 09:49:37 2003
You can subscribe to an RSS feed of the comments for this blog:
Add a comment here:
You can use some HTML tags in the comment text:
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
<a href>
, <em>
, <i>
, <b>
, <blockquote>
, <br/>
, <p>
, <code>
, <pre>
, <cite>
, <sub>
and <sup>
.You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk