Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

TIOBE Declares Python the Programming Language of 2007

timothy posted more than 6 years ago | from the welcome-to-the-annual-proggie-awards dept.

Programming 166

The TIOBE Programming Community Index has declared Python as the Programming Language of 2007 due to a 58% surge in its popularity rating during the year, making it now the sixth most popular programming language and finally surpassing Perl. They also assert that Python has become the "defacto glue language," being "especially beloved by system administrators and build managers."

cancel ×

166 comments

Sorry! There are no comments related to the filter you selected.

Hmmm (-1, Troll)

Anonymous Coward | more than 6 years ago | (#21972232)

I'm hate python. Not that it's a bad language, just that I prefer to use just about anything else.

Re:Hmmm (3, Funny)

the_B0fh (208483) | more than 6 years ago | (#21972356)

PHP and ActiveX over Python?

Mamama!!!! Make the bad man go away, please.

Re:Hmmm (3, Interesting)

mysqlrocks (783488) | more than 6 years ago | (#21972726)

PHP and ActiveX over Python?

What's up with all the PHP haters on Slashdot? For building most web applications it's the place to be. Zend is working hard to increase the level of professionalism of the PHP community. I've recently started using Zend Framework [zend.com] and it's a really nice way to build web applications.

Re:Hmmm (2, Insightful)

AmaDaden (794446) | more than 6 years ago | (#21972952)

What's up with all the [your favorite programing language] haters on Slashdot?
*sigh* Welcome to Slashdot....

Re:Hmmm (3, Insightful)

XorNand (517466) | more than 6 years ago | (#21973244)

I can't quite figure out if you're a subtle troll or not? However, one of the biggest complaints about PHP programmers is that they're oblivious to a lot of important aspects of programing. Security being one of the biggies. Not being aware of the general criticisms of their chosen tools is another. (Which, if you're not a troll, you've proven my point.) I happen love Python, but I'm also aware of why many people don't like it.

Re:Hmmm (4, Informative)

mysqlrocks (783488) | more than 6 years ago | (#21973568)

Not being aware of the general criticisms of their chosen tools is another. (Which, if you're not a troll, you've proven my point.)

I'm not a troll, just wondering why there's so much bashing of PHP on Slashdot. I am aware of many of the criticisms of PHP. One of them you mentioned:

However, one of the biggest complaints about PHP programmers is that they're oblivious to a lot of important aspects of programing.

You'll see that I partly addressed that criticism with my "Zend is working hard to increase the level of professionalism of the PHP community" statement. I'm not going to go into a full length defense of PHP but if you are looking for such a defense I would suggest 10 PHP Myths Dispelled [jaybill.com] . I am not a PHP zealot, I just have a lot of experience with it and would prefer to build web applications using PHP over the alternatives that I've tried (Java/JSP, ASP.NET). I can't compare it to RoR or Python since I have tried neither. I've read about both and have seen nothing compelling to make me consider switching. I'm quite productive developing in PHP and am quite aware of both it's advantages and criticisms.

All languages are bashed on /. (3, Insightful)

Qbertino (265505) | more than 6 years ago | (#21978744)

Sure there is PHP bashing, as is bashing of many other PLs. Just watch a Lisp or C guy go after Java to see what I mean.

The truth is, the people that really are programming and solving problems rarely rant about a PL without having tried it. PHP is an extremely n00by-friendly programming language - also because of it's wide availability - and thus lots of code in PHP is quite wacky actually. This falls back on to the PL itself. Flash/ActionScript has simular problems (aside from having a strong prorpietary touch to it).

In the end PHP, with its neighbourhood to markup, is the web-eras basic. With way more succesfull and impacting open-source web applications than any other solution - Python included.

I *am* a Python fan, but it just didn't have that critical mass of an install base back then when mod_php gained traction. And that the true King and ruler of all webkits, Zope, has had a backend that looks like shit for 7 years now didn't help it either. Nowadays nobody gives a hoot if Zope is lightyears ahead of Rails and a few years older - it's just a niche webkit for people who've bumped into it

There are a lot of factors that make a language successfull, and PHP meets very many of those. Just because people rant about it doesn't mean it really is bad. Nobody I know would say that programming in C is really fun and modern and hip. And many people rant about it. Yet look how many mission critical work still is done with it - because the untested alternatives aren't any better.

On the server-side I've been mostly doing PHP for last 3 years now and am now going totally OOP with the CakePHP Framework and a large international project. It works, is extremely neat and quick to develop with. So be it that PHP has a few bizarly named core functions and arrow->syntax. So *fucking* what? My friend who has a business aswell and is a Sun partner and Java fanboy just moved his webproject from Java to PHP so they could finish it faster.
"Java Fanboy speeds up project by switching to PHP" - enough said.

Slashdotters rant a lot, but reality is allways a tad different.

Re:Hmmm (1)

nuzak (959558) | more than 6 years ago | (#21974668)

> Zend is working hard to increase the level of professionalism of the PHP community.

I'd be satisfied if they just worked to improve the damn language.

no_i_really_mean_it_mysql_really_escape_strings()

Re:Hmmm (2, Informative)

mysqlrocks (783488) | more than 6 years ago | (#21974946)

Technically you're talking about the available functions, not the "language" itself. But, semantics aside, I would argue that your complaint is being addressed. The Zend Framework [zend.com] I linked to and the SPL [php.net] are PHP class libraries that you can use if you would prefer to work with PHP in OO way and (for the most part) forget about calling PHP functions outside of a class or object context.

Re:Hmmm (1)

mr_mischief (456295) | more than 6 years ago | (#21980684)

The main library of functions in the core namespace along with the syntax rules for the language pretty much are the language. Having an extensible language with multiple namespaces is a much cleaner alternative to lumping so much into the core. That's the complaint.

There are people who use PHP with proper modularization, but most of what people see isn't done that way. In a language that's largely used for Open Source software, the state of the code in those OSS projects will be what the language is based on, fair or not.

Re:Hmmm (1, Informative)

Anonymous Coward | more than 6 years ago | (#21975356)

http://uk.php.net/create_function [php.net]

And if you can't see what's wrong with that (especially if you think it's comparable to anonymous functions in Lisp, Ruby, Haskell, etc etc), you need to go boil yourself in oil.

Re:Hmmm (2)

DragonWriter (970822) | more than 6 years ago | (#21977056)

What's up with all the PHP haters on Slashdot?


I tried PHP out for a while a couple years ago. Quite a lot of useful libraries, but the language itself didn't seem to offer much. For just gluing together the existing libraries with minimal new code, it seemed to quite usable (and a lot of web development might get by with that), but it seemed a lot less nice when there was more processing involved. Maybe I just didn't get it, or maybe its improved since then...

For building most web applications it's the place to be.


Why? Sure, it featured neat embedding in HTML before there were Python or Ruby templating engines that used Python or Ruby in HTML, but why would it be preferred now, for a new, ground-up web application, besides familiarity to the developer? (I'm not trying to be argumentative, just looking for perspectives on "why PHP?")

Re:Hmmm (5, Funny)

reSonans (732669) | more than 6 years ago | (#21972400)

I'm hate python.

Man, you take this stuff seriously. Changing your name is hardcore.

Great, lets all program python in 2007! (2, Funny)

Anonymous Coward | more than 6 years ago | (#21972262)

Oh, wait. A bit late for that isn't it?

Re:Great, lets all program python in 2007! (2, Funny)

Anonymous Coward | more than 6 years ago | (#21975630)

They got the date wrong. The year of the Python doesn't come until 2013 [wikipedia.org] .

Re:Great, lets all program python in 2007! (0)

Anonymous Coward | more than 6 years ago | (#21980926)

Pfft. Python? That is SO 2007!

Maybe we will see more Web (1)

Burz (138833) | more than 6 years ago | (#21972306)

...frameworks and apps written in Python. It got off to a good early start with Zope, but the hype over PHP sadly swamped all else.

Re:Maybe we will see more Web (4, Informative)

Scarblac (122480) | more than 6 years ago | (#21972604)

Currently Django, Turbogears and Pylons are all hot. Great web frameworks are there, start using them :-)

Re:Maybe we will see more Web (2, Interesting)

abigor (540274) | more than 6 years ago | (#21972892)

I'll second the good words for Django. Never used the others, but Django is just great.

Re:Maybe we will see more Web (5, Interesting)

SkelVA (1055970) | more than 6 years ago | (#21973532)

I just picked up django two weeks ago and I'm loving it. I'm converting a PHP project slowly, and as an anecdote on how much more productive django is than PHP (for me):

I had some features I had estimated out in PHP (over the last 6 months my estimates have been pretty dang close), and I implemented several of them in Django/python instead. I averaged beating my PHP estimate by 1/3rd, and that's including the time I spent trying to learn how the heck to do things in Django. I can't wait to see how things look once I've got at least an intermediate understanding of my framework. I don't hate PHP, I just love python much more.

Re:Maybe we will see more Web (3, Interesting)

mysqlrocks (783488) | more than 6 years ago | (#21974342)

I'm converting a PHP project slowly...I averaged beating my PHP estimate by 1/3rd

Perhaps you learned something the first time you solved the problem which helps you solve the same problem quicker the second time? Perhaps if you redid the project in PHP (I know this would be pointless, but for sake of argument) it would be just as fast as in Python?

Re:Maybe we will see more Web (5, Informative)

SkelVA (1055970) | more than 6 years ago | (#21974590)

Perhaps you learned something the first time you solved the problem which helps you solve the same problem quicker the second time?


That would definitely effect any re-implementation I had to do. I probably didn't make myself clear, but the efficiency was gained on 100% new code adding a new set of basically standalone features (A quizzing module added to a document control system). Of course, the efficiency gain was over my estimates, and they're subject to the accuracy of my initial estimates. I've been using the trac timing and estimation plugin to track my estimations over this project though, and they've been pretty dead-on (especially the last couple months).

When I go back and do re-implementation of features already present in PHP, I should only expect big gains coming from being able to just port code instead of design. I would really like to see more empirical evidence on the topic myself, but all I have to go on is my personal data.

Re:Maybe we will see more Web (1)

daeg (828071) | more than 6 years ago | (#21973954)

The only problem is finding easily relocatable Django candidates. :-) (*cough* Tampa, Florida, anyone?)

We run almost everything in Django -- website, management, and patient records (secured, don't worry, and kept relatively anonymous... no SSN, etc).

Re:Maybe we will see more Web (1)

Joe Tie. (567096) | more than 6 years ago | (#21979072)

Some more praise for django here. One of the great things about it for me is how well it scales up or down. I never feel like I'm forced to do anything when I'm using it. Unlike most php frameworks, where I feel like I'm being constrained at one level that's been prechosen for me, no more, no less. It's really beautifully elegant in design.

Your flying! How? (4, Funny)

slyn (1111419) | more than 6 years ago | (#21972338)

Two oblig python links:

Python @ xkcd [xkcd.com]

and

Python @ Bash.org [bash.org]

HHSSSHSHSSS

Who? (0)

Anonymous Coward | more than 6 years ago | (#21972342)

Who?

Bout Time (0)

Anonymous Coward | more than 6 years ago | (#21972350)

Python is a great language.

Obligatory XKCD comic: http://xkcd.com/353/ [xkcd.com]

I'm sure the python haters will be coming out of the woodwork soon though.

Re:Bout Time (2, Insightful)

StevisF (218566) | more than 6 years ago | (#21972708)

People don't hate Python. People hate the people who go around trolling discussion of every other programming language saying how much better Python is than the language being discussed.

Re:Bout Time (0)

Anonymous Coward | more than 6 years ago | (#21972784)

Speak for yourself. A python once ate my sister. I hate snakes of all types.

Re:Bout Time (0)

Anonymous Coward | more than 6 years ago | (#21973372)

Actually, Python is not named for the snake but for Monty Python.

Re:Bout Time (4, Funny)

krog (25663) | more than 6 years ago | (#21973528)

as is every fucking variable, subroutine name, and pun in every Python program, site and text

Re:Bout Time (1, Funny)

Anonymous Coward | more than 6 years ago | (#21973782)

And who were Monty Python named after? See? It's all a giant pro-snake conspiracy. Don't let them fool you, it's just like ASP, Microsoft's web scripting language.

Acceptance Speech (3, Funny)

pembo13 (770295) | more than 6 years ago | (#21972354)

I would just like to say thank you as I accept this award on behalf of my fellow Python brothers. We all know that God created the universe with Python, but allowed the non believers to think that it was Perl or LISP so that they would not commit seppuku.

Re:Acceptance Speech (1)

yaphadam097 (670358) | more than 6 years ago | (#21974998)

Only a ruby programmer would commit seppuku.

Re:Acceptance Speech (1)

mvdwege (243851) | more than 6 years ago | (#21975920)

Yeah, Cleopatra is more Python's style.

But what would be Perl suicide? Let yourself be trampled by camels?

Mart

Re:Acceptance Speech (2, Funny)

Anonymous Brave Guy (457657) | more than 6 years ago | (#21976848)

But what would be Perl suicide? Let yourself be trampled by camels?

<obligatory> There's more than one way to do it! </obligatory>

Re:Acceptance Speech (1)

SanityInAnarchy (655584) | more than 6 years ago | (#21977616)

The universe doesn't support threading? Or just runs on an immensely large, but single-core, CPU?

Tried python (1)

Jack9 (11421) | more than 6 years ago | (#21972718)

OPED:
Wouldn't call it the year of Python since there's nothing special that's happened with Python this year. Heard a LOT more hype about Ruby (f that).
Tried the twisted framework. Garbage.
Frameworks can't be written successfully in a baby language like PHP, Python frameworks aren't gonna magically appear.

I'll take PHP, Java for backend and Flex/Actionscript for frontend.

Every task has a language/framework to fit it (4, Interesting)

mstahl (701501) | more than 6 years ago | (#21973308)

PHP, Java for backend and Flex/Actionscript for frontend

Them's fightin' words, sir!

But seriously.... I've just gotten so tired of PHP in the past two years, and Ruby was such a great improvement to it. I used Python before PHP and my only complaint at the time was that it really was more trouble than it was worth at the time to write whole web applications in Python. You could, but languages like PHP were made for the web, so it got superseded. Once upon a time I wrote a few games in Python using PyGame and PyOpenGL though and had nothing but great experiences with that. I wouldn't call Ruby a cure-all, but it's pretty flexible and really pleasant to use for a wide variety of projects.

That being said, I think that your post really misses the fact that for every task there's usually one or two programming languages or frameworks that would be "best" for that task. While PHP and Java may work as a backend for you, many of my projects are almost completely perfect for a Ruby on Rails implementation or specifically require functionality that exists nowhere else. Meanwhile Actionscript implies Flash, and I only have a couple of things brewing right now where Flash is even an option, much less advisable. I'm not trying to slam you here; I'm just saying that like anything else your mileage may vary.

Also, python's supposedly getting tail recursion and some other tasty features soon. I might be tempted to pick it back up if it can surpass ruby in its efficiency that way.

Re:Tried python (2)

AlXtreme (223728) | more than 6 years ago | (#21976948)

Frameworks can't be written successfully in a baby language like PHP, Python frameworks aren't gonna magically appear.

Like Django [djangoproject.com] , perhaps?

I'm with you on twisted; you nead to twist your head around it. Python has indeed had a relatively quiet year. Django on the other hand seems to be doing things just right and leaves the programmer with the final say in how he wants to structure his application. I've been using it for various projects over the last 1.5 years: it has never let me down and shortened development time considerably, leading to very happy clients.

Given I charge by the hour, I might have to pick up Java to crank up those invoices...

Re:Tried python (1)

NewbieProgrammerMan (558327) | more than 6 years ago | (#21979518)

I'm with you on twisted; you nead to twist your head around it. ... Django on the other hand...

As I understand it, Twisted is more of a framework for writing frameworks; it's not meant to provide the sort of higher-level stuff that people generally expect when they say "web framework." If I'm wrong about that, somebody please correct me.

TIOBE? (3, Funny)

LMacG (118321) | more than 6 years ago | (#21972928)

I plugged that into Wikipedia and I got redirected to The Importance of Being Earnest.

The linked page in the summary doesn't give any clues. Do we get to make up our own meanings? How about The Infernal Order of Bastard Evildoers? Seriously, who are these herpephilic people?

Re:TIOBE? (2, Informative)

Drooling Iguana (61479) | more than 6 years ago | (#21973170)

This Is One Big Earmuff.

Re:TIOBE? (3, Informative)

Jugalator (259273) | more than 6 years ago | (#21977190)

It is short for The Importance of Being Earnest, and this is also shown on their company profile page.

The name TIOBE stands for "The Importance Of Being Earnest". This is also the name of a comedy play written by Oscar Wilde at the end of the Nineteenth Century. By choosing this name, the founders of TIOBE Software emphasize their sincere and professional attitude towards customers, suppliers and colleagues.

Re:TIOBE? (1)

Deaney (1014409) | more than 6 years ago | (#21978930)

Isn't it that guy from the Power Plant who can't speak English?

Lies, damned lies, and statistics (4, Insightful)

Haeleth (414428) | more than 6 years ago | (#21972970)

It all depends how you count it. For example, here [indeed.com] is a comparison based on available jobs that shows Perl still vastly in the lead, followed by PHP, with Python and Ruby both trailing by a long way. I'm sure there are other figures that prove that PHP is the biggest language, and yet others that show Ruby is growing fastest, etc. etc. etc.

TIOBE's methodology is distinctly suspect, too. Looking at search engine result counts - which are estimates, and in the case of Google are well documented to be inaccurate - is hardly scientific. And they're using YouTube as one of their search engines?! How is that going to produce meaningful figures?

(Yeah, I'm still bitter that ML is so unpopular. But you can't call me a Perl fanboy, because I dislike all "dynamic" programming languages equally, and program largely in C++ and OCaml.)

Re:Lies, damned lies, and statistics (2, Insightful)

DragonWriter (970822) | more than 6 years ago | (#21973318)

TIOBE's methodology is distinctly suspect, too. Looking at search engine result counts - which are estimates, and in the case of Google are well documented to be inaccurate - is hardly scientific. And they're using YouTube as one of their search engines?! How is that going to produce meaningful figures?


Their measuring the popularity of language foo by "Programming foo" hits, with some special case modifications to deal with particular languages where that kind of query would be problematic. Its not at all a reliable metric, but among the quick-and-dirty language-comparison metrics, it doesn't seem to be notably bad (not, again, that its any good, just that whole pack is really bad and this seems no worse than average.)

Using YouTube makes some sense given the kind of measure they are doing, since "Programming foo" screencasts that might be distributed via YouTube are as meaningful as the average "Programming foo" webpage.

(I hate screencasts, personally, but that's a different issue.)

Re:Lies, damned lies, and statistics (4, Interesting)

Dasher42 (514179) | more than 6 years ago | (#21973966)

Not to argue that TIOBE's statistics aren't suspect, but the number of available jobs banging on Perl isn't meaningful to me. I've already had too many jobs where the first order of business is someone pointing me at a directory and saying, "These are your predecessor's Perl scripts. Please figure this out and make things work."

The last time I had free rein in something like that, I did just that, and made a clean rewrite to make a few cleanly commented, consistent Python modules that did the work of all the previous scripts, sans bugs. Just the fact that assignment by reference is the default, that building data structures deeply requires no line noise, makes the program design easy to get right the first time. No "oops, need another dollar sign there". No "how do I refer to a value in a hash of lists of hashes again?" You just do it.

Maybe it's that my sense of programming comes from years of looking at some of the cleaner C and C++ out there, and reading Design Patterns, makes me prefer a language that encourages design and clean coding practices by default. I don't want to deal with one more script from someone who munged strings of data with regular expressions where they should have used data structures or objects. Those of you who are about to clean up piles of Perl code with Perl Medic in hand, I salute you. You're braver than I care to be anymore.

Re:Lies, damned lies, and statistics (1)

chromatic (9471) | more than 6 years ago | (#21975382)

Not to argue that TIOBE's statistics aren't suspect, but the number of available jobs banging on Perl isn't meaningful to me.

That's one component of popularity, however.

Re:Lies, damned lies, and statistics (0)

Anonymous Coward | more than 6 years ago | (#21975690)

A job looking for someone to come in and replace all of their Perl code with Python code is indicative of Perl's popularity?

Re:Lies, damned lies, and statistics (1)

chromatic (9471) | more than 6 years ago | (#21975826)

It would be possible to extrapolate that Python's gaining popularity relative to Perl over time as companies migrate Perl code to Python code, but the job statistics don't show a decline in Perl and corresponding gains in Python.

Per my reading of the job trends, they prove that such a replacement is indeed not happening in significant volume.

Re:Lies, damned lies, and statistics (1)

Just Some Guy (3352) | more than 6 years ago | (#21975504)

Just the fact that assignment by reference is the default, that building data structures deeply requires no line noise, makes the program design easy to get right the first time. No "oops, need another dollar sign there". No "how do I refer to a value in a hash of lists of hashes again?" You just do it.

Yes, yes, yes. That was the exact issue that made me come to love Python. It's not that I can't make complex structures in Perl, but that every time I wanted to do anything non-trivial I had to reach for the camel book. And heaven help you if you wanted to change a function to return a hash of list of hashes instead of a scalar, because then you'd have to change the calling code's semantics for storing the results. Hard? No. Annoyingly pointless? Oh, yeah.

I don't have anything against Perl. I just got tired of doing all the extra work that I had just assumed was a necessary evil until I saw otherwise.

Re:Lies, damned lies, and statistics (2)

mvdwege (243851) | more than 6 years ago | (#21976038)

And heaven help you if you wanted to change a function to return a hash of list of hashes instead of a scalar, because then you'd have to change the calling code's semantics for storing the results.

Being somewhat conversant in both languages, I can't help but wonder how you would go about the same thing in Python. I mean, the difference between a single value and a dictionary of lists of dictionaries is just as big. If your function returns data in a certain format, and you change the format of the return value, you must adjust the calling code's semantics, there is no way around that. Unless you stick the data in a class and only use accessor functions to manipulate it, but that works in Perl just as well as in Python, and you're still stuck changing calling semantics, albeit in one place only this time.

Mart

Re:Lies, damned lies, and statistics (-1, Flamebait)

Anonymous Coward | more than 6 years ago | (#21976216)

Eh, don't bother, he's just another one of these anti-Perl, Python is God fundamentalists. He probably doesn't even know Perl.

Re:Lies, damned lies, and statistics (1)

Just Some Guy (3352) | more than 6 years ago | (#21976478)

He probably doesn't even know Perl.

That must be it [honeypot.net] .

Re:Lies, damned lies, and statistics (2)

Sentry21 (8183) | more than 6 years ago | (#21979730)

Just the fact that assignment by reference is the default, that building data structures deeply requires no line noise, makes the program design easy to get right the first time. No "oops, need another dollar sign there". No "how do I refer to a value in a hash of lists of hashes again?" You just do it.
This is definitely true, though your mention of assignment by reference reminded me of something.

I was experimenting with writing an IRC bot in Python from the ground up, opening up a socket and sending data into it (no frameworks or anything). After a while, I got fed up with killing the bot and restarting it every time I wanted to test new code (and people were getting tired of it quitting and rejoining), so eventually I came up with a solution.

I factored the bot class out into a separate module, and wrote a script that instantiated an object of the class, which then connected to the server, joined channels, etc. Then, I added functionality to the class to take all of its data structures (list of channels, list of users, and even the TCP socket itself) and pack them up into a dict, then return the dict. Finally, I added some code to import a dict and replace the data structures with the content of the dict, and then two or three lines of code to unload and reload the IRC bot module.

The result? I now have an IRC bot written in Python which allows me to modify the code live, without restarting the bot. If I want to add a new function, or add support for another command (one of the myriad numeric commands that, at this point, keeps ending up in my console), I can add it and then simply !rehash in IRC, and the bot reloads its own code, swapping out the old for the new.

Because objects are passed by reference, the socket itself moves from one instance to another, and the bot never has to disconnect. It was a rather ingenious hack, imho, was startlingly simple to implement, and was made possible by the amazing dynamicness of Python.

Woo!

Re:Lies, damned lies, and statistics (0, Flamebait)

mr_mischief (456295) | more than 6 years ago | (#21980726)

"Oh, shit! I put four spaces where I meant a tab!"

At least Perl's line noise is legible. You still have it in Python, but it's invisible. I know which I prefer. You know which you prefer.

We don't need to bash each other's choices, but your language is not objectively superior because you spout anecdotes and personal preferences.

Certainly Interesting (1)

blueZhift (652272) | more than 6 years ago | (#21973300)

This is certainly interesting news. These days when I just need to script something fast, Python is definitely my tool of choice because it works everywhere that I do, and is easier, for me at least, to deal with than Perl. Though I still have a soft spot for Perl because it was the first programming language that actually earned me any money!

Re:Certainly Interesting (0)

Anonymous Coward | more than 6 years ago | (#21980054)

I looked into doing a re-write of my large project in Python about a year ago and decided it wasn't for me. While it's a nice looking language and there are some aspects of it that I like, the lack of community, libraries and other resources -- especially for web projects -- is decidedly limiting.

In perl, I can find a hundred examples of how to do almost anything. I can probably find one or more packages (on CPAN, of course) that do what I need. And there are large established communities and resources to help you over hurdles.

With Python, I found that you were often lucky if there was even *one* library that does what you need. Or that the way to do something was so obfuscated and the community so hidden or non-existent, that it was almost impossible how to figure out how to accomplish your goal. Nice language or not, these things pile up. And so, I remained with perl.

Build management: Switching from gmake to Python (4, Interesting)

Mark Programmer (228585) | more than 6 years ago | (#21973510)

especially beloved by system administrators and build managers.

Absolutely. This year we replaced an old build system written in make with a (vastly superior) Python solution written from scratch. The replacement took one programmer about two weeks. The make system had taken two programmers a disgusting amount of time to build and support. What suprised me most upon completing the changeover was that the Python solution was faster than the gmake solution; since Python compiles to bytecode, re-running the build script was a quicker operation than gmake's re-parsing of the make files.

Python's advantage as build glue is that it is just simple enough to be nearly shell scripting (write a simple wrapper, and you can pretty much just write shell script). But it has the features of a decent high-level language---including, most importantly, integrated documentation and a debugger. Anyone who doesn't understand why one would need a debugger for a build system hasn't yet written a build system complicated enough.

Really though, this is less a statement in support of Python and more a statement against gmake. Make's age really shows as a build language, and if not for all the tools in the GNU world that depend upon / assume the existence of a make engine, I would encourage everyone to just toss the whole thing overboard and create all new build scripts in something else. You have better things to do with your time than reverse engineer code written in a nearly incomprehensible string-parsing language by someone who---in spite of the "standards" that have built up around make over the years---has gone off and done his own thing anyway. If you're going to have to deal with custom build code, you may as well own the challenge completely.

Re:Build management: Switching from gmake to Pytho (1, Informative)

Anonymous Coward | more than 6 years ago | (#21975494)

This year we replaced an old build system written in make with a (vastly superior) Python solution written from scratch.
From scratch? You might want to give scons [scons.org] a try; it's a popular make replacement written and scripted in Python.

Re:Build management: Switching from gmake to Pytho (1)

Mark Programmer (228585) | more than 6 years ago | (#21975624)

We looked into it, and scons is very good. The reason we didn't use it is because, ironically, it's too powerful (and relatedly complicated)---it gives a nifty complexity-for-power tradeoff that we simply decided we didn't want to leverage. Since we already knew exactly what we wanted our make process to do, we found it faster and easier to just write the Python script we wanted than to figure out the "scons way" to do things. Dependency management is a good example: scons offers automatic dependency walking, but we already had explicit dependency lists that we were comfortable updating, and didn't want to take the time to learn enough about the scons dependency walker to trust it.

If we'd been writing a make process on a brand new project, reading up on scons and understanding the structure it places upon your build process would have been a better choice. As it stands, we had a very specific plan, we could see it fairly clearly in "straight-line" python, and the instant scons's requirements got in the way we tossed it overboard and forged ahead.

Re:Build management: Switching from gmake to Pytho (1)

SanityInAnarchy (655584) | more than 6 years ago | (#21977694)

re-running the build script was a quicker operation than gmake's re-parsing of the make files.

Erm, make files? Plural? Well, there's your problem...

I forget where, but there is a paper somewhere on the dangers of recursive make, advocating a single makefile instead (with a few includes). And they have a point.

I'm all for replacing Make, but performance isn't the reason.

Re:Build management: Switching from gmake to Pytho (1)

TheLink (130905) | more than 6 years ago | (#21981126)

How do you manage a single makefile for a project that has a fair number of people doing their own different modules (doing their own submodules etc)?

Some of the modules don't need makefiles either.

Those modules are to be packaged in their own separate packages (RPM or whatever).

In the end it just seemed easier to let people handle their own makefiles (with certain limits) for their stuff, assuming of course if makefiles are necessary.

The last I checked FreeBSD used to use some perl scripts to help build its stuff.

Re:Build management: Switching from gmake to Pytho (2, Interesting)

GrievousMistake (880829) | more than 6 years ago | (#21978228)

Really? One of the problems I've had with Python is how hard it is to use it as a shell scripting language. Namely, the functions for browsing and manipulating the file system are low-level, OO-hostile, quirky, and scattered seemingly almost randomly between os, os.path and shutil. I find them so unwieldy I'll sometimes just cheat and call .bat files from Python to operate on files.
Apparently some people even have it as their CLI of choice, so I may be missing something, but I've been unable to pry out of them what the secret is.

Did you try BitBake? (0)

Anonymous Coward | more than 6 years ago | (#21980710)

Did you consider BitBake? http://developer.berlios.de/projects/bitbake [berlios.de]

It's not as ambitious as SCons.

It's part of the build framework for Open Embedded Linux - http://developer.berlios.de/projects/bitbake/ [berlios.de]

Its metadata repository takes care of keeping track of all the different ways to build things on different hardware.

tools for the task (3, Interesting)

Speare (84249) | more than 6 years ago | (#21973614)

First off, let me say that I love both Perl 5 and Python 2.x and have used each of them on a wide diversity of projects. I've implemented my own OO system on top of each, I've used each for CGI, I've used each for AI, natural language processing, and game programming. Both languages have their idiosyncratic idioms and it's really annoying when you see a lot of C-ish code in either Perl or Python projects. It's also very possible to write ugly "write once" code in either one, don't be misled by the whitespace arguments: ugly code is about how you express (or fail to express) a problem and a solution.

However, I have to say, pick the tool for the job. There are things that are more naturally expressed in Perl idioms than in Python idioms. There are things that are much more clear and direct about Python code for outsiders to read and understand. If I were doing a ton of regex text scanning work, Perl incorporates it into the language directly, whereas it's a bolt-on for most other languages. If I were doing a ton of object management, I like the compactness of Python's syntax over that of Perl's. Both have great extensibility but the available extensions and support can shape your choice for a given project. I wish Python had true equivalents to Perlmonks and CPAN; conversely I wish CPAN modules were more crisp and consistent, attributes I think I find in the community-written Python modules I've used.

Re:tools for the task (1)

renoX (11677) | more than 6 years ago | (#21976744)

> pick the tool for the job.

That's why Ruby is nice, it's as readable as Python but it has regex included (of course if you use overcomplicated regex in your code the readability will suffer, but that's not a language issue).

Re:tools for the task (1)

NewbieProgrammerMan (558327) | more than 6 years ago | (#21979578)

That's why Ruby is nice, it's as readable as Python but it has regex included...

Just curious, are you talking about having to "import re" in Python instead of just having regex support by default, or is there something significant lacking in Python's regex support? (Not trolling, it's just nice to have some additional information about the differences in the languages)

You don't change horses.. (0, Troll)

sw155kn1f3 (600118) | more than 6 years ago | (#21973852)

Perl is de-facto standard and is going to stay this way forever. Python just can't surpass perl shell-like syntax and C-likeness.. Not gonna happen in any time soon.
And we love it this way ;)

Re:You don't change horses.. (0)

Anonymous Coward | more than 6 years ago | (#21974244)

I'm not sure what the point of your post is. Python is a de facto standard, too. Furthermore, it doesn't want to have a shell-like syntax or C-likeness (wait, did you just say Perl is "C-like"? hahahahah). And we love it that way.

Re:You don't change horses.. (2, Funny)

ceoyoyo (59147) | more than 6 years ago | (#21974842)

Every Python programmer who reads that is going to shudder at the thought that Python might even try to surpass perl's shell-like syntax and C-likeness.

Re:You don't change horses.. (1)

risinganger (586395) | more than 6 years ago | (#21975828)

At the time of this reply I see the parent post has been modded funny. I'm not sure why - hell I'd mod this insightful.

Re:You don't change horses.. (1)

ceoyoyo (59147) | more than 6 years ago | (#21975910)

I should have put "including me" on the end. I'm still a little shaky.

Re:You don't change horses.. (2, Funny)

Anonymous Brave Guy (457657) | more than 6 years ago | (#21977138)

What the #!$% are you talking about?!

Re:You don't change horses.. (1)

ceoyoyo (59147) | more than 6 years ago | (#21977442)

Could you be a little more specific about what you don't understand?

Re:You don't change horses.. (1)

Anonymous Brave Guy (457657) | more than 6 years ago | (#21977572)

Sorry. To steal someone else's explanation:

-- Joke --->

     o
    /|\  <-- You
    / \

(The symbols I used in the blanked word are all notorious line noise syntax in Perl.)

Re:You don't change horses.. (1)

ceoyoyo (59147) | more than 6 years ago | (#21977840)

Oh, I was wondering if I missed an, uh, meta joke. Python programmer you see. When I come across line noise I check to make sure everything is plugged in properly and someone didn't turn on the microwave.

Re:You don't change horses.. (1)

Anonymous Brave Guy (457657) | more than 6 years ago | (#21978094)

Aw, shucks. I was all set to post the Python version for you, but tragically it seems someone already beat me to it [slashdot.org] . :-)

Re:You don't change horses.. (1)

macshit (157376) | more than 6 years ago | (#21977832)

What the #!$% are you talking about?!

I guess that's the Perl version. Here's the python version:

What the are you talking about?!

Hope that turns out, whitespace has a tendency to get munged...

Questionable methodology (1)

bn0p (656911) | more than 6 years ago | (#21974100)

TIOBE bases their ratings on the number of search engine queries for "<language> programming' [tiobe.com] . Maybe it's just me but I don't equate an increase in search engine queries regarding programming in python as indicating an increase in the popularity of python.

Put another way, the number of people looking up information on a language X != the number of people programming in language X.


Never let reality temper imagination

Re:Questionable methodology (2, Insightful)

rjames13 (1178191) | more than 6 years ago | (#21977464)

I never put "language programming" into a search engine I find "language library tutorial" is better. Of course that means I am learning "language" and "library". If I'm already programming in a specific language and know where the libraries documentation is then I have it bookmarked.

Just Say No! (2, Interesting)

Endymion (12816) | more than 6 years ago | (#21974102)

Just say no to Bondage and Discipline Languages [catb.org] !

...any language where the author thinks lambda is "too confusing" and should be removed is doomed from the start.

You, Sir, are stupido. (1)

Qbertino (265505) | more than 6 years ago | (#21977136)

That obscure link you posted claims "bondage and discipline" languages to be lacking compared to opposing (and superiour) Languages of Choice. [catb.org] The latter to which the author of this strange theory counts Python. Duh.

I'd say your plan to get all smart-assy on Python backfired big time.

Re:You, Sir, are stupido. (0)

Endymion (12816) | more than 6 years ago | (#21977256)

what, you think I haven't read the jargon file?

Of course python counts as an entry for "languages of choice" as that's how the jargon is used. Evidence: this thread. Many people consider it a choice language, so the jargon fits.

That doesn't mean they are correct, though. Python is all about forcing you into a specific style of programming, and a pretty basic one at that. The fact that the designer thinks many important programming concepts are confusing [artima.com] is hilarious. The fact that he forces others down to his level by limiting how you can program in python is sad, at best.

And I'm not EVEN going to talk about whitespace.

Re:You, Sir, are stupido. (1)

tuffy (10202) | more than 6 years ago | (#21978344)

Except that he isn't limiting how you can program in Python. lambdas are still in Python 3 [python.org] if you really want to use them. But for most applications of lambda in Python, list comprehensions are superior. They're not only easier to read, but also provide better performance.

Considering the vast gulf of language flexibility between Python and actual "bondage and discipline" languages such as Pascal or OCaml, the notion it should be counted among them is difficult to take seriously.

double stupido (1)

Verte (1053342) | more than 6 years ago | (#21978408)

What are you talking about? A handful of idiomatic lambda uses have largely been replaced, sure, but lambda is still pretty common in Python code.

Reasons to love PYTHON! (1)

zukinux (1094199) | more than 6 years ago | (#21974398)

It's very easy scripting language

OOP - Python is, if you want to use it this way, Object Oriented!

It uses lots of POSIX standards, so if you ever did an OPEN call in-order to get fd, you have it here as-well :)

Indents, makes the coder must use indents, which makes the code easier to read.

Easy use in web-applications.

Easy to use and learn, build classes for later use, and come with every popular Linux distribution today.

Cross-platform, yeah, not all the functions, but most of them, which is good enough. Too bad that in Windows you have to install interpreter.

I can think of hundreds of reasons why to use python, just learn it already :) I'm quite sure that in the next OS by MS or the one afterwards, they will release it with Python interpreter by default.

Re:Reasons to love PYTHON! (1)

Kymermosst (33885) | more than 6 years ago | (#21974944)

Indents, makes the coder must use indents, which makes the code easier to read.

Not necessarily. Especially if the application used to view the code is not the same one that the code was written on.

List of annoyances I have with regarding Python and white space:
  • You can't just send somebody some Python code in a medium that isn't whitespace-safe.
  • Indentation preferences vary among programmers, are arbitrary, and some people feel strongly about 4-space, 2 space, tabs, etc. Python uses this as a syntax element and forces everyone working on a particular file to share the same indentation scheme or risk breaking the code. In free-form languages, one guy who forgets to change his 4-space tab into actual spaces isn't going to break things.
  • You can't use brace-matching.

Re:Reasons to love PYTHON! (1)

jonaheffect (1020435) | more than 6 years ago | (#21975732)

At least they require conformity to convention, and you don't get some script that the guy decided to make creative use of his whitespace. I think it really is more a feature (not to say all flaws are features)

Re:Reasons to love PYTHON! (2, Insightful)

vrmlguy (120854) | more than 6 years ago | (#21975792)

Indentation preferences vary among programmers, are arbitrary, and some people feel strongly about 4-space, 2 space, tabs, etc. Python uses this as a syntax element and forces everyone working on a particular file to share the same indentation scheme or risk breaking the code.
Some of use view this as a good thing. ;-)

Personally, I hate tabs. Every editor I use seems to have the tab-stops set differently, and looking at 4-space tab code in an 8-space tab editor is not my idea of fun.

Re:Reasons to love PYTHON! (2, Insightful)

SanityInAnarchy (655584) | more than 6 years ago | (#21977734)

You can't just send somebody some Python code in a medium that isn't whitespace-safe.

What medium?

Indentation preferences vary among programmers, are arbitrary, and some people feel strongly about 4-space, 2 space, tabs, etc. Python uses this as a syntax element and forces everyone working on a particular file to share the same indentation scheme or risk breaking the code. In free-form languages, one guy who forgets to change his 4-space tab into actual spaces isn't going to break things.

That's actually a feature -- it forces everyone to agree on a standard there, and use it.

If, for example, one guy uses tabs and one guy uses spaces, and the tab guy has his tabstop set to 2 or 4, while the spaces guy has left it at 8... well, stuff is going to look weird. Forcing everyone to the same convention is something you should be doing anyway, and I'd rather it happen automatically (by breaking stuff).

Re:Reasons to love PYTHON! (1)

Kymermosst (33885) | more than 6 years ago | (#21978180)

What medium?

This one, for instance, when you use the HTML formatted option.

Here's some code for you, from here [www.amk.ca] :

(Yes, I used slashdot's ecode tag, which fails to preserve the leading spaces even though it is for inserting code snippets)

#!/usr/local/bin/python

import string, sys

# If no arguments were given, print a helpful message
if len(sys.argv)==1:
print 'Usage: celsius temp1 temp2 ...'
sys.exit(0)

# Loop over the arguments
for i in sys.argv[1:]:
try:
fahrenheit=float(string.atoi(i))
except string.atoi_error:
print repr(i), "not a numeric value"
else:
celsius=(fahrenheit-32)*5.0/9.0
print '%i\260F = %i\260C' % (int(fahrenheit), int(celsius+.5))

I am aware that the plain old text option mostly works nowadays, but there are sometimes problems with that as well. A few months ago, it was totally broken as well in this regard.

Countless other forums out there have issues with preserving code formatting, not to mention some web-based chat systems where you might want to paste a code snippet.

If, for example, one guy uses tabs and one guy uses spaces, and the tab guy has his tabstop set to 2 or 4, while the spaces guy has left it at 8... well, stuff is going to look weird. Forcing everyone to the same convention is something you should be doing anyway, and I'd rather it happen automatically (by breaking stuff).

In languages that use delimiters as block and line markers, you can run a code beautifier to standardize the code, and even fix code that is horribly malformatted. If the white space gets screwed up really bad in a python program (line endings are deleted somehow), it will it not only fail to run, it will require a human to go in and unscrew it.

Re:Reasons to love PYTHON! (1)

Verte (1053342) | more than 6 years ago | (#21978626)

You can't just send somebody some Python code in a medium that isn't whitespace-safe.
True. I can only think of one example, HTML, and you can always programmatically insert non-breaking spaces in that case. You can do this efficiently in four lines of Python code, or a couple more in elisp when copying to the clipboard.

Indentation preferences vary among programmers, are arbitrary, and some people feel strongly about 4-space, 2 space, tabs, etc. Python uses this as a syntax element and forces everyone working on a particular file to share the same indentation scheme or risk breaking the code. In free-form languages, one guy who forgets to change his 4-space tab into actual spaces isn't going to break things.
That's why we have coding standards. The Python world settled upon 4-space indents a long time ago. If you're going to fly in the face of coding standards, expect to have to implement yet another four liner when you want to actually work with anyone.

You can't use brace-matching.
You aren't quite clear what you mean on this. If you mean you have no visual indication where a code block ends, you're a retard. Indentation is far easier to vgrep than braces. If you mean you have to think differently to write Python code programmatically, well yes, you do. Thankfully, there are simple libraries that do most of the work for you.

Re:Reasons to love PYTHON! (1)

Sentry21 (8183) | more than 6 years ago | (#21979988)

True. I can only think of one example, HTML, and you can always programmatically insert non-breaking spaces in that case. You can do this efficiently in four lines of Python code, or a couple more in elisp when copying to the clipboard.
Or wrap it in <pre>...</pre> tags

Why choose? (1)

bgibby9 (614547) | more than 6 years ago | (#21977244)

Every language has something to offer, something that it does better than others. The point is, choose your language based upon what the problem you are faced rather than the "popularity" of that language. Besides, Perl will never die, it will only sit and collect the programmers who jump from every other language q:)

Re:Why choose? (1)

mr_mischief (456295) | more than 6 years ago | (#21980776)

I disagree. Show me one thing RGP/400 does better than another language. ;-)

Re:Why choose? (1)

mr_mischief (456295) | more than 6 years ago | (#21980796)

Damn fat fingers. I meant RPG/400. Or COBOL for that matter.

What are the chances? (0, Troll)

uniquename72 (1169497) | more than 6 years ago | (#21977700)

First 2007 was the Year of the Linux Desktop, and now THIS??

What a great year!
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?