LWN.net Logo

Evidence that Python is advancing into the enterprise (NewsForge)

NewsForge presents a report from PyCON 2005. "Mission-critical development organizations often regard only a handful of languages -- C#, Java, XML, SQL, and few others -- as safe enough for serious projects. From this perspective, Python has been traditionally lumped with "experimental" or "toy" languages. Over and over, however, speakers at this conference presented evidence to the contrary."
(Log in to post comments)

Everything to like

Posted Mar 29, 2005 21:23 UTC (Tue) by b7j0c (subscriber, #27559) [Link]

Python has a clear design, great features, good performance, and is totally unencumbered by corporate control (java) or ambiguous legal status (mono).

The indentation thing is a little irksome, but i think guido's heart was in the right place when he set it in place.

Python's not perfect though, a CPAN-like site and CPAN.pm-like automatic download utility would be a huge asset. As much as I like Python I find myself sticking with Perl for many problems simply due to the incredible array of solutions easily obtainable from CPAN.

Irksome for 5 minutes...

Posted Mar 29, 2005 21:33 UTC (Tue) by alextingle (subscriber, #20593) [Link]

...until you get used to it. Now I'm equally irked by the vertical space wasted by '{' and '}' in other languages.

Irksome for 5 minutes...

Posted Mar 29, 2005 22:10 UTC (Tue) by dskoll (subscriber, #1630) [Link]

if ($braces_used_like_this) {
    print "No wasted vertical space!\n";
} else
      {
           print("I see your point.\n");
      }

Irksome for 5 minutes...

Posted Mar 29, 2005 22:26 UTC (Tue) by piman (subscriber, #8957) [Link]

if ($you_try_this) {
 print "You waste less space, sure"
} else {
 print "But there's always that last line..."
}

Irksome for 5 minutes...

Posted Mar 29, 2005 23:38 UTC (Tue) by dskoll (subscriber, #1630) [Link]

if ($you_do_this) {
    print("There is the ending brace, true.\n");
    print("But most people leave blank lines at logical places,\n");
    print("even in Python.\n);
    print("And you could always do this, though I don't like it.\n");   }

Irksome for 5 minutes...

Posted Mar 30, 2005 2:35 UTC (Wed) by flewellyn (subscriber, #5047) [Link]

(with-possible-alternative (proposal)
  (if (equal (type-of expressions) symbolic)
     (and (not (space-wasted anywhere)
     (arranged-logically (readable code)))))

Irksome for 5 minutes...

Posted Mar 30, 2005 3:49 UTC (Wed) by dskoll (subscriber, #1630) [Link]

(find-it (hard i to)
 organize-around (brain my) lispish reordering
 (even-though (programmed i) (lisp in) (years (3) for)))

Irksome for 5 minutes...

Posted Mar 30, 2005 4:52 UTC (Wed) by donio (subscriber, #94) [Link]

I find it hard to believe that prefix notation is confusing to you after programming in Lisp for 3 years unless you have had a complete brain transplant since. Unlike you, I don't have 3 years of Lisp programming experience under my belt, I am only a causual user of Emacs Lisp and Common Lisp but prefix notation and syntax in general has never been a problem for me.

Irksome for 5 minutes...

Posted Mar 30, 2005 2:38 UTC (Wed) by tjc (guest, #137) [Link]

if ($you_are_like_me)
{
        print("You might not have even realized...");
        print("...that there's a world-wide shortage of braces and newlines.\n");
}

Irksome for 5 minutes...

Posted Mar 30, 2005 23:36 UTC (Wed) by Russell (guest, #1453) [Link]

.file "junk.c"
.section .rodata
.LC0:
.string "Braces are for whimps\n"
.text
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
andl $-16, %esp
movl $0, %eax
subl %eax, %esp
subl $12, %esp
pushl $.LC0
call printf
addl $16, %esp
movl $0, %eax
leave
ret
.size main, .-main
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)"

Everything to like

Posted Mar 29, 2005 21:48 UTC (Tue) by sjj (guest, #2020) [Link]

I (heart) CPAN too. CPyAN would r00l... of course, the standard distribution *does* come with batteries included. Add Twisted and Numeric, what else do you need?

Everything to like

Posted Mar 29, 2005 21:55 UTC (Tue) by newren (subscriber, #5160) [Link]

Numarray and matplotlib. :)

Everything to like

Posted Mar 29, 2005 22:18 UTC (Tue) by b7j0c (subscriber, #27559) [Link]

>> of course, the standard distribution *does* come with batteries included.

but at some point this doesn't scale for many reasons...there are a number of very useful well designed libs i don't want or ever need. should i need them in my base install? maybe, if they are very abstract core utils for basic operations, but very often they are domain-specific.

CPAN lets me keep my perl installation small(ish), and it also gives me *one* place to shop for code i need.

Everything to like

Posted Mar 29, 2005 22:51 UTC (Tue) by mwh (subscriber, #582) [Link]

There is movement in this area...

Everything to like

Posted Mar 30, 2005 6:05 UTC (Wed) by skvidal (subscriber, #3094) [Link]

God I hope not. CPAN is a wasteland of crap modules. Unmaintained or so poorly written as to be dangerous for use. You end up with developers deciding to use the latest Nth version of some misc module that the maintainer has decided to drop. I'd rather have 10% the modules but well maintained, consistent and API stable. Using CPAN is a recipe for disaster when you're trying to maintain a sensible system. And let's not even talk about trying to remain consistent with a packaging system when using cpan modules.

-sv

Everything to like

Posted Mar 30, 2005 7:31 UTC (Wed) by nix (subscriber, #2304) [Link]

So because modules can become unmaintained we should have no central repository for modules that not everyone needs?

I smell a massive non sequitur.

Everything to like

Posted Mar 30, 2005 13:55 UTC (Wed) by skvidal (subscriber, #3094) [Link]

> So because modules can become unmaintained we should have no central
> repository for modules that not everyone needs?

>I smell a massive non sequitur.

No, I just do not think CPAN is an answer to any set of problems. It's a disorganized mass of poorly maintained software. And all that it encourages is the use of obscure, unmaintained modules to solve problems with questionably exist.

I smell someone who has never maintained a system populated with these godforsaken items.

-sv

Everything to like

Posted Mar 30, 2005 17:08 UTC (Wed) by b7j0c (subscriber, #27559) [Link]

no, you're way off.

first name the broken modules.

second tell me how this invalidates a well built tool (CPAN.pm) for installing packages from the network.

third, tell me how a broken package invalidates the vast majority of excellent modules.

fourth tell me how NOT having a central repository assures me that python modules will be of higher quality. by the way telling me that you never need or use stuff outside of the core distribution is not one of the choices, sooner or later everyone needs 3rd party code.

i have seen this logic before from some python people - the fact that there is a broken module on CPAN invalidates the entire effort, and somehow not having a parallel effort insures a higher quality and availability of code for python.

look, i like python but the lack of a central repository and tools to address this repository is something that needs to be addressed.

Everything to like

Posted Mar 30, 2005 14:05 UTC (Wed) by edomaur (subscriber, #14520) [Link]

Yes, I think too. There is already the Eggs project (http://peak.telecommunity.com/DevCenter/PythonEggs) which some parts are already agreed upon by Guido and others. I think this goes in the right direction.

Now, about the indentation, I have encounter many times the Lost Tab Character problem. I hate positively when people use tabs in there source code, it always ensure that at one time, the layout of the code goes full crap & trash. Since it is pratically impossible to convince hard boiled programmers to use spaces chars only, in Python it could be the death of the project. I do not know if there is an util to solidify the indentation, or if there is anything to do except firing the programmers..

Everything to like

Posted Mar 30, 2005 7:30 UTC (Wed) by Zarathustra (guest, #26443) [Link]

The lack of a "python-CPAN" it's the least of the problems with Python, and I would argue it's what doomed Perl into an impossibly tangled mess of dependencies.

But Python is not perfect. I use it every day, and I'm annoyed by it's complete lack of any decent concurrency model; stackless does it right, but has been marginated due to Guido's prejudices against recursive programming, a shame because Python together with a CSP model would rock.

Then there are things like (multiple) inheritance, which sadly I think there is no hope we will ever free ourselves of... oh well, I can try to pretend it doesn't exists, if only everyone else didn't feel so compelled to abuse it at every chance.

Everything to like

Posted Mar 30, 2005 11:03 UTC (Wed) by pkolloch (subscriber, #21709) [Link]

Then there are things like (multiple) inheritance, which sadly I think there is no hope we will ever free ourselves of... oh well, I can try to pretend it doesn't exists, if only everyone else didn't feel so compelled to abuse it at every chance.

Any concrete reasons why you do not like multiple inheritance? I can see that you can abuse them -- it's probably impossible to make a programming language totally abuse prohibitive. I just often wish for multiple inheritance if I program in Java. Look at classes like PropertyChangeSupport which provide some helper classes for event management. If you want to integrate this into an existing class, you either have to program that stuff or use really tedious delegation. Maybe not the best example, but I wanted to use something from the standard library...

Everything to like

Posted Mar 30, 2005 12:44 UTC (Wed) by Zarathustra (guest, #26443) [Link]

There is a big difference between features that can be abused but that can be used properly with some care, and that don't get in the way(eg., C pointers, goto), which is perfectly fine and in many cases a sign of good language design; and features that encourage abuse or that are almost impossible(if at all) to use in sane ways, and that add gratuitous complexity to core parts of the language(eg., multiple inheritance, auto-boxing, "checked exceptions", cpp).

I have yet to see anyone using multiple inheritance in any justifiable way and without ending up with a big mess. And what is worse, MI brings with it an insane amount of complexity into any language that implements it, just look at Python's MRO, it's nauseating the kinds of hacks people puts into their languages to have MI.

Also is not enough not to use MI yourself, as APIs and libraries implemented by naive programmers often force you to use inheritance, mixins are one of the worst ideas I have ever seen, they might seem like a cool hack at first, but end up interacting in unpredictable ways and sending you flying into a world of pain and close coupling among bits that have nothing to do with each other.

And this is not to mean that Single Inheritance is any good either, but at least makes sure that the hierarchies remain within a minimum of sanity, and doesn't force the language to include so many hideous hacks just so it can handle the retarded mess of inheritance models that are possible with MI.

In the end, in a language with a decent type system, inheritance buys you nothing except pain, even the most radical OO zealots, if they have a clue, will tell you to use composition over inheritance if possible, and let me tell you, unless some retarded API forces you or you use a really braindamaged language(eg., Java) you can always do things perfectly fine and with much less trouble without inheritance.

I will finish with the wise words of Rob Pike:

"Object-oriented design is the roman numerals of computing"

inheritance != object oriented

Posted Mar 30, 2005 12:57 UTC (Wed) by zooko (subscriber, #2589) [Link]

I agree with you that inheritance is used way too much. I would be just as happy in a language without inheritance, and when I code in a language with inheritance, I try to avoid it as much as possible. (Such as, to be topical, Python, where the dynamic and structural object oriented make it easy for me to accomplish what I want without using Python's builtin inheritance.)

But inheritance != object oriented. Modern object oriented languages like E don't have inheritance.

inheritance != object oriented

Posted Mar 30, 2005 17:48 UTC (Wed) by Zarathustra (guest, #26443) [Link]

It depends what definition of "Object Oriented" you use. I(and I think rob) was trying to use the most "popular" definition, which probably is not the most accurate.

It has been argued that Limbo is object oriented done right. It has even been argued that Plan 9 is object oriented OS, where files are objects that have a well defined interface.

But in general by OO people understands Java, C++, and if you are lucky, Smalltalk.

By the way, E is quite interesting, I would like to use it for some project, I wonder how it compares with 9p/Limbo and Erlang.

Everything to like

Posted Mar 30, 2005 15:06 UTC (Wed) by cajal (guest, #4167) [Link]

I agree with you that concurrency is one area where Python needs a lot of work. CPython also needs a good modern garbage collector and the ability to return unused memory back to the OS. I love Python and recommend it regularly, but why anyone would try to write an "enterprise" app in a language with monotonically increasing memory usage escapes me.

Everything to like

Posted Mar 30, 2005 17:12 UTC (Wed) by b7j0c (subscriber, #27559) [Link]

>>The lack of a "python-CPAN" it's the least of the problems with Python,
>> and I would argue it's what doomed Perl into an impossibly tangled mess
>> of dependencies.

such as? CPAN has dependency support.

Everything to like

Posted Mar 30, 2005 17:54 UTC (Wed) by Zarathustra (guest, #26443) [Link]

Which is exactly the problem, people loves to abuse it.

Everything to like

Posted Mar 31, 2005 5:14 UTC (Thu) by b7j0c (subscriber, #27559) [Link]

>> Which is exactly the problem, people loves to abuse it.

examples? or is this just more unsubstantiated conjecture?

Evidence that Python is advancing into the enterprise (NewsForge)

Posted Mar 30, 2005 0:09 UTC (Wed) by darthmdh (guest, #8032) [Link]

Python predates C# by a decade. How people get off claiming it is a "toy" while C# is "safe/serious" is beyond me. Looks like FUD. Smells like FUD.

Evidence that Python is advancing into the enterprise (NewsForge)

Posted Mar 30, 2005 8:47 UTC (Wed) by Zarathustra (guest, #26443) [Link]

If it looks like FUD, smells like FUD, tastes like FUD; then it is FUD.

In Python we have duck typing ;-)

Evidence that Python is advancing into the enterprise (NewsForge)

Posted Mar 30, 2005 1:36 UTC (Wed) by phgrenet (guest, #5979) [Link]

It is good that organizations look for programming languages one step higher than Java and C# in the programming language hierarchy. But why not look at the highest level? Lisp and Prolog are incomparable in terms of level of abstraction and productivity. They are also getting quite old, but the fundamendal ideas behind them are still valid. The object layer on top of Lisp, CLOS, is one of the most advanced OO language I have ever seen (beats even Eiffel).

OO is yesterday's news.

Posted Mar 30, 2005 6:12 UTC (Wed) by ncm (subscriber, #165) [Link]

"Object-oriented" is far less interesting than the hypesters of the '90s would have liked for you to believe, and than the Smalltalk/Java/CLOS crowd evidently did. C++ graduated from OO well before the hype peaked, and forged ahead in a different direction. Presumably the other languages will get around to chasing it again; Java "generics" are a faint-hearted effort that way, more like Ada than anything powerful.

Of course the MLs started out way ahead, but all the ML variants I know of are saddled with all manner of built-in gook like GC and lists, and can't support doing those same things from scratch in a library instead. Give me an ML with destructors and restricted pointers, and I will move the world!

OO is yesterday's news.

Posted Mar 30, 2005 9:51 UTC (Wed) by khim (subscriber, #9252) [Link]

Give me an ML with destructors and restricted pointers, and I will move the world!

Hmm. Is it good idea to ask for impossible before you'll do something ? Any language with destructors is inherently unsafe - and this is not a case of "noone did it yet" but a case of "it's mathematically proven to be impossible". Sorry, but you are out of luck.

It's possible to introduce some forms of "limited destructors" which will be called in some cases but in other cases stuff will be discarded silently, but in the end it only makes programming more cumbersome and error-prone. Python, Java and C# all have GC and no destructors - and this is good thing(tm): this means they have at least a chance.

C#/Java have destructors...

Posted Mar 30, 2005 10:57 UTC (Wed) by pkolloch (subscriber, #21709) [Link]

...but there are only guarantees to when they are not called. (Well, I have to admit that I have not dug deeply into this explicit GC control, but that's probably out of scope. In some circumstances even (managed) C# might even make some guarantees.)

In C#:

~TypeName() { ... }
In Java:
protected void finalize() throws Throwable() {...}

While I agree that you should not use that in pure managed code, it might make a lot of sense in wrappers to native code which allocates resources (which you want to deallocate automatically). In C# 2.0 you can even specify some kind of implicit cost for classes to provide meaningful heuristics for this case.

C#/Java have destructors...

Posted Mar 30, 2005 11:48 UTC (Wed) by phgrenet (guest, #5979) [Link]

I think one problem with Java and C# is that they only allow allocation of objects on the heap. If you can allocate your object on the stack then there is no need to control what the GC is doing because you know exactly when the object will be deallocated. C++ and Lisp give you that choice.

C#/Java have destructors...

Posted Mar 30, 2005 13:44 UTC (Wed) by TImaniac (guest, #28862) [Link]

In C# you can allocate a struct on the stack instead of the heap : this struct are value-types but inherit from Object.
if you need temporary stack memory, there is also a stackalloc keyword.

C#/Java have destructors...

Posted Mar 30, 2005 14:58 UTC (Wed) by cajal (guest, #4167) [Link]

Some JVMs can allocate objects on the stack. There is much research into this area (google for "escape analysis"). But there's no word as to when Sun's JDK will support it.

destructors considered harmful?

Posted Mar 31, 2005 1:21 UTC (Thu) by xoddam (subscriber, #2322) [Link]

> Hmm. Is it good idea to ask for impossible before you'll do something ?
> Any language with destructors is inherently unsafe - and this is not a
> case of "noone did it yet" but a case of "it's mathematically proven to
> be impossible". Sorry, but you are out of luck.

Can you substantiate this? A Google search for "destructors considered
harmful" turns up no hits (this morning) :-)

I'm not a Python programmer

Posted Mar 30, 2005 14:51 UTC (Wed) by AAP (guest, #721) [Link]

but it seems to me like the dynamic typing would be a problem. I remember getting bit by that in the bad old Basic days. At least Perl allows a "use strict" to catch misspelled variable names.

Evidence that Python is advancing into the enterprise (NewsForge)

Posted Mar 30, 2005 15:15 UTC (Wed) by cpm (guest, #3554) [Link]

This is really pretty funny.

Lemme see, Python is 'almost ready for the enterprise' and
Java is 'safe enough for serious projects'.

Okay, hypothetical. I need someone to write a program for my
"enterprise", I can choose from a Java programmer, or a Python
hacker.

Which do I choose?

Evidence that Python is advancing into the enterprise (NewsForge)

Posted Mar 30, 2005 17:18 UTC (Wed) by szoth (subscriber, #14825) [Link]

I hope you're not using "hacker" in the pejorative on LWN! And anyway, the answer is obvious, at least to Paul Graham:

http://www.paulgraham.com/gh.html

;)

Evidence that Python is advancing into the enterprise (NewsForge)

Posted Mar 31, 2005 15:23 UTC (Thu) by trutkin (guest, #3919) [Link]

Or you could choose between the Python programmer and the Java hacker. What's your point?

Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds