Why Python Sucks
Say, I want to know the semantics of a built-in function. In Perl, I type in perldoc -f <function-name>.
In Python, I have to go searching on the web, and the best thing I can come up with is a third-party HOWTO, which amounts to a tutorial on how the function works, rather than a quick, fifteen-second reference on calling semantics.
Dang.
Responses
renbing
just type help(something) can work.
keep document string with everything you wrote, and
you can use help(something) all the time
Danny Howard
<SmooveB> danny, your “why python sucks” entry is wrong.
<SmooveB> you can type pydoc function
<SmooveB> or pydoc lib.function
<dman> dbt: Yes.
<SmooveB> in fact, pydoc is better than perldoc
<Ark> of course it is!
<dman> dbt: But the documentation sucks in comparison to perldoc.
<Ark> its python!
<Ark> python is like europe
<Ark> everything is better!
<SmooveB> because you don’t have to know perldoc -f for built in functions.
<SmooveB> Ark: wank wank knee jerk wank wank :)
* dman jerks off.
<SmooveB> dman: what are you talking about?
<Ark> hey, if I’m gonna constnatly give Matt shit about not liking stuff
because said stuff is popular
<Ark> I’m just gonna constantly bang on python
<Ark> and your mother
<M> SAY NUC-U-LAR!!! SAY IT, BITCH…OHH!! OHH!! YESSSSS!!!!1
<Ark> cuz really, what else do I have to do all day but be Eliza-like in my
mocking?
<dman> I was frustrated I think becauise I wanted to do something with a
linked list or something. It was long ago … anyway, Perl
documentation is very good, and you can usually pull up great stuff on
the command line. I was finding that Python equivalents were terse
little things of a few lines at most leaving much to ambiguity.
<dman> Like, what is a Python function related to list or array management?
<Ark> I am pissed at the lack of documentation in Roma v0.3
<Ark> s/Roma/Rome/
<Ark> damn sun code
* dman shrugs.
<SmooveB> dman: pydoc list
<dman> Today we are checking backlinks for funness. :)
<SmooveB> builtin types have named types that you can look up docs for. :)
<Ark> I think I shall go to Borders
<dman> | pop(…)
<dman> | L.pop([index]) -> item — remove and return item at index
(default last)
<dman> 2-10:13 djh@ratchet ~> perldoc -f pop
<dman> =item pop ARRAY
<dman> =item pop
<dman> Pops and returns the last value of the array, shortening the array by
<dman> one element. Has an effect similar to
<dman> $ARRAY[$#ARRAY--]
<dman> If there are no elements in the array, returns the undefined value
<dman> (although this may happen at other times as well). If ARRAY is
<dman> omitted, pops the C<@ARGV> array in the main program, and the C<@_>
<dman> array in subroutines, just like C<shift>.
<dman> (for purely arbitrary example)
<SmooveB> ok, the extra documentation is mostly centered around perl’s
terminally weird syntax and stupid implicit argument behavior.
<dman> Uh huh.
<dman> What happens if you pop a non-existent index?
<dman> What happens if you pop an empty array?
<dman> We do not know unless we try.
<dman> What exception will be thrown?
<dman> What is a similar way of going about the same thing?
<Ark> I really would like to learn the python
<Ark> I should just say “okay, instead of doing this in <foo> i’ll do this in
python”
<Ark> next project
<Ark> next scripting project, that is
<dman> The online Perl documentation has proved more accessible for me than
the python equivalent.
<dman> Dave, Keith, may I blog this? :)
<Ark> what’s that?
<SmooveB> “blog this”
<Ark> Writer w = response.getWriter();
<Ark> SyndFeedOutput output = new SyndFeedOutput();
<Ark> output.output(feed, w);
<Ark> hooray for dumb looking sample code!
<dman> See last comment at
http://dannyman.toldme.com/2003/02/19/why-python-sucks/
<dman> HAHAHAHAHA I AM LAME
dbt
yes, danny, yes you are.
free-zombie
lol. This is top-on-google for “python sucks”. And this is lame. Proof that python rocks, right ?
TiCL
Perl >> Python, and the only reason is CPAN and the vast amount of documentation and examples it provides.
Ben
If Python doesn’t suck, then why do 50% of the Python programs I try to run (on several Linux distros, FreeBSD and Mac OS X) die with a stack trace?
LKRaider
@Ben:
please, name three.
thedonvaughn
so is this site about big pythons? I love pythons. They are big. They are pythons. My python ate my mother’s perls. The python than poop out the perls. Silly Big python…. it’s funny how it embarrasses the perl.
burt
I have a copy of “Python Programming” by John Zelle
The most important part of the book is hidden in Appendix B and half of the programs in the book will not run. Is it the Python or the book?
flamoot
It’s the book
PythonHater
Python is terrible, you shouldn’t promote it, it is impossible to read and overall very lame, stick to language which at least follow common sense when implementing the syntax.
Someguy
Perl > Python by far. It has much better documentation and is more common sense in my opinion.
Joe Krahn
There is no explanation here as to why Python sucks. The main problem with Python is that changes in whitespace can change the function. Having a language that enforces indentation is OK, but Python depends on precise alignment across many lines of code. Also, an indentation always counts as one indentation level, no matter what the size, but a dedent can be any number of dedents, depending on the previous lines of code. It works OK for small bits of code, but larger programs get really ugly. A folding or Python-aware text editor helps, but it is still a language weakness. It makes about as much sense as Fortran77 indentation rules.
Perl has it’s own problems. Object oriented features are a hack, and even well-formatted code can look rather cryptic. The documentation is much better just because it has been around much longer than Python. It is also much faster, probably for the same reason.
I would rather use something less cryptic than Perl, but without the fragile and annoying indentation rules of Python. Ruby looks promising, but I have not used it much yet.
matt
I thought I was smart and pretty decent at programming until I spent the last several days, surrounded by books, trying to learn python. Don’t get me wrong, I could easily entertain a 6-year old with my IDLE interpreter antics. I’ve even built a GUI and blah blah blah. But there is an anoying “spin” (read: lie) about the “ease of Python.” Here are the significant issues (from the standpoint of a business owner who just wants a robust and very quick solution to web and desktop applications):
1- There is virtually no documentation. This whole thread began with someone saying they couldn’t find documentation and that is the crucial problem. For those of you who disagree, look in the mirror–you’re taking for granted how much you know. And for the rest of us, it’s very very difficult to find a simple requirement like, what are the arguments i need to pass to a simple function?
2- Data Typing is not handled eloquently. It seems to be transparent at first, but unclear data types in python have led me to some very difficult to debug code (even when I seemed to explicitly type my variables).
3- Python has no GUI. Oh I know you’re going to blog that there are dozens of them from Tkinter to Qt to Wx etc. But those have crappy documentation, no matter how powerful they are. I managed to crank out a few GUI’s, but just the GUI itself took days on what would have taken less than 20 minutes in Visual Studio. (Don’t misunderstand, I despise MS World- But if you value your time as much as your money, it makes sense to use VS. I’ve already spent more on the API Python Wing and unhelpful Python books than I would have spent just buying Visual Studio outright).
4- Python is not free. You’ll spend a gazillion hours trying to figure out some documentation that would have simply popped up on the screen in VS. And the books. I’ve personally put Mark Lutz’s kids thru school with his Python books. And the web tutorials are well-intended but, for my level worthless. And don’t go off thinking I’m some lame beginner. I’ve created several very successful businesses and programmed much of the software that keeps them running at a high level.
5- Python is not intuitive. Sure you can write some apparently readable code at the interpreter. But take a bird’s eye view of some fairly simple code in the basic python modules…there’s nothing remotely readable about it. My dog can do some amusing tricks but I wouldn’t let him drive my car.
she
python is horrible because:
- whitespace matters:
no programming language that runs on NASA software should ever EVER EVER care about significant whitespace to satisfy a parser’s need
- def __this_stinks__(blabla,blablablablabla):
horrible horrible horrible.
- wrong OOP. When Alan Kay said OOP he not only did not mean C++, but also did not mean Python
Just a Developer
Joe Krahn said:
> Perl has it’s own problems. Object oriented features are a hack,
> and even well-formatted code can look rather cryptic. The
> documentation is much better just because it has been around
> much longer than Python. It is also much faster, probably for the same reason.
1. Perl is not faster, either not produce smaller code, if you want get
things right. Well, with Perl actually you can produce smaller sources
by GZIP’int em all, and most important that readability of the source
after compressing won’t change that much… :-)
2. Perl also has lack of exception handling. There are Error module,
which is basically a hack and workaround, which does not catches
properly lot of things. Well, even trivial things, like division by zero.
3. Perl’s built-in regular expression support is significantly different
that what most other languages provide. It makes Perl very powerful
tool while parsing text documents. However, this is very strong
disadvantage of Perl with none of counterweighting advantages while
working with XML (which is NOT a text!) and other complex data structures.
4. Standard library in Perl is absent, strictly saying. The rest is in CPAN.
To maintain such system, in some cases turns to be nightmare at
commercial production.
In short, the place of this rubbish lister is in museum. Perl6 is vaporware
and Python/Ruby, both of them beats Perl at Unix SA field these days.
> I would rather use something less cryptic than Perl, but without the fragile
> and annoying indentation rules of Python.
Python idents aren’t that fragile. They could be annoying, but using
correct editor and writing in correct way, Python is fine.
Maybe you want to read this nice posting:
http://www.secnetix.de/~olli/Python/block_indentation.hawk
What people said about Python sucks « Rudimentary Art of Programming & Development
[...] 12, 2008 by didip http://dannyman.toldme.com/2003/02/19/why-python-sucks/ — Funny and exaggerating post about him not knowing documentation command in Python. I think [...]
Brianary
@Just a Developer:
1. If you say so. There are differing posts about this online, and I’d wager that the two are at about the same order of magnitude in terms of speed, in general.
2. Wrong.
eval { .... }; if ($@) { if ($@->isa('MyFileException')) { # Specific exception handler .... } else { # Generic exception handler .... } }3. Examples, please? I don’t believe this is true. For the most part, other languages copy Perl. Who had RegEx first?
4. There is a standard library, depending on the distro of Perl you use. And maintaining CPAN modules is only a nightmare if you frighten easily. ;) There’s a whole module for easy module maintenance (CPAN). I imagine that this is something Python programmers will claim is a liability until PyPAN is ready.
I haven’t used Perl for serious programming in years, but when I need to quickly rename a bunch of files, massage some data, &c., Perl is indispensable.
I like Python’s indent-blocks. That’s part of what has drawn me to learn it, but I am also runnning into the lack of documentation, and it could cause me to walk away. Don’t dismiss Perl docs with “ok, the extra documentation is mostly centered around perl’s terminally weird syntax and stupid implicit argument behavior.”, because that’s just stupid and subjective. Read some Perl docs and see if that’s really the case. In fact, pick 20 common features and compare the docs to Python’s, and see what I mean. pydoc is nice, and I really like the local web server feature, but there’s just no CONTENT there.
The thing that is really throwing me is that there is no easy way to do something as simple as parsing an RFC 1123 or RFC 822 datetime value, which are used in email/MIME, HTTP, RSS, &c. This is a BIG hole. When people complain about the fact that strptime ignores timezones, Guido himself just points the finger at C, as if that’s an acceptable excuse. If you can’t parse a standard date format, fixing that should be a top priority.
Also, what’s up with repr() vs. str()? That’s bizarre.
Post a Public Comment
Danny Howard is 100% responsible for the content on this site, except some of it is stolen.
All rights are reserved, unless otherwise noted. Generally, I'm a BSD guy, so you can assume implicit permission to adapt, modify, and redistribute my intellectual property with appropriate attribution. Except some of this content is itself re-appropriated, so you'd best ask first, especially for commercial use. Thanks!
You can contact me via e-mail: dannyman@toldme.com
Most of http://dannyman.toldme.com/ is powered by WordPress.
If you're hip to RSS and whatnot, you can subscribe to this site.
These links are for dannyman: login AND backlinks