share
Stack OverflowAre there any good reasons why I should not use Python?
[+112] [41] coppro
[2008-12-16 17:10:15]
[ python ]
[ http://stackoverflow.com/questions/371966/are-there-any-good-reasons-why-i-should-not-use-python ] [DELETED]

I've heard from reliable sources [1] that Python is a great language that every programmer can learn, but I've heard so much good about it that I'm clearly not getting the whole picture. I'm considering spending more time to learn it, and I've heard more than I need about its virtues (to the point where I've started recommending it having never really used it), so I want to know its drawbacks, flaws, issues, and every single minor point of irritation you've ever had (preferably with explanations readable to one who doesn't program Python, such as with an example in another language).

Convince me not to try it out.

www6.uniovi.es/python/doc/Comparisons.html perlmonks.org/?node_id=156333 Straight comparisons are usually better than subjective evaluations of "suck". - dreftymac
Edited the title to remove the argumentative slant. - Robert S.
I agree that this is a subjective question, but it is not argumentative. The questioner asks for others to share their frustrations with python, no matter how small. - David Locke
Also, answers to your question will likely be downvoted. - Robert S.
@David: In it's original form it definitely was. - GEOCHET
@Out in space: Edited the title to actually accomplish what you were going for. - GEOCHET
[+96] [2009-01-10 17:08:13] mike g [ACCEPTED]

The problem is that it is not as good as it is made out to be, in other words it suffers from a degree of hype. I'll try to argue this point.

Potential detractors of the language usually lack the experience to criticize it authoratively. This is more true for python as it is not (yet) common that people are coerced (by work,school) into learning and working with the language. So the detractors are few and drowned out by the vocal supporters.

The top answer cites 'indentation' and then says but its not an issue for him, this is a strawman argument 'this is the worst problem and its not really a problem'. Indentation is a matter of taste and is more noticeable than bad. This answer has been voted up presumably by people who like the language, because it certainly does not answer the question, which is give a good reason not to use the language.

Python is open source, and community driven from the beginning, attributes which give it support amongst people such as vocal blogger-developers (not necessarily the people who get the most done) who are credible proponents. Compare to java or C# whose main proponents have a commercial interest and as such have such devalued words that they can't credibly make any positive assertions about their products, and being commercial there are any number of detractors.

People often say google use it a lot, the 'language of google', so it must be good. Now I suspect google use it a lot, but probably mainly for scripting and web programming. Remembering that

  • as a replacement for shell scripting (truely awful for significant development) python is infinitely better
  • web development and even the frameworks are not that complex

My experience is that dynamic languages are less maintainable, and not very good for 'systems' programming and dealing with complexity. The evidence is in the lack of sophisticated and successful programs. For example eclipse and its brethren. I am not convinced that it is feasible to create as sophisticated a framework in a dynamic language (if so, which ones?). Here checkable interfaces are an indispensable part of a self documenting, yet organically grown module structure.

Another example might be games. I think performance is an issue, but its also maintainability.

So the main issue for me is the dynamic typing, cited as a feature, but in reality just a really easy way to implement a language (I maintain a JS interpreter). Its definitely good for scripting, but if you could have type inference you would.

static typing is meta information, its like html vs. plain text, and when you've used a decent specialist IDE (eclipse, netbeans, vs.net - not emacs which is general) you will appreciate this, as you will be able to navigate your code, see compile errors immediately. Combined these are a massive productivity gain, albeit with an extra learning curve, that is completely unavailble in python.

I am far from an expert at python, but I have done a couple of semi-serious projects in the language and will try to recall specifically what I didn't like, aside from the general to all popular dynamic scripting languages weakness, the of lacking any static typing (not necessarily mutually exclusive with duck typing).

  • save on typing library naming mentality, I personally think the fully qualified (com.sun.xxx) package names are a good thing, as they contain a lot of information. Spending time typing them is not an issue for most java/c# developers. This makes it harder to know the provenance of code, and causes name space clashes
  • installation mentality, python has inherited the idea that libraries should be installed, so it infact is designed to work inside unix package management, which basically contains a fair amount of baggage (library version issues) and reduced portability. Of course it must be possible to package libraries with your application, but its not conventional.
  • quite quirky e.g. __init__
  • doesn't perform all that well
  • no switch (why not??)
  • poor utf support
  • no outstanding feature (that I know of). closures and duck typing (all objects are hashes) are just dynamic language bread and butter.

Lack of static typing results in

  • reduced maintainability, different developers will find it harder to work with each others code -> reduced productivity as projects scale*
  • less informative api documentation/autodocs
  • much less powerful ide support

*I feel these assertions are confirmed by looking at what complex projects are out there.

At the end of the day I wouldn't consider it for more significant/complex projects, however by all means learn it, but you may be disappointed if you have exagerated expectations of how good python is.


(4) There's plenty of complex projects in Common Lisp, a dynamically typed language. Obviously, if you look at mainstream products you'll see that they're mostly mainstream. - David Thornley
init might sound quirky but it's actually much more "pure" than "specialized" constructors: it's just a function. - gatoatigrado
(10) This answer really nails it for me, having worked with several languages on large projects, including Python). It's a great language for whipping up small apps, but I concur that it quickly becomes less productive for more complex/large apps for all the reasons mentioned above (I find Ruby has similar issues too). My least favorite Python quirk has to be the way division is implemented... - Rob
(2) I love python but it was a please for me to give this its 25th upvote because it is a GREAT answer. - theycallmemorty
+1 A great response, well thought out and delivered. Despite the fact I love Python. - Tom Leys
(11) python package management doesn't have anything to do with or depend upon unix package managers (e.g. dpkg or rpm). Python's package management tools, like easy_install and virtualenv work in windows or *nix. And, using viritualenv, for example, it's quite possible "to package libraries with your application" and it's also a very conventional practice in the python world. I'd agree about the "installation mentality", but given that it's quite possible to avoid portability and library version problems with existing python package management tools, can you explain why that's bad? - mazelife
(21) re: the age-old static v. dynamic debate, I think we should quantify what we mean when we say "large", "or "complex" projects. I've worked on python projects that were several hundred thousand LOC. The equivalent Java version would probably have been 1.5x bigger. Do you only get to "complex" when you pass 1 mill LOC? Anyway, I'd recommend a blog post by Steve Yegge: steve-yegge.blogspot.com/2008/06/rhinos-and-tigers.html scroll down to the "Static Typing's Paper Tigers" section and give it a read. He makes some good points. - mazelife
(2) Miss switch? Use a dict with callable values. - detly
@mazelife - dependencies: I probably ought to defer to your experience in these matters, but I do have experience and strong opinions on dependency management in general. Possibility of a decent environment (i.e sanely handle all dependency eventualities) was never disputed, but I am still not convinced the situation is great. Python suffers from it's lack of backwards compatability and this complicates matters. easy_install and virtualenv are both python programs which install themselves (the mentality again) in the shared environment. - mike g
Personally I feel they should both have bitten the bullet and delivered themselves as complete programs (including the python runtime) instead. Then they could even manage the installed python versions (possibly in concert with the underlying packaging system). - mike g
@mazelife - static vs dynamic: I took an outsider view on what is achievable by looking at what has been achieved (taking into account access to resources/community size), which you left unaddressed. Size is a poor metric, really the question is the nature of the program. In a project of the size you describe, a pure Java approach would usually be a mistake. Breaking the program up into a core part in Java + one or more DSLs (for repeated patterns) would be a better comparison (and closer to what is actually done when tools are used correctly). - mike g
If there are no repeated patterns and it is all system code (which I doubt) then I'd maintain that you'd be better of with more lines of Java. In any case lines of Java are not generally 100% typed out (autocomplete,wizards ... etc.) and most of the extra ones take up space but not brainpower. No I don't think java is perfect (lack of convenient multiple dispatch, no attempt at type inference ...), but to my mind it shares better. - mike g
@delty: Yes, but some syntax to hide this would be nice. - mike g
And of course they are not directly comparable. A default case would be the most often missed feature and sometimes falling through is useful. All possible of course, but creating variables to do control flow is not quite right. - mike g
For a default case you can use dict.get(key, defaultfunc)(). Personally I don't miss the syntax, despite using it a fair bit when writing C. I think I just switch (heh) to "Python mode" and don't even notice the differences, if you know what I mean. - detly
(3) Point 1: Fully qualified names are supported in Python just not used much because of the decentralized nature of library develpment in Python. Point 2: Installation is as simple as getting pip and typing sudo pip <packagename> package info can be found on PYPI and it's pretty easy to submit your own projects to PYPI. Package revisions are simple, when you submit a new version the index uses that as the default. Python maintains all installed versions of a library. Point 3: init for the constructor is different but no more quirky than the alternatives. - Evan Plaice
(12) Point 4: According to what. I don't see a benchmark. Python is a 'glue' language, that's why it's so easy to call c or c++ code using it. Point 5: You can accomplish the same with a Dictionary. Point 6: Python3k is all UTF all the time. Python actually has some of the best UTF encoding support of all the languages. Most languages just ignore UTF and use ASCII. Point 7: What about slices, tuples, and multiple return values? Point 8: Reduced maintainability is pure BS, python is one of the, if not, the easiest language to read. Point 9: Docs are a weak point. Point 10: I agree fully - Evan Plaice
(2) A switch is only useful in low level languages where it acts as a data structure (because it's too much work to write the structure in that language), say for a finite state machine. In Python, we make a dict for this. I'd have to agree with fully qualified package names though. - Longpoke
@EvanPlaice, I think mike meant there is nothing in Python that you can't find in another language with essentially the same support. Slices, tuples, and multiple return values you can get in many other languages, either approximately or exactly. For example, Perl supports multiple return values and slices, and can emulate tuples (though I've never felt the need). Unlike Python, Perl has an outstanding feature, namely, regular expression support. I am not arguing that Perl is better than Python nor am I attacking Python; I'm just clarifying what I think mike was trying to say. - David Mertens
@DavidMertens No biggie, I'm just pointing out that most of these points are false or there are sensible workarounds that devs proficient in python are familiar with. Comparing an agile dynamic language to one of the monolithic statically typed beasts (ex C#) is a straw man that's easy to shoot down because their implementations can't be compared on a 1-1 basis. It's like trying to compare an imperative language to a functional language. - Evan Plaice
(cont) What I'd really like to see is an answer from somebody who is much more familiar with python who could assess it's weaknesses without having to measure it against a different paradigm. For instance: desktop GUI support sucks; security on module/property accessors is weak (ie static private public); there's no built-in (read non C-based) preprocessor; language development/uptake is slow, py3k has been around for a few years now but don't expect full support from the community for another 5 years; UTF quirks have been fixed but only in py3k; etc... - Evan Plaice
The author of this post hasn't had much experience with Python. Some points are just thinking Java and writing python. - Kugel
As someone who's writing a traffic simulator in Python... I strongly believe it just isn't suited for low-level applications. At first things went beautifully, but due to the project's growing complexity (mental/mathematical complexity, nothing to do with LOC), it's become a nightmare to make relatively simple changes. Duck-typing is NOT appropriate for the job. For example: "Is this parameter a generator or a list? Oh, sometimes it is, sometimes it isn't! Looks like I'll have to type-check or wrap it in a list regardless... only took 20 minutes to find the issue!" Etc. - Philip
1
[+56] [2008-12-16 18:52:25] Rafał Dowgird

The main implementation uses a GIL (global interpreter lock), which means that you cannot fully utilize your CPUs with Python threads, because threads serialize on object access.

This is a feature of the implementation, not the language, so you can get around that by using Jython, IronPython or maybe some other implementation (something PyPy based maybe?).

Also, support for process-based parallel processing is getting better and better in Python, so the GIL issue gets somewhat less important.


(11) I believe you can use the multiprocessing module which in turn uses subprocessing to utilize different CPUs. (correct me if I'm wrong) - fengshaun
(2) You are right. That's what I meant by support for process-based processing getting better. - Rafał Dowgird
2
[+38] [2008-12-16 17:17:23] MarkR

Python does not require variables to be declared in the scope they're in. Or indeed, anywhere. Therefore, it can't check this at compile-time.

This is bad - even Perl (with "use strict") or VB (with "Option Explicit") do this.

This means that the compiler cannot even detect a trivial typo- it will produce a working program anyway which will continue working until it reaches the typo - THEN go boom. It would be a lot nicer to require variables to be declared, then the compiler could detect this and complain upfront.

Worse still, in some circumstances, failing to define a variable in a given scope (for instance, because it was defined with a typo) causes it to be picked up out of a higher scope - even if this wasn't what the programmer intended - again because variables don't need to be declared.

If this is confusing to you, note that I have used the terms "delcare" and "define" as accurately as possible.


This is what unit tests are for. Plus comparing Python to VB without Option Explicit simply isn't fair. There are a lot of type safety features that python adds above VB. - Jason Baker
I actually quite like Python, I think it's a great language. VB is not. However, this is one of the few things I don't like about Python. I mostly use Perl, and in most respects, that's much less nice. - MarkR
(7) In practice, I have never once found that a bug was caused because something couldn't be type checked statically. The duck typing paradigm works exceptionally well, IMHO. Then again, I often find myself coding in the interactive shell and then pasting working tested code into my main program. - Dan
(10) I found something like PyFlakes, PyChecker, or PyLint will help you find your typos. - projecktzero
Using variables without having to "declare" them before usage is one of the things I would think most people find nice with Python. If you can't figure out where your variable is coming from then you are probably writing to large blocks of code or isn't naming your variables in a good way. - kigurai
(8) ++ The biggest problems I've had with python have all related to the typing. The worst is building a data structure with lists or dictionaries: a simple typo and your program explodes. A defined structure would be a lot safer. You can do this with classes, but with more work than C would require. - Harvey
typo fyi: delcare - secondbanana
Personally, I've found that unit testing ensures that the vast majority of typing issues aren't an issue. You do maintain unit tests for your code, right? Side note from there, I do agree that this is something of a problem as well as an advantage, and it increases the burden on the programmers to explicitly document everything. This may or may not be a good thing. That said, with the numerous productivity advantages that come with such a high level of flexibility, I feel that having a few tradeoffs -- such as being unable to know type at compile time -- are worth it. - Laereom
3
[+37] [2008-12-16 17:13:20] Egil

One anti-python school of thought is that forcing style such as indentation is wrong. However, as I cannot convince myself, I guess I would fail at convincing you.


(33) I've heard plenty of arguments about how wrong it is. I personally really like it because, for once, at least everyones indentation styles match. I count it as a positive feature personally. - Dan
Yes. You don't need a company policy for coding style when you code python, you just go ahead and code :) - Egil
And use spaces, not tabs. /me ducks. - Christopher Mahan
@Chirstopher: Why spaces over tabs? Just curious because I see that option on every editor. Why would you want to do that? - Luis Soeiro
(2) @Luis - The Python Style Guide highly recommends spaces over tabs. Mostly a push to coding by convention. But whatever you do, just don't mix spaces and tabs. - jonyamo
(2) Well if there's a reason not to code in python I think this is the worst one. "Me: Hey boys we are going to develop in python!, Them: No no, please we hate the indentation" ... That won't happen. - OscarRyz
I find the indentation a virtue, as it helps to highlight logical blocks, and forces good style. It usually doesn't get in the way as long as you don't mix tabs with spaces. An editor will mitigate this to 0 though. - Josh Smeaton
@Chirstopher: I used to prefer tabs since its a single character over 4 (anything other than 4 spaces per tab is just weird, hah), but then I switched to using better editors and now generally use spaces (or rather, the editor converts my tabs to spaces). - Dan
(3) @Luis: I'm personally a big fan of hard tabs, in theory. In practice, no one seems to get it right, so the best option is to stick with PEP-8. - Jeremy Cantrell
When I first started using python, the indentation thing made me cringe, because I thought it would cause me all sorts of problems. Honestly, I can't recall ever having a problem with it. - Jeremy Cantrell
@Jeremy: the one problem it can cause is when you go to paste a chunk of one function somewhere else. The meaning of the pasted chunk can change depending on how indented it is. With a curly-brace language, you just paste and say "reformat". Not a huge deal, but something. - Baxissimo
This is a big one for me. Every time standard support for braces is proposed it's mocked, and I don't find it funny in the slightest. Many times I've missed it. When I'm using a terminal and I can't install my editor, when working with others code, when using 3rd-party code analyzing tools... - nachik
Also, see this: stackoverflow.com/questions/118643/… If I was blind, I would find the jokes even less amusing. There are parsers already in the code. Include the option for Kthulu's sake. - nachik
from my experience with reading others' python code, I should say that indentation syntax (although odd at first) is great! - fengshaun
of all reasons to not use python, this is the absolute worst. - Dustin Getz
I love indenting code, and I don't usually mind that the indentation is syntactically significant, but a couple of times I have been bitten when rewriting loops or conditionals and forgetting to indent or dedent a statement to bring it into or out of the block. I guess with experience I have learned to watch for this. - Andrej Panjkov
@Baxissimo you shouldn't be coping and pasting code. Especially without caring what it does. How ridiculous is this argument? - Kugel
@Kugel There is nothing wrong with copying/pasting code as long as you know what it does. I for one find the indentation requirement horrible. Implied ending of constructs is just a bad idea, and leads to confusion in many situations, which is why most languages don't do it. - user441521
4
[+30] [2008-12-16 18:11:26] Jason Baker

Another point to make: Python is a difficult language to write good editors for. There are just too many backdoors and roundabout ways to do things to make features like Intellisense or syntax error highlighting. There are some tools that do make reasonably good attempts at this stuff, but it's definitely not what you're going to be used to if you use a language like Java or C#.


+1 and this also extends to debugging - Robert Gould
(4) And like other reasonable scripting languages, somehow it doesn't really seem to matter much. Which continues to surprise me. - Mike Woodhouse
(1) +1, but I think this is something that will improve a lot in the future. There's a lot of interesting research going on in this area. - Kiv
(5) intellisense is silly, and i think no reason to limit language flexibility. the code should be hit anyway unless you're coding standard is to distribute untested functionality. - gatoatigrado
This is one of the reasons it took me a while to start learning python. - Ziv
5
[+30] [2009-04-24 17:45:11] mike

It has a lot of WTFs:

print x   # does one thing
print x,  # does another

x = "hello everybody"
s = x.split(" ")  # does what you would expect
y = s.join(" ")   # does NOT do what you would expect

import re
x = "The sky is red"
r = re.compile("red")
x.sub(r, "blue")  # oops, that causes an error
r.sub(x, "blue")  # there, that should do it
print x           # prints "The sky is red" -- what!?
y = r.sub(x, "blue")  # maybe that will do it
print y               # nope, now it just prints "blue"

referrer = "http://foobar.com"
if override():
    referer = "overridden"
print "Referrer: " + referrer
# Do you see the bug?
# There was a typo in a variable name.
# No warning. No error.
# Because you can't enforce variable predeclaration.

(4) Most of the WTFs of print are fixed int Python 3.x - lutz
Really? Which ones? - mike
(10) As for - x = "hello everybody" wtf, x is a string, so we have x.split(), drawing an analogy, I would expect a string to have a join() member function, so a " ".join(s) would make sense. Since join() and split() seem to go together, why should one of them reside in string and the other in a list, not so much of a WTF. - Abhishek Mishra
(8) Interactive programming using the python console will quickly teach you what to expect from python, including all your examples. To try all this in the console will take you less time than setting up a project in many other languages. - Tom Leys
(7) I like this concept of WTFs. I think anyone getting started with a new language should look at those lists for a big head start! - Plynx
(5) well if you care to do re.sub('red', 'blue', 'The sky is red') there will be no WTF. I understand you may not remember order of params but can you tell me with straight face you expect "import re" to add method sub to str (x.sub attempt) or that you expect r.sub(x, "blue") to be destructive (print x)? I agree re join - logically should have been list.join(str) but i guess both split and join were considered utility string functions and hence shoehorned to fit - Nas Banov
@mike: Can you not be so enigmatic? print x and print x, do the same thing in a test case I made. Please document the discrepencies clearly. Also y = s.join(" ") # does NOT do what you would expect... yes, this is very informative. I just get a runtime error: join is not defined. Wow! What a real WTF... not. - Thomas Eding
(1) Fixed in Python 3 (2 & 3) Weak WTFs. Just read the manual instead of guessing arguments and behavior! (4) This is the only real concern. Python is not very high up on the WTF list in my book. What is really alarming is when you've coded something for years and the language never ceases to give you WTFs (cough PHP). Relevant. - Gustav Larsson
@Plynx: Agree, every noob should be instructed to RTFWTF's :) - Basel Shishani
6
[+29] [2008-12-16 18:03:19] S.Lott

Python can be called slow.

By slow, I mean slower than C and slower than Java with a JiT run-time.

On balance, this rarely matters.


If you really really need performance (scientific apps, games, whatever) you could try implementing performance critical code in pyrex or cython - or as a C module, I guess. Then again, if performance is more important than development time, perhaps a different language is a better fit after all. - Dan
(5) @Dan: Since 10% of the code is usually 90% of the run-time, a small bit of performance-critical code is all you ever need. If rewriting critical sections with Pyrex or Cython doesn't do it, you have the wrong algorithm in the first place. - S.Lott
(5) @Dan: Games? Please inform the Eve Online people that Python could be too slow for their large multiplayer online game. - S.Lott
@Slott - there are software problems where the 90/10 rule doesn't matter. For example, many realtime systems need deterministic behavior. - Tom
(1) @Tom: When I worked in real-time software, I was well aware of the difference between deterministic, flexible and fast. Some things needed one, some things needed another. And, the 90/10 rule applied even in radar software. - S.Lott
@Tom, Slott - this is also the case for computation intensive applications. While it is possible to write low level functions in C and call them from Python (e.g. NumPy) this sometimes makes the code unnatural -- see for example Matlab code that usually must be vectorized for performance. - nimrodm
(2) In many cases, Python provides primitives like list comprehensions and the NumPy nimrodm mentioned that can largely negate the most common cases of performance bottlenecks. - TokenMacGuy
(5) Good algorithm design generally helps more than essential language speed. Nonetheless -- the only sensible complaint about Python is "it can be called slow". - S.Lott
7
[+14] [2008-12-16 17:25:15] David Locke

My biggest irritation with Python is the lack of an enum type. I know there are ways to emulate the functionality but I haven't found one that suits my sense of style.


While not perfect, set or frozenset types can be a worthwhile alternative to enum. - Lara Dougan
(6) actually I found that you don't really need enums, there's almost a pythonic way to solve things that you would use enums for in C. - hasen j
(6) Use dictionaries. Enums are nothing but OOP code smell limited/hackish implementation of a dictionary set. - Evan Plaice
8
[+13] [2010-06-08 11:42:14] Evan Plaice

Python isn't the best option for proprietary applications/libraries.


Python third-party library licensing is very liberal and overly complex

Most of the libraries not included in the core fall under open source licenses. Licenses like MIT or, as I like to call them, 'truly free' licenses allow you to create derived works without limitation as long as you maintain attrubution; GNU GPL, or other 'copyleft' licenses don't allow derived works without inheriting the same license (viral licensing). To inherit the benefits of an open source culture you also inherit the complexities of the licensing cluster%&*#

Python's OOP structure isn't strict enough

The notion of private/internal/public isn't nearly as well defined in python as it is in the statically typed languages (C#/Java). In statically typed languages, when linking between libraries/classes the rules for such interactions are very strict, mostly for security purposes. There may be some very important instances where a business wouldn't want anybody to see the internal implementation of their modules and having such strict control over levels of access are necessary.

Python GUIs suck

Not to say that there aren't any good options. wxWidgets and Glade are great options. You just won't find the same level of ease in GUI development that you'd find in Visual Studio or Eclipse. When it comes to GUI development a drag-and-drop idiot-proof IDE can be an essential requirement. The reason you probably don't see a lot of massive python apps with GUIs is, it's easier to create front-ends in other languages.

The Python language itself is in a transition

Sure, there are thousands of awesome libraries. I'd be willing to bet that Python will eventually replace PHP for server-side scripting and it's already taking steps in that direction (see WSGI, Pylons, PyHP, Django, mod_python, etc...) but the core is in a transition period. The core development team has put tons of time and effort to revise the language as a whole and eliminate a lot of the long-standing WTFs of the language itself. Right now there's Py2x (making up most of the written libraries in the wild) and Py3x representing the new version of the language with all of the great new fixes. Most serious library developers have conservative estimates that the language itself won't make a full transition to py3x for years. Mostly because 2x works really well as is and all of the the third-party libraries already support it. If you're expecting to use a lot of third-party libraries learn 2x first, OTOH if you're just getting your feet wet start with 3x.

Developing in Python on Windows can be a pain

If you've never used linux, concepts like the PYPI package repository probably don't make much sense. What does that mean? In linux lets say you wanted to download the wxPython library for GUI development, you'd just go to the package manager search for wxpython, select the package and hit install. In windows, you could check the PYPI (Python Package Index) but there's no guarantee that there will be an .exe installer included in the project. Getting a handle on acquiring third-party modules can be a little confusing at first but that's the open source nature of Python. I submitted a module called pypreprocessor to the PYPI a week ago (after taking a few hours to figure out how package submission works) and it's already nearing 100 downloads on PYPI alone. Hopefully, the up-and-coming release of distuils2 will make it even easier to submit/acquire packages.

Rant: Open Source projects generally don't care about Windows, most open source developers work in linux because Windows sucks to develop on. Any platform that requires an antivirus application to periodically break your mode of concentration to nag about updates is unacceptible.

Other notes about migrating from another language

If you have never used python, first make sure tabs are converted to spaces (4 spaces) in your editor. Tabs are bad because they aren't standard across text editors; meaning, if you open a source module in another editor it might break your code.

There are a lot of options for everything. This is a positive and a negative. Too much choice can be daunting and multiple implementations of similar libraries mean that the development effort isn't concentrated in one place. In such an environment documentation and/or stability can be lacking; it's pretty common among open source development. Of course, if you don't like the implementation you're using, there'll usually be a viable alternative.

Some code features of Python may seem like voodoo. Once you understand some of the core features like slices you'll wonder how you ever lived without them but they can look strange at first. It's amazing how much can be done in python with very little code but it takes a little time to adjust.

Collections like lists, tuples (immutable lists), and dictionaries are used everywhere in python code. Without the limitations of strong typing, lists inherently become really flexible and versatile tools. It might take a little time to adjust to the style.

There is no single 'mega library' like C#/Java. While Python touts it's 'batteries included' philosophy, it'll still take a little time to figure out what libraries to import for certain specific situations.

There are multiple ways to import modules:

  • import module - to access the members of module all of the calls need to be prefixed with module's name (ex. module.example_method).
  • from module import * - this imports all of the imported module's members into the current module. This would make it so you could call 'example_method' directly without the 'module.' prefix. This practice is looked down upon though because of the obvious name collision implications and difficulty to track errors.
  • import module as somethingelse - this essentially renames the module. to call the 'example_method' call 'somethingelse.example_method'

It's generally best to use the standard import unless you have a compelling reason to use one of the other imports. Performance considerations of imports are generally negligent because python actively caches everything that's imported.


Personally I love coding in python. It isn't perfect but it's damn good. After coding in C# for a year and a half, the style of python was like a breath of fresh air. It is really a fun language to code in. It's ironic that, even though python has a slightly unique syntax, the biggest issues with the language itself are mostly political/social. I guess I'm supposed to convince you not to try it. Hopefully my suggestions will be enough to scare you away. Otherwise, you might become a raging, monkey patching, duck punching, python evangelist like the rest of us.


Wow - I've never heard of PYPI - I'm guessing it's no CPAN. Then again, I roll with a package manager, so I don't really care. (Which, I suppose, is your point). - new123456
@new123456 The package manager is great for really common libs like Beautiful Soup but useless for smaller obscure modules. PYPI has 0 barrier of entry because there is no MOTU to dictate updates. I don't know why you say it's no CPAN. The only reason CPAN is so huge is due to the fact that there are a million different ways to do the same thing in perl. Python is a lot more succinct as a language. 10k+ modules and growing is enough for me. - Evan Plaice
Sorry for the confusion about, it was mere speculation. I was hinting only that CPAN is a more well known entity than the PYPI. I can't say anything on the user experience, as I've never written Perl (stop hitting me! I'm not a JAPH!) ;) - new123456
9
[+12] [2008-12-16 17:16:03] Jimmy

sometimes I get lost trying to figure out where variables are coming from, because you don't have to declare them. I guess experienced Pythonistas don't have the habit of scanning a function's variable definitions to determine what's going on.


(13) If the block of code is short enough, there's no mystery. If it's so long that there's confusion. Well, that says it's too complex and needs to be broken up into pieces you can read and understand. - S.Lott
global for global scope. outside of all blocks for module scope. prefixed with 'self' for class scope and inside whatever method/function for local scope. It doesn't hurt to initialize them with a value, even if just for clarity. Really, it's not that hard. - Evan Plaice
10
[+8] [2008-12-16 18:13:49] Greg Hewgill

I have some points in the answer to Five things you hate about your favorite language [1]. There are a couple of others who have posted five of their own things about Python, too.

My favourite point is the one about accidentally permanently changing the default arguments to a function at runtime.

[1] http://stackoverflow.com/questions/282329/what-are-five-things-you-hate-about-your-favorite-language#282366

link is full of brokenness - Tshepang
11
[+7] [2008-12-16 17:22:13] Jason Baker

I suppose the biggest (realistic) argument is python's dynamic typing, which can cause some needless errors if you're not careful. Of course this can be helped by good unit testing, but no matter what you do, there's always the possibility of typing errors that you wouldn't run into in a more statically typed language (Java/C#).

NOTE

One thing I see people saying is that you don't have to declare variables in Python. This is true in the strictest sense. You have to think differently about declarations though. For example, take the following code in a C like language:

int x = 0;

Think about it this way: why do you need the int keyword and the semicolon? Can't that be inferred? So just change the above to this:

x = 0

And use that format whenever you would declare a variable.


Good comments. The risk with implicit declaration is if you ever misspell the variable's name while giving it a new value (or perhaps even when accessing its value, depending on how the language handles this case), you will end up with an extra variable and incorrect behavior. - Neil Whitaker
As I stated elsewhere, in practice I have never ever been in a situation where static typing would have saved me from mistakes. I do however agree with your point on type inference - ideally, a language should be statically typed by default BUT it should still not require me to declare my ... - Dan
... variables and should infer their types. This way I get the best of both worlds. Of course, this feature should be over-ridable too. OCaml does this pretty well. - Dan
Static typing and variable declarations are orthogonal - Perl under 'use strict' requires variables to be declared, but they are still dynamically-typed. - Dave Sherohman
(4) ...And, in practice, I have never encountered a case where not declaring variables has provided any advantage other than allowing the programmer to be lazier. - Dave Sherohman
I don't think it's fair to state a negative of python as being 'dynamically typed'. Dynamic and Static typing is a different argument altogether and not Python specific. - Josh Smeaton
12
[+5] [2008-12-16 20:10:04] Robert Rossney

There are lots of good reasons not to use Python, but they're all dependent on what you intend to use it for. The complaints about whitespace (oh, please) or duck typing or broken IntelliSense are (maybe) problems with the language, but they don't rise to the level of reasons not to use it.

Here are some actual circumstances in which you wouldn't want to use Python:

  • You're writing code for a piece of hardware that has only 64K of memory.
  • Your code has to manipulate very large matrices of integer values as fast as possible.
  • You're writing a web application that has to process extremely large numbers of hits, and your hosting provider doesn't support WSGI.

Those are, for the most part, not reasons not to use Python: they're reasons not to use the entire class of interpreted scripting languages that Python belongs to.


In case you only have 64K.. philhassey.com/blog/2008/01/31/tinypy-64k-bootstrapped Courtesy of having a large, very large community - everything is possible. :)) - utku_karatas
(1) Shouldn't scipy handle large integer matrices just fine? - akaihola
(1) not only scipy, but pycuda and cython's new buffer notation. - gatoatigrado
The third point only really applies if your hosting provider doesn't allow long-running-process. YOu can hand;e lots of traffic with a Python async server, in any of it's many incarnations (Twisted, Tornado, gevent, etc. etc.) - Kevin Horn
13
[+5] [2009-03-20 14:53:45] pi.

Sure. It will spoil you so hard that you will have a very miserable time if you have to go back to your previous language, be it Java or C# or something else. So don't do it! I warned you!


yea, it spoils really bad! - fengshaun
(1) You are my hero. - shylent
14
[+4] [2008-12-16 20:40:32] Juan
  1. Lack of static checking requires that section of code to be hit to find out there is a problem. Essentially this forces you to write unit tests.

For example, this code will run up until the dog() function is called:

def dog ():
  falkdfjlkdfj

print "Hello World\n"
dog()

2. Use of duck typing can lead to surprises to how variables are treated


As a further to this you can redefine the function later without any warning, a pain if you are making use of code split across multiple files - DrHazzard
"Lack of static checking and Use duck typing"? I suppose both are 'features' of dynamic-typed language with all teh consequences. This answer is better for question like: Why I should not use dynamic-typed language - mhd
15
[+4] [2008-12-17 08:22:44] e-satis

You must not use Python when (assuming Python is not your main language) :

  • You are in a rush and the languages you know will do the job.

  • You are looking for speed and have not time to create C extensions.

  • You want obfuscation.

  • Your code will be reused by people that you know, will not use Python and don't know it.

  • Quality is a main issue, therefor the language you master the best will be the best shot.

  • You know you will use features that have a better implementation in other language (I am looking at the FTP lib here...).

Anyway, Python pays my bill and am really happy about it.


Thanks for IMHO, the first real answer to the OP's question :) - elo80ka
16
[+4] [2009-01-10 18:45:30] Hermit

I'm only going to list negative things here, as that's what the OP asked for. Of course there are also many great things about Python :-)

  • Can't pass parameters by reference (The canonical example, you can't write a method that swaps the values of 2 parameters. You have to return a tuple instead).

  • Python 3 breaks backward compatibility

  • You can easily, accidentally, over-write system variables with anything else.

For example, type:

time.sleep = 4

instead of:

time.sleep(4)

and you just destroyed the system-wide sleep function with a trivial typo. Now consider accidentally assigning some method to time.sleep, and you won't even get a runtime error- just very hard to trace behavior. And sleep is only one example, it's just as easy to override ANYTHING.

  • Lacking support for interfaces, method requirements defined in terms of ambiguous "X-like-object". This is getting better with Python 3, but the new ideas in Python 3 will take a long time to catch on.

  • If you define 2 classes\methods with the same name at the same scope, the latter silently hides the former. This can lead to insane new classes of bugs. Speaking from experience here :-)

  • Explicit "self" is an annoyance.

  • Every object is automatically convertible to Boolean, and it is idiomatic to use this feature often, such as doing if(L), where L is actually a list and you're asking if it has items. Doing this in a low-level language like C is one thing, doing it in Python is... confusing. Is L a boolean? a list? a number? Why not just ask if L "has_items"?


@Roy: with great power comes greater responsibility :) - elo80ka
actually I found overwriting names to be quite powerful and sometimes useful. And well, of course, you have to be responsible for what you do. - fengshaun
same; once you use it you'll appreciate it :) - gatoatigrado
@elo80ka-"with great power comes greater responsibility" is my favorite quote about this topic. In programming, "responsibility" grows exponentially in regards to "power". The conclusion is that you should try to limit power to the minimal, so you have less things to worry about, and to minimize risks. That's why you don't login as "root" for everyday work, but as a LESS POWERFUL user, and that's why overriding a system method should not have the same syntax as trivial variable assignment. - Hermit
(1) Global overwriting has some wonderful benefits as well... like in testing where time.time = some_fake_time_function is very helpful. - Gregg Lind
17
[+3] [2008-12-16 17:17:09] tunnuz

Usually a language isn't good or bad by itself. The point is, is it the language to get your job done? If the answer is "maybe", spend some time trying it, and you'll discover.


mmhh that's a good comment, but not an answer. - OscarRyz
lol you are silly - theman_on_vista
18
[+3] [2008-12-17 12:36:08] J S

Multithreading in Python is a big problem, due to GIL (global interpreter lock).


19
[+3] [2012-08-02 19:14:48] addison

The only problems I have with python is that strings are immutable so running this would throw an error:

a = 'A string'
a[0] = 'B'

And because there are no semicolons it's sensitive to indention so your code will act strange if you don't indent it properly. Other than that I love it!


20
[+2] [2008-12-16 17:21:13] Dylan White

Many subscribe to the school of thought that good language design means concise ways of describing the language. For example, Java is a language about Objects. Everything is either an Object or a blueprint for making an Object. In Scheme, everything is an expression which can be evaluated or passed to another function. In Python however, there are many different paradigms at work. To some, it seems to be a mish-mash of useful features thrown together with no unifying concept.


21
[+1] [2008-12-16 17:18:59] Edouard A.

You cannot be absolute when considering a language. Python isn't bad or good, it's just better or worse than other languages in some areas.

The Python community is big and active and the language is actively supported. You won't waste your time playing with it, especially because the time invested will not be lost when you learn to another.

