Python Moving into the Enterprise 818
Qa1 writes "Seems that Python is moving into the enterprise. At the recent PyCon it has become apparent that it's not just Google, GIS, Nokia or even Microsoft anymore. The article points out that Python is increasingly becoming a perfectly viable and even preferred choice for the enterprise. More and more companies are looking at Python as a good alternative to past favorites like Java. Will we finally be able to code for living in a language that's not painful? Exciting times!"
Re:Jython? (Score:5, Insightful)
Microsoft's involved? (Score:3, Insightful)
Re:Advantages? (Score:1, Insightful)
Re:Advantages? (Score:3, Insightful)
The problem arises in Python's web programming support. The documentation is pretty much non-existent and you can soon get module-overload when you are importing more and more modules to do fairly simple stuff in web apps.
Sometimes I just think while Python is most certainly a far better designed language, PHP/ASP.NET (C#) seems much more 'pratical', and it's definitely much easier to quickly build web apps in.
Is there much effort to improve Python's web support? A manual with similar completion of php.net would help it go a lot lot further.
sigh... how about a real opinion? (Score:5, Insightful)
I've been using python for pretty much anything in my company that isn't web based, and things couldn't be better. There's talk about python being slower, which it is, but most libraries that do important things are just C wrappers anyway, so the speed decrease is negligible as python is just holding the logic. Tk is nice enough, I guess, but I tend to use wxPython. Either way, it gives you cross platform GUIs, which is always a nice thing. Using pyexe allows you to even 'compile' scripts into exe files with win32 machines.
To be absolutely honest though, I can't think of an easier language to learn (I even teach >40 yo women now and then!) or a quicker language to code in. Once you're accustomed to it, the code just flows out, and I've seldom been disappointed by the results. The formatting requirement helps to ensure that your code isn't a disgusting mess that no one can figure out, YMMV.
Re:Advantages? (Score:2, Insightful)
If you take out comments, which one is more easier to read?
I have nothing personal against Python, actually I can say that I am a fan of python, but let's use a right tool for a right job.
Economics (Score:1, Insightful)
The difference from the simpler languages is that it can do very difficult things. Once you get used to some of its unique features (I remember how thrilled I was to discover dictionaries) you can put serious applications together a lot faster than with other languages.
The bottom line is that you can do serious applications a lot faster than you can with other languages. In a business environment, that translates to profit.
p.s. "Integrated development environments (IDEs) are also more numerous than polished." Yep, I use emacs.
Re:python performance (Score:5, Insightful)
Also you can make the shootout say almost anything, for example if you also calculate the code lines in and weight pidigits with a 4 multiplier, Python comes up as the best of the "serverside languages" (Perl, Python, Java, PHP
Re:Advantages? (Score:5, Insightful)
The one thing that Java has going for it are "standard" APIs you can bank on. Is there a standard set of enterprise APIs for Python akin to J2EE?
And all of this isn't to say that one can't leverage both technologies [bea.com] where appropriate, even in commercial products...
Yes, but what about the GUI - speed no problem (Score:5, Insightful)
Re:python performance (Score:5, Insightful)
Re:A quick check on Dice.com (Score:5, Insightful)
Re:python performance (Score:4, Insightful)
If you come across a situation where Python is too slow for what you want to do, then Python can work happily enough with libraries programmed in C. If that's still not fast enough, then use a different language. But I suspect that for 95% of all programming tasks, Python is fast enough.
Three barriers to enterprise Python (Score:5, Insightful)
Many programmers, including top ones like Eric Raymond http://www.linuxjournal.com/article/3882 [linuxjournal.com], are so put off by Python's use of whitespace as a block delimiter that they swear never to touch the language. In my case, this lasted for two years. You need to spend twenty minutes learning the language, after which the whitespace stops being a problem and starts looking like one of the many great ideas in the language. The challenge is getting people past their initial disgust enough to try it.
2) Misperceptions about typing
Many people think agile languages like Python and Ruby are not strongly typed and therefore present scalability problems and can't be used reliably by large teams. But Python and Ruby are strongly typed (unlike Perl)- you don't get type conversions you don't ask for. The real distinction is that the agile languages are dynamically typed rather than statically typed like Java/C++. To truly grasp the notions of "duck-typing" and lazy evaluation of types is as much a stretch as it was to "get" objects for those of us who were around 15 years ago- it's a basic change in how you think. You'll know when you're there, because you'll see in a flash that Java's static type declarations are not only redundant and painful, but they are also in themselves a key source of brittleness in large programs over time.
3) The youngsters' problem
This is probably the biggest barrier: university CS departments have become nothing but Java training courses. In trying to better prepare grads for actual careers, they have added a lot of basic business teaching, which is good. But they no longer bother to give students a real understanding of actual computer science, sticking instead to a cookbook approach using Java. So young people arrive in enterprise IT shops knowing nothing but Java and thinking they know everything, so they are not open to anything requiring a different intellectual approach.
Re:Too bad... (Score:5, Insightful)
I'm sorry, but the "but it's slow" argument does not hold for most software designed today. Let's please get over it.
We will start to see alot more of it.. (Score:5, Insightful)
It is a great language we use it for everything, web services, linux / win integration, nt services, automation etc.
How not to win the corporate mind. (Score:4, Insightful)
For good measure, let's look at the documentation from a J2EE vendor here [bea.com].
While PEAK sounds intriguing, I'm not sure that major projects started by Fortune 100 globals will leverage a technology that lacks the level of documentation quality you can find in other products in that space.
I bring this up because documentation is often an indicator of the level of quality you can expect in terms of support. This is not to say PEAK is bad or poorly written, just that the supporting documentation and resources don't match those available for J2EE implementations.
Remember -- it isn't the best technology that wins, but the technology that is most accessible. In the case of enterprise APIs, even though PEAK may be easier and more scalable (and this is an excerpt from their page): But PEAK is different from J2EE: it's a single, free implementation of simpler API's based on an easier-to-use language that can nonetheless scale with better performance than J2EE. ...it will need some time and some nurturing in order to compete for mindshare with developers and non-technical decision makers.
Re:Python *is* painful (Score:5, Insightful)
The old K&R style of doing: versus: this is NASTY in the debates it causes and wars people fight over which is 'right' or 'easier'. For those who don't know, Python doesn't use braces, it uses any consistent indent, as in: Very simple. Reduces line count by 1 or 2 and completely removes the religious debate about brace location. I really like this. There's enough problems debating what the code header/copyright/IDENTIFICATION DIVISION (grin) section's going to look like. "I like #####!" "No, I like #-------!!!", "You Suck!" "No, You Suck!" etc.
Don't knock the lack of braces until you try it. it really does make the code look cleaner.
--Kevin
Re:Toolsets (Score:3, Insightful)
Why is whitespace significance a good thing? (Score:5, Insightful)
Well, with any other language, if I get a piece of unfamiliar code and have problems reading it due to weird indentation, I just run it through Emacs' indent-region. Can anyone explain to me why this is not just as viable as mandating the indentation policy by embedding it in the language's syntax?
Re:python performance (Score:3, Insightful)
People are expensive.
Writing in powerful languages like Python makes your people more effective. And most enterprise apps are not CPU limited anyway.
Re:Too bad... (Score:1, Insightful)
No, it is I that is sorry. Right now, your thinking is prevailing. Slow, crappy software is being pumped out left and right by programmers that are either too lazy to do it properly or they simply don't have the ability to do it properly.
The fact that most software today is poorly written and is slow is a very sad fact that I can't "get over". Perhaps, one day, you will.
Re:Advantages? (Score:3, Insightful)
What a silly picture.
Re:Too bad... (Score:3, Insightful)
When I code for fun I seldom do that in C/C++ anymore. At least not I know that the application won't need "that extra juice". What's the point in spending several times the develeopment effort on making it work properly instead of adding polish or just doing new stuff?
Re:Yes, but what about the GUI - speed no problem (Score:5, Insightful)
But overall, I completely agree: the std python distro needs to standardize on wx, get rid of Tk and at least incorporate the win32all distribution in the win32 version (it just too nice to leave out).
My biggest peeve as a long-time pythonista (the newsbot in my sig is 25k+ LOC of pure Python) is the standard library: I can live w/o a CPAN-like repository (although that would rock), but for a language that used to boast that it comes "with batteries included" the std lib has gone downhill in the last few versions: too many overlapping or competing modules (why, why do we need httplib, httplib2 and urllib?? or getopt and optparse? and what are the differences between them?) and not enough attention into polishing the library into the fantastic toolkit that was around the 1.5 or early 2.1 series.
Someone, probably the BDFL, needs to stand up and take obsolete modules *out* of the standard library, so that the better ones can be improved even more, instead of having various tweaks and improvements going into overlapping modules. That's the point of having a *standard* library after all...
I'd rather have a good std lib than function decorators and other exotic language constructs...
Re:Too bad... (Score:1, Insightful)
LOL! Fresh out of tech school are we? Not out of college yet? I only wish that I could be there when you discover the "new concept" of efficient and quality programming. Speed counts.
One day you will have an epiphany. You will realize that it shouldn't require a 3Ghz processor and a gig of RAM to run a browser.
Re:Why is whitespace significance a good thing? (Score:3, Insightful)
Re:Too bad... (Score:1, Insightful)
* Number pulled from you know where.
Re:Too bad... (Score:5, Insightful)
What's the point of making it work properly?!?!? Surely you have mis-spoken here.
Let's play a game. Let's suppose a bunch of little apps for which speed is not a critical factor for any one of them. As a forinstance, look at all those apps presently running in the system tray. Let's suppose that those apps are written badly or are written in inefficient languages. That shouldn't be too much of a stretch.
Now, let's try to do something. Whether you are trying to run a realtime application like desktop video conferencing or create a document in a word processor, it doesn't really matter. What ever it is that you try will be a struggle because the system's resources (CPU cycles, memory, swap space) are consumed by all those "noncritical" apps and their inefficiencies. A 1Ghz processor with 1 gig of RAM is no longer adequate? That's ridiculous! And yet, that is where we are at today.
Everyone seems to feel that their "Ultimate MP3 player" is the only app in the world or at least the only one that will ever be run on a machine. They don't think that speed and size are important. After all, they have a very powerful machine at their disposal with oodles of available resources, right?. They fail to realize that their program, no matter how wonderful, is only one of countless others that are all running at the same time and are required to share the resources. They fail to realize that their app may not be too slow when run by itself but, it becomes too slow when run with everything else.
Today, the preferred system is 3Ghz, 64bit, with at least 2 gigs of RAM. Why? What's the point of such a powerful system? Speed! That's the point. Speed is important. Code efficiency is important. But, as programmers continue to deny this and produce poorly written and bloated/slow apps or use inefficient languages, the time will come when a 6Ghz processor is not enough. Doesn't that sound stupid?
Python is killing C#, not Java (Score:1, Insightful)
Re:Jython? (Score:5, Insightful)
I think the level of knowledge among Java programmers is impressive, but by in large I've found they aren't necessarily better programmers because of it. I've learned this the hard way, by hiring people with incredibly impressive knowledge of Java APIs, and then watching them struggle with overengineered designs that attempt to drag as much of that knowledge in as they can manage. I'm not going to make sweeping generalizations here, only to state that I've had bad experiences Java guys who prefer to wander lost in the wonderfully rich world of Java APIs and frameworks than focusing on a customer's problem.
Re:Recursion (Score:2, Insightful)
Let a be the sum of 1 plus the square root of 5, all divided by 2. Let b be the difference of 1 minus the square root of 5, all divided by 2. The nth Fibonacci number is a to the nth power minus b to the nth power, all divided by the square root of 5. Should be in any text on number theory.
So yes, one can calculate Fibonacci numbers nonrecursively.
Re:python performance (Score:2, Insightful)
At the expense of having to write twice as much code, adding endless typecasts to your code, wading through endless documentation covering redundant overloads that handle different types, requiring a separate compile step, installing a VM that uses 10X the disk space and memory, and having only one available programming technique, OO, without other useful ideas from methodologies like functional programming.
Re:Toenails (Score:4, Insightful)
Ruby will give you dynamic typing without all of the whitespace issues. Given that the two languages compete in (mostly) the same space, why should I go with Python if I don't like it's whitespace issues?
I've seen many cases where thirty minutes of practice gets rid of the problems people have with the whitespace.
But why do I have to adapt to the tool as opposed to the other way around?
Your reaction is just as the OP predicted.
The truth is that whitepace-delimited blocks can be a source of difficult-to-find bugs. It also makes it quite difficult to easily copy n paste code from one place to another. Add to this that it makes Python a very poor language for templating (embedding in HTML for example) and you start to understand why Ruby on Rails is doing so well.
Re:Three barriers to enterprise Python (Score:3, Insightful)
Many people think agile languages like Python and Ruby are not strongly typed and therefore present scalability problems and can't be used reliably by large teams. But Python and Ruby are strongly typed (unlike Perl)- you don't get type conversions you don't ask for. The real distinction is that the agile languages are dynamically typed rather than statically typed like Java/C++. To truly grasp the notions of "duck-typing" and lazy evaluation of types is as much a stretch as it was to "get" objects for those of us who were around 15 years ago- it's a basic change in how you think. You'll know when you're there, because you'll see in a flash that Java's static type declarations are not only redundant and painful, but they are also in themselves a key source of brittleness in large programs over time.
The "unwanted type conversions" thing is a nice straw man, but it won't wash. The value of strictly typed languages is in compile time type checking. It's good to have languages that are not type checked, and it's good to have languages that are. The former is better with smaller groups, smaller programs, or more proficient developers. The latter is better with larger groups working on larger programs with more apprentices on the team. The former allows more flexibility and speed. The latter offers more imposed speed limits (and less car crashes).
Performance: python v java in the enterprise (Score:1, Insightful)
python/zope/plone - intranets
php/perl - "medium" commercial apps
java - "Enterprise" stuff (3+ developers)
For each project the right technology: I like all of them!
Re:Too bad... (Score:4, Insightful)
Okay, I'm going to refute this is two stages because you're wrong in two ways.
First, it's not a matter of "processors are cheap". It's "processors are cheap compared to programmers, sometimes". If they're paying for months of your time, most of the time it's way cheaper for them to get a faster computer than have you write the thing in a language that will take longer. That is of course dependant on the number of computers it will run on and the performance requirements of the project.
Second, Java and Python are not necessarily slow. In the case of Java, it's usually a matter of keeping heap allocations to a minimum. In the case of Python, it's usually a matter of spending as much time as possible in a C library (even if that means you have to write the C library).
Doing that will usually get you within a factor of two of the performance of C.
Available libraries (Score:3, Insightful)
Its main two faults in my mind are:
1. Speed (but this is being worked on, see the Parrot JIT compiler)
2. Memory usage. wxPython especially is an excellent toolkit but a memory HOG.
As far as Java goes, I don't particularly like Java all that much, but one area where it has a definite advantage over Python at the moment is libraries. Not just the standard library, but what add-on libraries are available. Python has a lot, but Java has pretty much everything and the kitchen sink.
For example, I recently worked on a project that needed to display and manipulate SVG graphics. The two requirements are that it be cross-platform, and be done quickly (in just a couple weeks). I originally wanted to use Python but was unable to find a cross-platform SVG rendering library for Python. I came across the Apache Batik [apache.org] toolkit for Java and found that it was exactly what I needed.
Batik is pretty sweet -- you get a swing component that you can plop into an app in about 10 lines of code and boom -- you have one of the most compliant SVG renderers that I've seen to date. Plus it even gives you a DOM interface that will update the graphical view in real-time. As much as I dislike Java in general (even more bloated than Python
Re:Advantages? (Score:5, Insightful)
That said, the grandparent poster was a bit disingenous. The File class is roughly equivalent to the stat function/structure in C. You can't read the file without creating an inputstream/reader.
So yes. You are correct. It is more verbose when doing simple operations. But I like to think that more complex operations fall together more easily.
Many programmers like to whip something out now. A quick "one off". Instead, often, with a little more time and more ground work, they can make something that is reusable.
In terms of the IO being verbose. Well its pretty flexible. 2 Interfaces (InputStream/OutputStream) are used for many different opertations. Read/write a file. Read/write to/from a socket. Read/write from a string or byte array. Read/write serialized object s to/from a file/socket/etc.... Its not just File IO. Its ALL IO. Long story short, that is why.
Re:Too bad... (Score:2, Insightful)
1 gig of ram is no longer adequate??? I don't know what "noncritical" apps you use, but I have a AMD 2200 with 512 of ram. I run both XP and Suse on it and I very rarely use up the ram or cpu and I run lot's of python apps. I program python and php for a living.
Re:Too bad... (Score:4, Insightful)
If there was money to be made by making that WeatherThing or UltimateMP3 player fast and efficient - companies would do that. There's plenty of programmers out there capable of writing in or learning more low level languages - of optimizing each loop or branch. The problem is that people are not willing to pay all of the extra associated with the development and testing of software written with risky optimizations (optimizations tend to complicate and obfuscate code, reduce abstraction, etc) in unsafe languages.
The truth is the consumer would rather spend an extra $100 to get enough RAM then spend $10 per program on their PC (that adds up faster) for the programmers to program it "correctly." It's not economically efficient, at least not in the eyes of the consumers.
Why do you think so many kitchen appliances last only a year or two nowaways? Or current VCRs which almost qualify as "disposable." People are rarely willing to pay extra when they think the low cost option is "good enough." In some ways this is what killed the Mac - it was better according to many metrics, but PCs were "good enough" for the average consumer, and the price difference wasn't justifyable.
A computer is a tool to get work done, nothing more. If people valued security, reliability, and efficiency enough, most software would be secure, reliable and efficeint. But people value features and low price, so that's what the market gives them.
Look on the bright side - at least compilers are getting better.
Re:python performance (Score:5, Insightful)
Can you establish that more fully? How is testing say, a recursive-descent parser, going to be a more valid test of recursion than a recursive solution for fibonacci numbers?
Fibonacci is convenient because you get lots of recursive calls while only hitting the stack, and no integer overflow. If you were to use a recursive parser and python ended up slower than the others, you could easily blame it on the non-recursive work you were doing. The fibonacci example allows you to accurately describe the recursive performance without all that other stuff getting in the way.
Re:Advantages? (Score:4, Insightful)
I do suppose if your definition of a good enterprise language is one with all such libraries included, then Python isn't a very good enterprise language. Of course, one could argue that the benefits of Python outweigh the disadvantages at having to download extra packages to handle SOAP, ORB etc.
The difference between Java and Python is similar to the difference between C# and Visual Basic.
I'm a little confused. Are you saying that Python is inferior to Java because Java comes with library X included, whilst with Python library X has to be downloaded separately?
Python is slower than Java and higher level than Java, but beyond that I can't say that there's too much separating Java and Python as languages. Personally, I find programming in Python more efficient, despite having more years experience with Java, but that may be just me.
agreed--cleanup needed (Score:4, Insightful)
The sys/os split, logical as it may seem to the experienced Python programmer, also confuses Python newbies, as does the fact that string needs to be imported and that re is yet another separate module.
I think Python would do well with a major library cleanup, removing rarely used and duplicated functionality, and improving the quality of the library code that is there.
Furthermore, I think it would help for common string, I/O, OS, and regular expression functionality to be importable either via a single import statement (without name conflicts), or to be simply present in the default namespace.
Re:Python *is* painful (Score:5, Insightful)
And who cares about the programmers discussing brace placing styles? They'll surely find other things to discuss about with Python...
Re:Yes, but what about the GUI - speed no problem (Score:3, Insightful)
Re:Too bad... (Score:5, Insightful)
Another poster already made a clarification on this. I didn't "mis-speak" I was just a bit obscure with my meaning. Point being, if you code in C/C++ you'll spend a lot of time making the program work correctly. If you write in eg Java or Python you can get the program working correctly in a fraction of the time. This means you can add polish or move on to new stuff.
Point being, you are more productive in other languages as you don't have to mess with the details so much.
First off, I'm willing to bet that virtually none of the little apps you currently have running are written in Java/Python whatnot. A sloppy coder can leak memeory in any language. (In fact I'd say it's a lot easier to leak memory in a language without a GC.) So moving to C/C++ doesn't really fix the memory issue.
That they consume enourmous amounts of CPU is also not really true. Those processes I have running on my machine all go in at 0% CPU time. If you add them together they might reach a few percent. Not really something which will stop you from typing in Word.
The fix for this "problem" is to get an OS with a descent scheduler so you can prioritise processes properly. That way your real-time applications won't suffer because your little application wants to check for new mail.
No, bragging to your friends that you can get 180 FPS in Doom3 is important. Very few people actually need a 3GHz 64-bit CPU with 2GB memory, I have one and I sure as hell don't need it.
And while code has become more bloated and unoptimised by the years a lot of that is because today a computer can do quite a hell of a lot more than say 10 years ago. Is all of that necessary stuff? Hell no! Is it more fun? Hell yes!
Finally there is one specific area of consumer software that actually demands better computers. That is games. Interestingly enough that area also have many of the best coders.
Re:Great... but PLEASE allow 'implicit none'! (Score:3, Insightful)
Whoa, this is all crazyness. (Score:0, Insightful)
Second, spending 20 minutes with python will not cure the whitespace problem. It is 100%, without a doubt a mistake. I have a 12000 line 3 man project in python, and the whitespace issue is a very big problem. We are looking for a proper language to migrate to partly because of this.
And typing is a real problem. variable = obj.function and variable = obj.function() are both legal, and both compile. They are not equivilent and a language with proper typing would catch such errors.
Re:Too bad... (Score:3, Insightful)
The logical extreme of the "all apps must be as fast as possible" argument is to code in ASM. I suggest that anybody who pushes this argument write every app in ASM. See how long it takes before this person gets fired for inefficiency...
Why are some coders hesitant to "use the right tool for the job"? ASM might be necessary if you're optimizing a crypto or compression loop, while C or C++ might be more appropriate for the rest of the app, but Perl or PHP are surely more-appropriate languages for web-scripting! Duh.
But no, we have these "code everything in C, C is the be-all end-all of languages" dolts...
Re:Why is whitespace significance a good thing? (Score:3, Insightful)
Personally, my code usually has a giant comment at the top describing the purpose of a class/library, a reference implementation, and version information. Before any significant chunk, I write out what I'm doing, and why - in case I ever have to read it again in the future. in the end, my code is probably half comments. This is good programming practice in general, and so few people do it that it makes me want to cry. Anybody, and I mean anybody, can pick up some of my code and figure out what's going on.
*That* is why I think python's enforcement of whitespace is a pointless anachronism. Good programming is good programming. Remember when Java said making everything an object meant everyone had to use objects properly? No, it meant old functional programmers would make a huge class, call it "UtilitiyClass" and use it like a library. You simply can not make good programming practice magically appear via language rules.
So yeah. I'll continue to roll my eyes when people mention python. No single attribute transforms an otherwise commonplace language into greathood. It's just another tool to me, with a weird limitation I could care less about, since it never applied to me anyway. Yeah, my code style would work in python; it also works in ada, c/c++, java, perl, php, and every other language I've used.
Python's cross-platform compatibility and somewhat extensive library are another point entirely. Why not push those elements instead? They actually mean something to good programmers who wouldn't give two figs about python's Awsome Whitespace Rule(tm).
Re:Too bad... (Score:3, Insightful)
I program in C every day and I haven't coded an error of the type you describe in over a year. I would know if I had -- our C memory manager catches all manner of pointer problems, accounts for all memory allocation and freeing, memory over- and under-runs, gives us stats on memory allocations and so on.
I'm definitely a Python fan, but your agument against C isn't valid. It's just an argument that crummy programmers write crummy C programs, which is not news.
Python is a perfectly reasonable language for coding certain types of applications, and it is also a good language for programmers that aren't that skilled because it puts a strong safety net in place for many types of errors with the exception system it uses. C is something else entirely.
Re:python performance (Score:5, Insightful)
I was using an example from the real world to point out why 3 seconds matters. In any significant application there will be some processes that are sufficiently complicated that the choice of algorithm or choice of language will lead to a 3 second delta one way or another. There will also be places where adding a UI shortcut will save 3 seconds.
The real world example talks about UI shortcuts that can save those 3 seconds, and Python makes it easier (according to the common wisdom) to add features. Other languages are more performance centric, and make it easy to save those 3 seconds in operation intensive sections of the code.
I wasn't arguing that Python is bad because it's not as performant. I was saying that both CPU performance and UI friendliness are important, so choosing between Python, Ruby, C#, Java, C++, C or any other language on the spectrum is a question of weighing values.
Ferfucksake people, stop trying to be argumentative and start trying to understand what people are saying. We all claim to be so smart, is our only ability with our intelligence to pick nits? Or can we use our intelligence to seek mutual understanding?
I mean, I can see why the media is turning into a bunch of ranting extremists - they're just a mirror reflecting our own horrible image.
Feh.
Re:Too bad... (Score:3, Insightful)
You meet the demands of the project/customer. I'm not really arguing with you, but this is sort of the point of a thread about Python. It's a tool that helps balance this process for the developer - this in turn should result in benefits to the enduser.
It is nice to have a perfect balance, but efficiency is relative and (developer) resources are finite. Always.
Re:Python still has severe limits (Score:3, Insightful)
The memory is only available to other programs after the program exits.
As a result of this, most daemons will re-exec themselves to free up memory for the rest of the system.
At least, that's what I've always heard. Maybe newer versions of the linux kernel are much smarter...
forces a person? (Score:1, Insightful)
The most important part of any program is the algorithm. That's what needs to be understood. And Python cannot make a programmer write algorithms.
I don't see the attraction of Python's forcing you to indent in a certain way.
Re:Whoa, this is all crazyness. (Score:3, Insightful)
Though the error may be clear and obvious, knowing it the first time the code runs can be too late. I've wrote code that can only run a few weeks every year (nothing important, but the nature of the program limited it to running only at very specific times), and Python has allowed numerous stupid bugs (typos, etc.) to stay dormant until I was able to run it. Static typing would have been very useful in this case.
Pychecker [sf.net] is a step in the right direction. It doesn't do very advanced type checking, but can warn you about inconsistant return types (returning a string in one path, but another data type in another, for example) at least. MJD's Strong Typing and Perl [plover.com] discusses how strong and static typing can be done right (in ML), in order to prevent many bugs at compile-time (in his case, infinite recursion). I hope we see more options for static typing in Python, if only as an option. I wouldn't want to not ever be able to write simple Python programs without declaring every variable, but for larger programs, static typing is definitely useful. Maybe in the future we'll see more languages that are able to prove that a program is correct (using static typing, etc).
Re:Too bad... (Score:3, Insightful)
You are right though that a mix of high level and low level languages tends to give the best result in the lowest amount of time. What has shocked me is that from experience I have seen that pure c/c++ apps are almost always faster when redone in python even without anything outside the standard library. C/C++ show up very fast in these micro optimization benchmarks. However I have not seen them show up that fast on large codebases. Probably because it takes so much time and effort to optimize them. So while those apps could be made faster then the python versions it would cost too much money to do it since the code base is so large. This is an even better reason that that hybrid stuff pays off so well. The low level parts are so small that you can highly optimize them and you will end up with an app a good deal faster then ANY c/c++ app of reasonable since you can afford to produce.
Re:Advantages? (Score:1, Insightful)
I've done medium-to-large projects (over 50,000 lines) in both Java and Python, and I've had exactly the opposite experience.
For small things, Java is more verbose, but if you're new to programming you kind of accept it. If you've been programming for a while maybe you say "oh, but it'll scale well, so for big projects it's probably a win".
For big things, Java is more verbose at each level, and when you add it all together it's *ridiculously* more verbose than the same thing in Python. Some things, like Java's weak string handling, you can work around (everybody I know has their own StringUtils class), but other things like "ints are not objects", or "3 common yet incompatible array types" you simply can't ever escape.
I've learned that complex things are made up of a lot of simple things. If you can't do simple things simply, you sure won't be able to do complex things simply, and maybe not at all.
Re:Perl is run by a Christian. (Score:3, Insightful)
why? why does that matter? why should i care whether Alan Turing was gay? why does it matter what religion or faith Larry Wall may or may not follow?
Re:Finding a good general purpose language is hard (Score:3, Insightful)
I'm also extremely unconvinced that any of the languages you mention have less "reasoned design decisions" than C++. The advantage of these newer languages is that their programming is, in general, more "safe" than predecessors like C++ -- although none of them are a true "general" language (what is?), a competent coder should be able to pick up the one most suited to his or her project and use it, without fear of having to learn a whole load of coding rules to avoid buffer overruns and the like.
Although C++ can be a reasoned choice sometimes, I do not see it as useful for new projects in a lot of areas. For most purposes, there's a better choice. But that's simply my opinion, of course.
Re:Perl is run by a Christian. (Score:1, Insightful)
Re:Is premature reusability the root of all evil? (Score:1, Insightful)
In short: Java isn't a languaged designed to make Hello Worlds.
Re:Finding a good general purpose language is hard (Score:3, Insightful)
It all depends on your application domain. For applications that are predominantly UI/database driven, as obviously many are, C++ has few advantages over something like Java. However, in anything scientific (where performance is often paramount) or in huge markets like embedded or instrument-control applications (where tight code and/or low-level control are often required), languages like C and C++ are still far ahead of the competition IME. Java is making some inroads into the embedded space, but it's barely a blip in the graph right now.
I think that's a little harsh. If there's one thing you can fairly say about C++, it's that Stroustrup and the standards committee take their time and try to reach good, practical decisions. It takes forever to make changes as a result, but with a few exceptions (the designed-by-committee string functionality, for example) the underlying design decisions of C++ are really very robust. Stroustrup's oft-cited book, The Design and Evolution of C++, provides some fascinating insights into how a serious computer scientist designs a language, and the factors that weigh into that decision. Even where I disagree with a decision that's been made, not that that often happens with this particular programming language, I can at least understand the rationale behind the decision.
Compare this with Java's almost amateur development process, and the design weaknesses that have resulted. For ages, the Powers That Be dictated that generics/templates/whatever weren't useful, and wouldn't be included. Lo and behold, a few years later, they concede that they were wrong and retrofit them (but still in a feeble way that misses half the point and 90% of the power). More seriously, although Java has a vast standard library, much of it is a joke compared to the high-quality, often peer-reviewed work found in things like Boost, CPAN, and so on. For example, AWT was so bad they had to invent Swing, and that's still not a patch on serious GUI libraries like Qt or wxWidgets in their various forms.
In fairness, the less formal processes (a.k.a. benevolent dictatorships in most cases) that underlie many scripting languages (notably Perl and Python in relation to the current discussion) tend to be rather more flexible. Even so, how can a language that doesn't even have a specifcation apart from a compiler that its own author couldn't rewrite from scratch possibly be considered to have an industrial-strength design process? (That would be Perl, and indeed the reason for all the completely rewritten underlying mechanics for Perl 6.)
That is indeed a compelling advantage. C++ has always been written for "good programmers", the craftsmen who take their craft seriously enough to learn the details and avoid the obvious mistakes. Unfortunately most programmers aren't like that, and most companies are going to be employing "most programmers" most of the time. It is therefore a sensible management decision to go with technology that mitigates "most programmer" errors.
The only problem is that sometimes, you actually need finer control (and to accept the attendant risks) in order to get a good result, and if you need to hire some geeks to use that control, so be it. If you have a language that actually won't let them bend or even outright break the rules when they know damn well that it is safe to break them in the particular circumstances they're working under, then that's a serious liability to some kinds of project. If you're going to fall back on linking to C functions, using JNI, or whatever every time you need performance, you might as well write in a language like C++ in the first place, and just hire enough good people to write safe, high-performance wrappers for the low-level code...
Re:Whoa, this is all crazyness. (Score:3, Insightful)
You'll be able to write the code in Python, and the tests, in less time than most statically typed languages. Many would argue that you can write code and tests in any language faster than writing WORKING code without tests... but that starts down a different avenue of discussion.
Re:Toenails (Score:4, Insightful)