TIOBE Declares Python the Programming Language of 2007 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."
Great, lets all program python in 2007! (Score:2, Funny)
Re: (Score:2, Funny)
Maybe we will see more Web (Score:2)
Re:Maybe we will see more Web (Score:5, Informative)
Re: (Score:3, Interesting)
Re:Maybe we will see more Web (Score:5, Interesting)
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 (Score:4, Interesting)
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 (Score:5, Informative)
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: (Score:2)
We run almost everything in Django -- website, management, and patient records (secured, don't worry, and kept relatively anonymous... no SSN, etc).
Re: (Score:2)
Re:Maybe we will see more Web (Score:4, Funny)
--
Simon
Your flying! How? (Score:5, Funny)
Python @ xkcd [xkcd.com]
and
Python @ Bash.org [bash.org]
HHSSSHSHSSS
Acceptance Speech (Score:4, Funny)
Re: (Score:2)
Re: (Score:2)
Yeah, Cleopatra is more Python's style.
But what would be Perl suicide? Let yourself be trampled by camels?
MartRe: (Score:3, Funny)
But what would be Perl suicide? Let yourself be trampled by camels?
<obligatory> There's more than one way to do it! </obligatory>
Re: (Score:2)
Re: (Score:2)
Tried python (Score:2)
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 (Score:5, Interesting)
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: (Score:3)
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 develo
Re: (Score:2)
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.
Re: (Score:2)
Yes and no. I must admit having to look it up [wikipedia.org], as it has been a while I looked at twisted. Twisted provides a framework for networked applications, be them client-side or server-side. They have their own Web-oriented framework called TwistedWeb, which can be used to w
TIOBE? (Score:4, Funny)
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: (Score:3, Informative)
Re:TIOBE? (Score:4, Informative)
Lies, damned lies, and statistics (Score:5, Insightful)
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: (Score:3, Insightful)
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
Re:Lies, damned lies, and statistics (Score:5, Interesting)
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: (Score:2)
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 ju
Re: (Score:3)
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 retur
Re: (Score:2)
That must be it [honeypot.net].
Re: (Score:3)
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 wro
Re: (Score:2)
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.
Kudos for a slick hack! But here's how I might approach that:
Create a class called "Settings" or similar. Change your bot class's __init__ method to accept a Settings object, like "def __init__(self, settings)". Then, change your code to refer to self.settings directly, such as replacing "self.socket" with "self.settings.socket". Once you do that, you can get rid of all the code that deals with saving and restore state, since all state will already be bundled into one convenient object.
Re: (Score:2)
Its a clever hack, but there is nothing really specific to Python about it. Lots of languages would let you do that: indeed, that's one of the things that I've seen raved about regarding the use of Lisp in, e.g., the space program. Certainly, Lisp/Scheme, Ruby, and P
Re: (Score:2)
Sounds good, then someone can come in a few months/years from now and re-write in NBL [blogspot.com] because it's getting 100x as much data and now takes 3 weeks to process the data, using 500GB of RAM. Or because it's dumping pages of backtrace for a: missing file / an int() that should be a str() / misspelle
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
The problem with the whitespace isn't that it's enforced as a coding standard. It's that it changes the meaning of the code. You could use brackets, parentheses, some other punctuation, or keywords to denote blocks and still enforce indentation in the parser. Then you'd be able to say Python enforces good style but a program
Re: (Score:2)
That could happen, but it wouldn't happen for any lack of making my code clearly readable, maintainable, and extendable by others [filefront.com]. It comes down to good practice, and some languages accommodate it better than others. You can do anything in Perl that you can in Python. However, your cost in time and tedium will definitely be higher in most cases
Re: (Score:3, Interesting)
http://www.langpop.com/ [langpop.com]
Hopefully, I'll have trend data up there soon as well.
Certainly Interesting (Score:2)
Build management: Switching from gmake to Python (Score:5, Interesting)
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: (Score:2)
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: (Score:2)
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 it
Re: (Score:2)
I'm not advocating makefiles, just saying that the complaint of performance, in particular, isn't relevant.
(Oh, and you can always have different files -- include files and such. But including them is fundamentally different than a recursive make.)
Re: (Score:2, Interesting)
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 t
Re:Build management: Switching from gmake to Pytho (Score:2)
Re: (Score:2)
tools for the task (Score:4, Interesting)
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: (Score:2)
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: (Score:2)
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)
Re: (Score:2)
The need to import a library isn't a big deal, but Ruby's core support isn't just support functions "included by default", its also a simple literal syntax available and perl-style magic variables related to regexs. Now, I'm not too fond of the m
Re: (Score:2)
Just curious - in what way is the Cheeseshop not equivalent to CPAN? Not as many Python eggs as CPAN modules, of course, but otherwise I easy_install as easily as I ppm. Or maybe you mean something else?
Questionable methodology (Score:2)
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: (Score:2, Insightful)
Just Say No! (Score:3, Interesting)
...any language where the author thinks lambda is "too confusing" and should be removed is doomed from the start.
You, Sir, are stupido. (Score:2)
I'd say your plan to get all smart-assy on Python backfired big time.
Re: (Score:2)
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 (Score:2)
MMO written in Python. (Score:2)
First time I realized that was about 3 days after installing the game and seeing all kinds of familiar extensions in cache and library directories. Fun stuff
Re: (Score:3, Funny)
Mamama!!!! Make the bad man go away, please.
Re:Hmmm (Score:4, Interesting)
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: (Score:3, Insightful)
Re:Hmmm (Score:4, Insightful)
Re:Hmmm (Score:5, Informative)
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:
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 /. (Score:4, Insightful)
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: (Score:2)
I'd be satisfied if they just worked to improve the damn language.
no_i_really_mean_it_mysql_really_escape_strings()
Re: (Score:3, Informative)
Re: (Score:2)
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
Re: (Score:3)
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...
Re: (Score:2)
A few of the reasons:
Re: (Score:2)
TFA said:
Young Indiana Jones said:
Re:Hmmm (Score:5, Funny)
Man, you take this stuff seriously. Changing your name is hardcore.
Re: (Score:2, Insightful)
Re:Bout Time (Score:5, Funny)
Re: (Score:3, Funny)
Re: (Score:3, Funny)
What the #!$% are you talking about?!
Re: (Score:2)
Re: (Score:2)
-- Joke --->
o
/ \
(The symbols I used in the blanked word are all notorious line noise syntax in Perl.)
Re: (Score:2)
Re: (Score:2)
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: (Score:2)
I guess that's the Perl version. Here's the python version:
Hope that turns out, whitespace has a tendency to get munged...
Re: (Score:2)
Re: (Score:2)
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:
Re: (Score:3, Insightful)
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: (Score:3, Insightful)
What medium?
That's actually a
Re: (Score:2)
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)
Re: (Score:3, Informative)
It's worth mentioning that, at least in IRC, this [pastebin.com] is the preferred medium. It should work elsewhere, too, and there are scripts to assist in it.
Your point is valid, but I don't believe I should constrain the format of a language because it won't work in some mediums. Should I not include []-bracketed arrays because bbcode might hate them?
Re: (Score:2)
The bad think about having brackets as syntax and whitespace as just formatting is that it is redundant, and you can produce things that look wrong but are wrong but look right if you don't h
Re: (Score:2)
Perhaps. But we're really not discussing redundancy in a programming language, we are talking about redundant information in source code. There certainly is the point of view that any redundancy in source code is a "design flaw" (the theory that advocates that code should speak for itself and comments should not be used, as well as the theory beyond Python's whitespace handling, is an example of that.)
Re: (Score:2)
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
Re: (Score:2)
Re: (Score:2)
For any machine-assisted use in general (yes, indentation is easy to use with a human brain, that's why almost everyone does it even in languages that don't enforc
Re: (Score:2)
Re: (Score:2)
I'm suspicious that you like it because it allows you to quickly check whether your indentation matches your braces That's why *I* like it, at least. Except when I'm writing Python, of course. ;-)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)