I would maybe suggest to have a look at Ruby to see if you don't prefer Ruby over Python.


22
[+1] [2008-12-17 03:42:18] Norman Ramsey

Python's a nice language. I can think of only a few weak reasons not to try it:

  • Maybe you really, really hate objects?

  • Perhaps you will be one of those people who hates significant whitespace (I love significant whitespace).

  • It is a big system (language and libraries), so you will never master it completely.

  • Maybe you prefer to wait for Python 3.0 to become widespread before learning it?

As noted, these are all weak reasons :-)


Python does not have significant whitespace. s/whitespace/indentation/g - Jeremy Cantrell
If you hate objects, you don't have to use them. Just write your code without objects! - fengshaun
23
[0] [2008-12-16 18:13:38] Steve B.

Python is popular and relatively easy to learn. Language comparisons can tend to get religious fairly quickly, but there's a few points worth making:

It's a dynamic language, and generally considered to be a scripting language [1]. This means that it's less verbose than something like java.

It has functional constructs. Python was actually how I first became familiar with these concepts (lambdas, map & reduce functionality, etc, etc). If you've never worked functionally that's a nice way to transition easily into a different paradigm.

Duck typing.

A downside I've found is that the dynamic nature of the language makes it harder to build in the large, harder to keep track of larger-scale projects. Then again, maybe I haven't worked with it enough.

Partly because of these reasons, idiomatically written python tends to be simpler than typed/compiled languages, which can be a refreshing viewpoint, especially if you're coming from anything attached to the word "enterprise". As others have noted on this page, many of these same benefits are true of Ruby, which is also quite nice, and IMHO occupies the same language "niche".

[1] http://en.wikipedia.org/wiki/Scripting_language

24
[0] [2008-12-16 20:33:52] QueueHammer

The best reason I can see someone not wanting to use python would be to demonstrate that they are Luddites.


Definitely. Ruby users = luddites. - Ellery Newcomer
So... when the next new language comes along tomorrow, will you jump on that bandwagon, too, or will you be a Luddite and stick with Python? - Dave Sherohman
@Ellery + Dave: In all fairness, "not wanting to use Python," "wanting to use Ruby," and "preferring Ruby over Python" are three different states that don't necessarily overlap. - J.T. Hurley
25
[0] [2008-12-17 01:49:41] dtc

I've seen one mention of this, but the thing that turned me off of Python is the part where indentation and white space matters.

I just could not get past the fact that your code (aside from white space) could be correct but just because of some small white space issue it does not work. Maybe if I stuck with it more it would be a non-issue but I know when learning it it drove me crazy and I ended up giving up.

At some point I opened my file in a different editor and something happened and I ended up having to re-indent everything. That was the point where I realized I'm not going to do that anymore.

I like indenting code but I don't like my code not working just because of white space.

Someone mentioned Ruby. I see Python and Ruby compared a lot. Because I didn't do so well with Python I tried Ruby and I like it. For me Ruby feels a lot more natural and somehow calm.


