On Wed, Mar 5, 2008 at 10:43 PM, James G. Sack (jim) <[EMAIL PROTECTED]> wrote:
> LWN has a blurb about a utility named mortadelo
>  "File monitoring with Mortadelo and SystemTap"
>   http://lwn.net/SubscriberLink/271796/31b6b6ec76feb6c2/
>  written in C# using mono framework.
>
>  A link there points to
>   http://www.gnome.org/~federico/news-2007-06.html#18
>  which includes some nice discussion of why he didn't use python for this
>  project.
>
>  Hey, Chuck -
>   Have you seen these kinds of python shortcomings listed before?

Just a couple times. Federico's list here is better than what I've
seen before. It covers a lot of points and seems very practical.

I'll just comment on the Python cons:

"Really hard to call C functions. This is a killer."

I didn't often need to call C functions from Python given all the
libraries that people had already wrapped. While it's not as
convenient as C#, between Swig and ctypes, it's not *that* bad.
Certainly not a killer imo.

"No lexical scoping."

I love Python's free wheeling method implementations. I went through a
period of switching between C# and Python and found that:

* In C#, I really liked the more formal declarations at the top level
(classes, methods, etc.) Code was easier to refactor and there was
better error checking. I didn't have to run my unit tests just to find
out that I misspelled a method name.

* In Python, I really liked the clean easy method implementations. I
don't need to be pestered inside a method with nested scopes and
punctuation all over the place. I'm too busy writing my code!

"Useless lambdas."

Not sure why he thinks they are useless... The bummer is that you
can't have closures (sometimes called "anonymous methods") with
multiple statements like you can in C# and Ruby.

"Slow."

He should have listed this one twice!

"Hard (impossible?) to make cons-free structures. For this particular
program, this is a killer. "

True. Most times you don't care. When you do, I think your main option
is to write an extension in C or, if it's capable in this area, Pyrex.
That's pretty lame compared to just being able to stay in the same
language.


I would add that Python doesn't give you the *option* of static
typing. Or contracts. Or built-in unit tests (like doc strings are
built into the language). There's still no clean syntax for declaring
properties.

Of course, I would also list anything at
http://cobra-language.com/docs/python/ some of which overlaps with his
list.


-Chuck
-- 
http://cobra-language.com/

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to