Agreed. I just can't bring myself to trust a language with syntactically-significant whitespace. - Dave Sherohman
yeah, whitespace is a big issue for many, but once you get used to it, it's a non-issue. I can't remember the last time I had an unexpected indent exception. - monkut
A good editor can help immensely. IDLE, among others, offers a set of keyboard shortcuts that indent and dedent code in blocks, which can help with "wrapping your head around" the system. - J.T. Hurley
(1) Uhm, I have never had problems with indentation. It's the most fundamental part of the syntax, so how can it be hard to remember and do right? The interpreter also gets inyour face every time you do it wrong, so you should have no problem learning it really quick. - kigurai
(1) You're code broke when switching editors because you used tabs instead of spaces. Tabs are not standardised. They are interpreted differently between editors/OS's. If recommendations were followed, you probably wouldn't of had that problem - Josh Smeaton
(4) Guys.. Python does NOT care about whitespace. It does, however, enforce indentation. - Jeremy Cantrell
I guess if I stuck with it longer I would have gotten used to it. But still it's a reason I ended up not using Python. And yes, using Tabs was my problem. I've always been used to using tabs. I should probably use spaces... - dtc
26
[0] [2009-03-02 14:27:23] RossFabricant

I love Python but some things bug me after doing mostly C# development:

1)

try: 
    prase(getUserInput())
except: 
    print 'You entered an invalid number.'

Oops, my typo has become a runtime error, and I've hidden it with the try/except block. That wouldn't be a huge problem if my IDE caught this for me, but...

2) There's decent IDE support, but nothing I like nearly as much as Visual Studio with Resharper.

3) Generators feel like a half-assed version of LINQ.

4) Passing self everywhere makes writing objects feel like a hack.

5) When I go back to C# I forget to put parentheses around my conditionals.

Python is a beautiful language, and it's worth learning despite it's flaws.


(7) You should never EVER use naked except! - fengshaun
Same, and dynamic name resolution can be quite powerful! use it :) - gatoatigrado
27
[0] [2009-03-31 19:27:16] gatoatigrado

I think the only reason not to learn any language is if you know something similar, or you don't have enough time. In the free software world, I don't think there's anything quite like python (in that it has such a nice standard library, readability, extremely simple grammar -- esp. with 3.0, expressiveness, etc.).

While I don't advocate looking for reasons not to learn it, here are my bad experiences:

  • Python MT support is not as good as it should be.
    I tried to write a simple multi-threaded image loader, and found that I occasionally got fatal errors "GC object already tracked" as well as problems during interpreter shutdown, where the main thread would exit and modules would go as well even if other threads were using them. There's also the GIL, as others mentioned.

    Even if the language is still very useful, these issues (sans GIL, that's just annoyance, and Cython has a nogil construct) just makes the language not seem mature, which is a major issue of faith for me. Imagine Java not implementing the synchronized keyword correctly.
  • Garbage collection doesn't handle circular references.
    I want objects to be deleted when the main thread's locals() and globals() lose reference to the object. Occasionally this needs to happen at a certain point for correctness, not just efficiency (pycuda API calls for me). I would like [at least a per-class option] to have exceptions thrown on circular references [which don't use weakrefs] than have memory leaks and correctness issues.
  • Local and global scopes are unintuitive.
    Having variables leak after a for-loop can definitely be confusing. Make sure to name variables well! List constructs in Py3k operate within their own scopes. Worse, binding of loop indices can be very confusing; e.g. "for a in list: result.append(lambda: fcn(a))" probably won't do what you think it would.
  • It's not incredibly slow, but it doesn't have the latest-greatest optimizations in cPython (the default interpreter), like some of the dynamic optimization in the latest web browsers for Javascript. Learning Cython and C extensions takes time.
  • Imports are nice in that they're dynamic, but also haphazard
    Circular imports take some time to get right. I don't think practical code should be forced to be hierarchical: breaking things out into modules should be encouraged as much as possible.

28
[0] [2009-08-27 11:56:16] krawyoti

Aside from the fact that like all languauges, Pyhon as gotchas as quirks that could be easily defined as something that does not behave as it does in xxx, where xxx is some other language the write is familiar with, Python does have a few painful points, mostly related to the libraries than to the language itself. In my experience they are:

  1. Deployement: There are four, five different third-party libraries that should help you with that, and each of them sucks in different ways. Unless your deployment is limited to workstations with the right version of python with the right version of all the needed libraries already installed, packaging your application in a self-contained distributable will eat up as much time as the rest of the development did.

  2. GUI toolkits: many options, none of which is fantastic: Tkinter (part of the standard library, gets the job done, but it's ugly to look at and to work with), pygtk (which is fine if you're targeting X11 platforms, but becomes painful for everything else), pyqt (peculiar licensing arrangements, and the clear feeling that you're writing C++ without the braces), WxWidgets (Well, I gave up after a couple of crashes).

  3. Memory consumption: technically, you cannot speak of memory leak, but the effect can be similar: it's not the system that leaks memory, it's you the programmer that forget variables that still have a reference, because that stack frame is still in use even if the variable is not. Typically, somewhere in a callback you still have a reference to a dict with a reference to some other variable that you forgot about and that cannot be garbage collected and you end up with hundreds of megabytes per process. Also, CPU profiling is decent, RAM profiling is halfway between impossible and non-existent.


29
[0] [2009-09-17 15:20:02] cwallenpoole

I've just started using Python and I have to say that my overall impression is a good one: Python does a lot of things which make sense.

That said, there are some things which need to be said:

  • Forced spacing should be considered a non-issue. If you are formatting your code correctly to begin with, you will be doing this anyway, and it will also ensure a uniformity to code structure
  • The lack of switch is irrelevant because elif can accomplish the same effects.

As to the real cons:

  • There is no way to type *any* variables. This includes function parameters. To me, this is a big issue because you are in a constant state of uncertainty about the nature of what is coming into the function.
  • There are no truly private variables.
  • There is not a lot real documentation on the most recent version of Python. Nor does it appear that there is any quick adoption of Python 3. This would not be an issue if Python 3 were backwards compatible, but it isn't.
  • There isn't a true multi-line comment syntax save creation of multi-line str's
  • Static variables are present on instances of a function. EG:
    class Foo:
        myStaticVar = 7;

    f = Foo();
    print( f.myStaticVar ); # prints 7

I really wish that people had to give comments about down-votes. I stand by everything I've said and feel that it is all worth saying. - cwallenpoole
30
[0] [2012-04-03 23:25:56] cosimo193

Look at slices; in python the statement:

X = y[2:4]

Assigns a 2 element sequence to x containing the values of x[2] and x[3]. Now someone compare that against other languages that support slices, e.g. Ada, Occam etc, and explain to me how that could possibly make sense. Programming is generally a logic-related task; those semantics are completely illogical.


31
[0] [2012-09-06 17:39:04] user922475

Concurrency is 'appended' on like most traditional languages instead of built into the language design. As a result there is little to no in-built support for determinancy like the Ada language has.

Immature support for compilation of native code 'executables'.

Python doesn't natively support backtracking [1] (not many traditional languages do) which is the basis of the logic programming paradigm. Also it cannot manipulate it's abstract syntax tree like Lisp can with it's macros.

Defining low level data types like a c-struct is a mess compared to say C. Also doesn't support inline assembly coding.

Python is revolutionary in it's own way but it can't do everything. There are many reasons to use Python but also there are reasons to not use it. It's not perfect like everyone likes to claim it to be but it's a step in that direction.

Due to it's inherent imperfections it may in time turn out to be just another trend language as better languages are developed.

[1] http://en.wikipedia.org/wiki/Backtracking

32
[-1] [2008-12-17 07:29:11] McD

Good: The language is named after Monty Python

Bad: All the doc's are riddled with snakes (cute snakes)

Good: Stable with very large memory apps

Bad: Somewhat funky for web apps (see Zope)

Good: a lot of libraries to extend the capabilities

Bad: no solid IDE (do you love text editing? vim or emacs? so does python)

Good: Used by very large software houses (Google, etc)

Bad: Not common in the business world

TIP: Pick a basic programming assignment close to your target application and see how far you get towards a working app in 60 minutes using the web for docs. Was it good for you?


How can it be not common in business world? - jpartogi
33
[-1] [2008-12-17 14:43:33] Mike Woodhouse

The colons. Honestly. If the next line is indented from the current one, why do I need to use a colon as well? Drives me nuts.

To steal an example from another answer:

def dog ():
  falkdfjlkdfj

It's obvious (and necessary) from the indentation/white-space that the second line is part of the dog function.

Trivial, I know, but it really bothers me.

Oh, and I don't like the need to pass "self" as the first argument to a method within a class, but I understand that part's going to disappear in 3.0?


you're allowed to put things like "if" statements on the same line. how would you do this without the colon? - Jeremy Cantrell
I'd do it without the colon... ;-) - Mike Woodhouse
(1) The need to pass self is a good thing (that's not going away any time soon). Here are the BDFL's arguments: neopythonic.blogspot.com/2008/10/…. - Jason Baker
But what you have to keep in mind is that Python isn't C++, C#, or Java. The ability to bind methods to different classes makes it so that you can't have an implicit self like you do in other languages. - Jason Baker
Explicit self is necessary in Python, as the article explains. But being necessary does not make it a good thing. - Hermit
jeremy: it's possible the colon could be used for this case but not the two-line case. I think [a better argument is] the colon is minimal excess (compared to braces) and prevents ambiguity when continuing lines with open brackets / braces / parens / foreslahes. - gatoatigrado
34
[-1] [2009-02-09 08:55:40] acidzombie24
  • If you make a typo your app will run to the place of the typo then crash (some IDEs will catch this thankfully)
  • Threads are not good ATM
  • Missing features people may call essential (switch and enums are essential for me)
  • Very hard to debug. Maybe its my IDE but i havent found a good solution. This current IDE breaks in the main .py file but not in others

I'll have more reasons when i have more experience.


What is your IDE? - Tshepang
35
[-1] [2009-08-27 11:11:54] Andz

If you are a programmer charging by the hour, you SHOULD NOT use Python, because it ensures you won't be able to charge your customer much.

When using Python I almost always find myself finishing a project earlier than expected, which is the exact opposite of when I use other languages where I ALWAYS take more time than expected.


36
[-2] [2009-01-10 18:00:16] Joe Philllips

Python is not backwards compatible with previous version. This means the person running the scripts must have the correct version installed. If you have the latest version, you may need to uninstall it and install an older version for some scripts to work. It's quite silly.


All versions of Python 2.x are backwards compatible with previous versions. It's Python 3.0 where the compatibility breaks. - Jorenko
37
[-2] [2009-01-11 23:15:22] too much php

As a long-time PHP user, I did notice the following issues when I started using Python:

  • Because everything goes into one namespace (functions, classes, global variables, local variables, even imported modules), you can accidentally replace a class or function with anything else really easily. In my first month I created some variables named 'min' and 'max' not realizing I was replacing the builtin min() and max() functions.

  • It's alot harder to make a string from local variables. You have to use the printf() notation which is usually not easier but sometimes quite longer to write.


@Peter: one global namespace? Not true - packages, modules, classes and functions all define their own namespaces. See network-theory.co.uk/docs/pytut/PythonScopesandNameSpaces.html for more info. - elo80ka
(2) If you don't know about min() and max() means you won't use it anyway. - fengshaun
What I meant was, in PHP functions, classes and variables cannot possibly overwrite each other because they are stored in different tables and accessed in different ways, and once they are defined they are immutable. - too much php
in re. second comment, are you referring to docs.python.org/library/stdtypes.html#string-formatting? If you're looking for templating there's Jinja 2 and Cheetah. - gatoatigrado
as far as overriding builtins, it might help to use an editor with syntax highlighting. I like kate, but of course everyone has their favorite. Python is widespread enough you should be able to find one. cheers, Nicholas - gatoatigrado
Yes, the '%' operator is not as simple to use as PHP's. - too much php
38
[-2] [2009-04-04 21:58:00] fivetwentysix

Cons

  1. Not as fast as C/C++, Java, or even PHP.
  2. Everything you write will be open source.
  3. No great IDE's. I'm using KATE to write Python.
  4. Somewhat annoying portability if you use non-standard modules.

Pros

  1. Very easy to write applications
  2. You don't have to worry about compiling.
  3. You can make great use of IDLE to test drive your solutions.
  4. Your applications will be very stable without any effort!

How can Python be slower than Java or even PHP? Where did you get that bencmark from? - jpartogi
@jpartogi The highly technical and accurate 'Texas Profiler.' Take a male cow (preferably a large one for better accuracy) insert large amounts of hay, and eventually you'll have a fantastic pile of steaming results. - Evan Plaice
39
[-6] [2008-12-17 06:54:23] Yogi Yang 007

unless you are thinking of using libs that are found only in Python. I would advise against using learning it.

Better go for Delphi as the language to learn. You will be instantly productive and you will get true RAD IDE which is yet non existent in the Python World!


downmodded for total irrelevance. - Josh Smeaton
40
[-10] [2008-12-16 17:21:08] Marko Kocić

Far from it that it actualy suck, but I'm not using it for the following reason.

To me, it looks too sterile . I just don't like it.


I guess you like languages that look like a explosion in an ASCII factory? =) - projecktzero
It does have that Hobbits/The Dutch sensibility going for it, doesn't it. :) (I keep the library reference on a thumbdrive so I can wear it on a chain around my neck.) - J.T. Hurley
Hey, we Dutch don't have hairy feet! - Ruben Steins
41