Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python Is Not A Great Programming Language

Python is not a great programming language.

It's great for beginners. Then it turns into a mess.

What's good

  • A huge ecosystem of good third-party libraries.
  • Multiple inheritance.

What should be good

  • It's easy to learn. However, it's only easy to learn at the start. Once you get past "Hello world" examples Python can get really ugly and counterintuitive. See below.
  • It's easy to read. See "It's easy to learn" above.
  • The Pythonic philosophy that "There should be one -- and preferably only one -- obvious way to do it." As someone who loves working within rules and rigid frameworks, I love this philosophy! As someone who writes Python, I really wish it stuck to this philosophy. See examples below.

What's "meh"

  • Forced indentation. Some love it because it enforces consistency and a degree of readability. Some hate it because it enforces the wrong consistency. Objectively it's neither good nor bad.
  • Dynamic typing. There are lots of dynamically-typed languages and lots of statically-typed languages. Which kind of typing is better isn't a Python debate, it's a general programming debate.

What's bad

  • 400 (more or less) ways to interpolate strings. This prints "Hello Robin!" 3 times:

    user = {'name': "Robin"}
    print(f"Hello {user['name']}!")
    print("Hello {name}!".format(**user))
    print("Hello %(name)s!" % user)
    

    If there was a unique and obvious use-case for each of these then that would be one thing, but there's not.

  • 69 top-level functions that you have to just memorize. GvR's explanation makes sense in theory, but is really annoying in practice.

  • map and enumerate are not interchangeable with list, though 99% of the time you end up converting them to lists with list(). Alternatively you use a list comprehension, which, speaking of...

  • List comprehensions are held up as an excellent recent-ish addition to Python. People say they're readable. That's true for simple examples (e.g. [x**2 for x in range(10)]) but horribly untrue for slightly more complex examples (e.g. [[row[i] for row in matrix] for i in range(4)]). I chalk this up to...

  • Weird ordering in ternary/one-line expressions. Most languages follow a consistent order where first you declare conditions, then you do stuff based the on those conditions:

    if user.isSignedIn then user.greet else error
    
    for user in signedInUsers do user.greet
    

    Python does this in the opposite order:

    user.greet if user.isSignedIn else error
    
    [user.greet for user in signedInUsers]
    

    This is great for simple examples. It's unhelpful for more complex logic where you have to find and look at the middle of the expression before you can really understand what you're reading.

  • Syntax for tuples. If you write a single-item (tuple,) but forget the trailing comma, it's no longer a tuple but an expression. This is a really easy mistake to make. Considering the only difference between tuples and lists is mutability, it would make much more sense to use the same [syntax] as lists, which does not require a trailing comma, and add a freeze or immutable method. Speaking of...

  • There's no way to make dicts or complex objects immutable.

  • Regular expressions require a lot of boilerplate:

    re.compile(r"regex", re.I | re.M)
    

    Compared to JavaScript or Ruby:

    /regex/ig
    
  • The goofy string literal syntaxes: f'', u'', b'', r''.

  • The many "magic" double-underscore attributes that you just have to memorize.

  • You can't reliably catch all errors and their messages in one statement. Instead you have to use something like sys.exc_info()[0].

What's bad about the culture

Most programmers will acknowledge criticisms of their favorite language. Pythonists will say, "You just don't understand Python."

Most programmers will say that a piece of code is shoddy because it is inefficient or hard to read. Pythonists will also tell you whether or not they think it's "Pythonic", which feels about as helpful as someone saying your taste in music "isn't cultured enough."

Pythonists have a bit of a superiority complex.

@calebpower

This comment has been minimized.

Copy link

@calebpower calebpower commented Oct 12, 2019

A couple of others:

  • Better Ask Forgiveness Than Permission is a terrible philosophy to default to, and should only be used when reasonably sure that its necessary (as opposed to Look Before You Leap)
  • White space as syntax is reminiscent of RPGLE on AS/400; developers should learn how to write great code, not be forced into a style
  • Tendencies of developers to use it for absolutely everything is sad, but a good measure of how well-rounded a developer is

(Edit) I think points 1 and 3 are my "issues with many of the Python community" rather than "issues with the language" though.

@cmlburnett

This comment has been minimized.

Copy link

@cmlburnett cmlburnett commented Oct 12, 2019

What you don't like about Python seems to me to come from not understanding its underlying data model. I would recommend James Powell's 2017 PyData talk on becoming a Python expert (https://youtu.be/cKPlPJyQrt4).

  • The double underscore "magic" methods are all driven by this model.
  • Generators (and your "need" to cast returns from enumerate() and map()) are driven by this model. (PS, you absolutely do not need to convert the generators into lists as they will quack and walk like a duck when you need them to.)
  • Look at 'bar' in foo and 'bar' not in foo style syntax if you need to test if a key is in a dict or not and to do so without throwing KeyError's.
  • There's also dictionary comprehensions. Comprehensions have their place and can make code more concise and cleaner. Here's a double dict & list comprehension that would, equivalently, require 5 lines and 3 temp variables.

"""Converts "a=10,b=20" into {'a': 10, 'b': 20} dictionary"""
{k:int(v) for k,v in [_.split('=') for _ in "a=10,b=20".split(',')]}

  • Oddly, your use of "{'in': 'quotes'}" is, in fact, a dictionary comprehension... It is magic syntax, just like "[list comprehensions]" that you complain about. Same thing. The irony is interesting.
  • You realize that keys of dictionaries don't have to be strings (can be anything hashable)? You have to put quotes there because you want the key to be 'in' rather than throw a SyntaxError because in is Python syntax. What would you want foo['bar'] to result if foo had no 'bar' in it? Return None? What if foo had a key in it 'bar' and that its value was None? Now you've confused two very different results (this sounds like JavaScript). If you wan this, then do foo.get('bar', None) and you're happy. The behavior is defined.
  • There's a vast difference between a dictionary key and an object attribute. dict.get() and getattr() should not remotely be confused. See above comments about the data model.

I think your grievances with Python will dissolve with better understanding of Python itself. Expose yourself to Python beyond Django...

@patmoore

This comment has been minimized.

Copy link

@patmoore patmoore commented Oct 12, 2019

Indentation as a way to indicate blocks.

Copy and pasting code is a thing.

Copy and paste this code:

if foo:
x = y+foo
if x > 4:
foo =3

Was the original block:

if foo:
    x = y+foo
if x > 4:
    foo =3

OR?

if foo:
    x = y+foo
    if x > 4:
       foo =3

What happens if the editor 'helpfully' fixes things to one of those 2 choices? and it picks the wrong formatting. A big enough block of code, enough of a hurry and it will not be caught.

Refactoring: moving a block of code to a new method... on and on - a common operation now becomes a err-prone operation.

Keep in mind that the editor being used is not necessarily a IDE. It could be a word document that is being used to write a thesis. Every other language has { } or equivalent that allows the reader to correct bad formatting. Even bash(!) has if/fi and do/done delimiters, to allow recovery from a bad reformatting.

Someone in the python community needs to step up and have a path forward to allow for block boundaries to be marked without relying on white space

@jeffehobbs

This comment has been minimized.

Copy link

@jeffehobbs jeffehobbs commented Oct 12, 2019

This reads like a list of complaints about Django.

@edwardbeckett

This comment has been minimized.

Copy link

@edwardbeckett edwardbeckett commented Oct 13, 2019

I stopped learning Py as soon as I realized white space was part of the syntax.

@hecvd

This comment has been minimized.

Copy link

@hecvd hecvd commented Oct 13, 2019

You can use tabs if you prefer, Ed.

@XVicarious

This comment has been minimized.

Copy link

@XVicarious XVicarious commented Oct 13, 2019

Try mathialo/bython.

@karnikamit

This comment has been minimized.

Copy link

@karnikamit karnikamit commented Oct 13, 2019

"I think your grievances with Python will dissolve with better understanding of Python itself. Expose yourself to Python beyond Django..."
+1

@girng

This comment has been minimized.

Copy link

@girng girng commented Oct 13, 2019

Lol, I love how this is flagged on HN 🤣

@1oglop1

This comment has been minimized.

Copy link

@1oglop1 1oglop1 commented Oct 13, 2019

but then its syntax turns everything into a mess

Now look at JavaScript where deprecation does not exist and you can define a function in 4 or more styles and each does something else.

@leoburgy

This comment has been minimized.

Copy link

@leoburgy leoburgy commented Oct 14, 2019

If you prefer not to use "superfluous" quotation marks in dictionary keys, you can also use the syntax dict(foo="bar").

@Aimage

This comment has been minimized.

Copy link

@Aimage Aimage commented Oct 14, 2019

It's true that you have to remember too many variable in python. But look at this on JavaScript
x === undefined

VM4312:1 Uncaught ReferenceError: x is not defined
at :1:1

Finally what does mean undefined ?

@roniemartinez

This comment has been minimized.

Copy link

@roniemartinez roniemartinez commented Oct 14, 2019

This is more like complaints because you have very different expectations. I've been into Perl, C++, Java, Javascript and it is only Python that made me stay longer (Senior Specialist). Of course I still do Javascript for client-side coz we have no other better choice for that.

@mtst-vladzin

This comment has been minimized.

Copy link

@mtst-vladzin mtst-vladzin commented Oct 14, 2019

Nested parens is a good thing. Always! :D

@imneonizer

This comment has been minimized.

Copy link

@imneonizer imneonizer commented Oct 15, 2019

Seriously would you really like to have {{{{{}}}}}} these kinda confusing opening and closing..... Hell only for these reasons i quit java and c++, if you learned a bit about python then you know how to efficiently use white spaces, you just need a good editor unless you know how indentation works i can even write that into notepads.
Talking about list comprehension
Whats wrong in writing
foo = [x for x in numbers if numbers < 10]
Learn some basics bro, django is confusing i can understand use flask its much easier get a taste of it before complaining about it.

@ZuluPro

This comment has been minimized.

Copy link

@ZuluPro ZuluPro commented Oct 15, 2019

Don' feed the troll ...

@glenfant

This comment has been minimized.

Copy link

@glenfant glenfant commented Oct 15, 2019

I only agree with the last point (about pipfiles that are obscure to me too).
Seriously, the other points are either trolls or jokes, or mean you only learned the surface of Python (confusing attributes and dict keys, etc...)

@greypanda

This comment has been minimized.

Copy link

@greypanda greypanda commented Oct 15, 2019

So you prefer requirements.txt over Pipfile? I was so happy to see pipenv that I had a book-burning.

@ghsolo1

This comment has been minimized.

Copy link

@ghsolo1 ghsolo1 commented Oct 16, 2019

This is a Click bite title. Here is my opinionated view of Python ;-)
Python is "the simple and the most powerful language" humans have invented in terms of Features and community behind it on the planet despite of not being the key language driving the internet. To complain about Python, one has to be either Guido or must be a decade user of Python. Though Python started as a one man's mind now it is the mind of humanity.

@rubik

This comment has been minimized.

Copy link

@rubik rubik commented Oct 16, 2019

Before complaining first learn Python to a minimal level. You clearly come from Javascript and it seems you have just skimmed the language. All the negative points you listed don't make any sense, except for the packaging one. That's still a bit messy on Python.

@RagAlMuffin

This comment has been minimized.

Copy link

@RagAlMuffin RagAlMuffin commented Oct 16, 2019

Argh !! I was deceived, I thought it was an elaborate discussion on the limitations of Python. Instead, it is a list of complaints without any further explanation... I have been learning Python for more than ten years now and it is the only programming language I've remained with. So I was hoping this discussion would implicate different languages (C, C++, Perl, Ruby, Julia, Java, JS, etc..) with people confronting their view about an ideal programming language. As for me, I believe Python is the greatest language for all-rounders. I like how it is accessible yet allows to go far in possibilities. I believe the space/tab indent forces you to make the code readable just by peeking on it. I love how the comprehensions makes it both efficient and readable and I really like the f strings ! Of course, I would not recommend Python as a first choice if you want to design an OS, or if you are programming a CFD code or an android application but in the end, it's a great day-to-day language for many things.

@Aimage

This comment has been minimized.

Copy link

@Aimage Aimage commented Oct 16, 2019

So we end up comparing languages to Python. Every languages is a tool and every tool has its own pros and cons.
As main pros for python I can say simplicity, readbility and cover many filed (web, desktop, embeded with micropython, ...)
As cons I can say performance compared to C or C++.
I don't think all you mention before are limations of python, they are python nature and how it does stuff. You have to deal with them if you want to build something with python.
It's like we want to live in china and need to speak chinese but we don't like their alphabet cause their is no latin character.

@juanfal

This comment has been minimized.

Copy link

@juanfal juanfal commented Oct 16, 2019

Python has been my last language to learn. The hype about Python comes from the spaces other languages have left. Particularly Java and its verbose, inconsistency, old style and rigid syntax and strict OOP for everything. Ruby, being a much beautiful, consistent, and natural language has the absurd drawback of not being European or American and its support written in Japanese. That made its development (libraries included) much slower.

Last version of Python is concerned about := (as if it were something revolutionary!) but leaves its many absurdities without any perspective of solution.

@Antu7

This comment has been minimized.

Copy link

@Antu7 Antu7 commented Oct 19, 2019

Exactly Python is not a great programming language for trolling

@kissgyorgy

This comment has been minimized.

Copy link

@kissgyorgy kissgyorgy commented Oct 19, 2019

Half of this list is just simply stupid, half of it is nothing to do with Python itself (but the Python ecosystem), you don't know the difference between a dict and an object, so I suggest you don't use Python at all and don't write stupid things about it.

@greypanda

This comment has been minimized.

Copy link

@greypanda greypanda commented Oct 19, 2019

You cannot get by today as a one-trick pony. If you do any embedded devices, you will need C/C++ ( Although MicroPython is promising. ). Javascript for browsers. ( I hate it, but love browser based apps. ) PHP to repair bad web apps that you don't want to re-write. ( I hate it, but wrote a lot of apps when it was the only thing around. ) Python to string it all together. ( Love, hate. ) Java is so convoluted I won't even touch it anymore; I had to learn Java to keep my job. Perl is just a memory, but I still see some diehards.

I consider myself fairly fluent in all of these languages but I use the ones that get the job done. I'm just experimenting with Rust and Go, but every language has the good and the bad. Just enjoy the challenge.

@abbyrjones72

This comment has been minimized.

Copy link

@abbyrjones72 abbyrjones72 commented Oct 19, 2019

Languages are what you make with them, not the languages themselves.

@greypanda

This comment has been minimized.

Copy link

@greypanda greypanda commented Oct 19, 2019

Languages are what you make with them, not the languages themselves.

Exactly. You can't expect to be a decent French speaker with one class in high-school French.

@Murithijoshua

This comment has been minimized.

Copy link

@Murithijoshua Murithijoshua commented Oct 20, 2019

well each language has its up and downs.We are deep diving into Agile software development,Instagram lies on Python backbones @abbyjones72 i second you.

@Endzel

This comment has been minimized.

Copy link

@Endzel Endzel commented Oct 20, 2019

In my honest opinion, Python is just pushing the boundaries of abstraction for programming languages to the highest level. Readability comes at the cost of efficiency, where sometimes it does not matter enough. And in general, making things simpler is a really honest objective.

Of course it has downsides and you pretty much summed up a lot of them! Now, the ball is on our roof to work for the future developments in order to avoid this kind of mistakes as much as possible.

@nasoma

This comment has been minimized.

Copy link

@nasoma nasoma commented Oct 21, 2019

Yet another example of a Javascript guy who wants Python to be Javascript.

@jakesyl

This comment has been minimized.

Copy link

@jakesyl jakesyl commented Oct 21, 2019

global interpreter lock is hell

@jreniel

This comment has been minimized.

Copy link

@jreniel jreniel commented Oct 22, 2019

global interpreter lock is hell

I second this. The GIL and the implicit memory management are the two main things I'd vote to improve in Python, and ironically, neither is mentioned here. Other than this, I don't think some of the complaints listed here make much sense. It doesn't seem like the author really understand Python.

@jasongodev

This comment has been minimized.

Copy link

@jasongodev jasongodev commented Oct 22, 2019

PHP is still the best and straightforward way for web programming. I wished PHP was able to develop its statistical libraries and routines so that it will be easier to do inferential statistics, machine learning, etc. Python and R are very unexpressive when it comes to syntax. They just sound less natural like Pascal.

@sonhanguyen

This comment has been minimized.

Copy link

@sonhanguyen sonhanguyen commented Jun 23, 2020

Yeah I don't know why javascript gets all the bad rap, while python is just as guilty if not more. Modern javascript with typescript on top is still less complex than python 3. List comprehension is so overrated. I get comprehension in scala, it's actually a functional programming thing. Comprehension in python is just a stylistic thing that in practice you can't always use. So you end up flip-flopping between it and map/reduce and some dot notation api (which sucks because of python line breaking rules). So much for the "zen of python".

@juanfal

This comment has been minimized.

Copy link

@juanfal juanfal commented Jun 23, 2020

@contactkkiran

This comment has been minimized.

Copy link

@contactkkiran contactkkiran commented Jul 26, 2020

Yet another example of a Javascript guy who wants Python to be Javascript.

@ax-iomata

This comment has been minimized.

Copy link

@ax-iomata ax-iomata commented Sep 26, 2020

Defenses of python: "But if you write it in this other one of a million idiosyncratic ways...." "But it has lots of code written for it already..." "But if you knew the ingredients of the secret sauce behind the opaqueness..." "But if you had a third-party tool that does what's not part of the language itself..." "They just extended the language for the umpteenth time with another tack on bit of syntactial flourish that does that more clearly..."

It's so expressive as to become idiosyncratic and mutually unintelligible. It's so fragile as to require para-linguistic tools to keeo anything but a tiny program from shattering after hours or days of running. Between 2 and 3 it's internally inconsistent in some ways. It's taught to everyone and becomes the first and last language they learn. It contains an excessively high degree of magic syntax relative to other languages. It's epicycles upon epicycles of syntax. It's defenders offer paper tigers and thought-stoppers that fall apart under basic critical thought. It's the sunk cost fallacy. It's the favorite of people who only know one word of programming: "python."

There's a solution for every problem that python manifests, the problem is the sheer number of problems it manifests. It's the perfect playground for know-it-all geeks that can decry those who see its problems as simply "not knowing enough about it." Even its problems are idiosyncratic. It's the formal equivalent of a highly irregular natural language.

I've never met a language theorist that likes it.

@RobertAKARobin

This comment has been minimized.

Copy link
Owner Author

@RobertAKARobin RobertAKARobin commented Sep 26, 2020

My theory is most Python fans come from backgrounds in Java, a C variant, or some other "hard" language. Naturally Python is a breath of fresh air in comparison, and keeps a pretense of being serious, science-y, and academic unlike other "easy" languages like JavaScript and Ruby.

@ax-iomata

This comment has been minimized.

Copy link

@ax-iomata ax-iomata commented Sep 26, 2020

I came from a background of self-taught C++11 (which wasn't hard) and python made me very uncomfortable. On the other hand, being taught OCaml at school felt like a breath of fresh air. To this day I'm perplexed as to why functional languages leave people perplexed. It's like listening to a formally trained pianist decry the Janko design because they have to learn a new way of moving their fingers in order to save themselves 12/13 the effort of playing a song.

@Mr-Jonas

This comment has been minimized.

Copy link

@Mr-Jonas Mr-Jonas commented Oct 1, 2020

Self.I lost all respect for python after i mailed myself a program and at home,
Self.it no longer ran as it should due to the idiotic idea that white space matters for program flow control.
Self.Feels like a toy language but very nice for scripting.
Self.Also, the need to write Self all over, makes OOP feel like an afterthought.
Self.Pretty annoying for math classes
Self.Where you want to use member Self.variables Self.in Self.formulas and have to use self in front of all of them. Plain ugly.
Self.And no forced access control. Using _ to mean private is just a very amateurs way of
Self.handling language design but I guess for some reason, he didn't want real encapsulation.
Self.But then again. The only languages that nobody complains about, is the ones nobody uses :)

@KerimG

This comment has been minimized.

Copy link

@KerimG KerimG commented Jan 3, 2021

I want to love Python too and I still occasionally recommend it to beginners but honestly? It's a horrible beginner's language

  1. __this_is_hella_ugly__ and actually makes code less readable for beginners, this is especially true when doing OOP with private members
  2. whitespace in the syntax means copy-pasting Python is error prone, especially true when mailing or pasting it in a chat or something to get advice from someone
  3. pip is worse than npm even. It has all the bad trivial packages npm has but installs everything in a "global" manner, which makes dependency management a PITA. Also it makes it more difficult for beginners, because now their installed module isn't just residing in the folder of their project but it's somewhere on the system. They put their project on a USB, take it home, and try to run it on their computer only to find out it doesn't work
  4. Try explaining why the Python 2 example they found doesn't work in their Python 3 interpreter to a beginner

From a beginner's perspective, there's no benefit to starting with Python over even C. At least with JavaScript, you can immediately start developing in the browser and make graphical elements move. That seems to be way more rewarding and exciting to people at the beginning than implementing the Sieve of Eratosthenes in a terminal window, even though the latter is a bigger accomplishment.

Since it's a crappy language for beginners and becomes unwieldy in bigger projects, I believe that Python is true scripting language. It's perfect for single file scripts that, at most, act as a wrapper for some C-libraries.

@notjames

This comment has been minimized.

Copy link

@notjames notjames commented Feb 18, 2021

I love this thread. It's obvious that there are passionate people on both sides of the argument. Moreover, the python lovers are, like any other passionate human beings, capable of rationalizing the "good" of the language. Put me in the "I hate python" camp. I'll try to be as rational and dispassionate as I can, but every time I have to code in python, I find some ridiculous inconsistency about it that I end up just passionately hating the language even more. At any rate, I'm in such a bind right now. BTW, FTR, django sucks, too, but it's hard not to suck when you are written in a sucky language. A few top-level thoughts...

  1. forced white space indentation - it's like having a communist government forcing "greatness" for the good of the masses only to realize that the government never does anything right and it's always better to allow people to do their own thing. If people make something that sucks, that product doesn't succeed ultimately, and they either have to make it again, make it better, or it someone else comes in and makes a better alternative. Sure, some people love the communist way, but let's admit it, it's probably because of laziness. OTH, people should not abuse the freedoms they are given (non-forced whitespace indentation). Where is the happy medium?! I'd rather have the freedom to do my own thing than be forced to do it by someone else's standards. I've never had to read relevant code by anyone where whitespace was the cause of my inability to understand what I was reading. That's just me; I'm not saying it doesn't exist, but I am suggesting that it's such not a huge problem in the world that forcing people to use specific whitespace indentation should be warranted. ¯_(ツ)_/¯ - meh
  2. I absolutely abhor the lack of consistency between OOP and functional use of base methods/functions in python. This problem stems, I imagine, from an inconsistent paradigm at the core of the language. For instance, Ruby was written strictly as an object oriented language. It's not a perfect language, but it's by far more consistent than Python is in my estimation. IE len(list) vs list.length(). One has to memorize inconsistent ways of doing things, which is just unnecessary tech debt.
  3. I am fine with list comprehensions. In fact, part of me thinks they're kinda cool, but if you think about it, for a language that touts "easy to learn" and there is only "one way to do it," list comprehensions seem to break that paradigm. In fact, I've heard many a developer argue in favor of python vs languages like Ruby and Perl using this exact argument. Perl is too hard to read because TMTOWTDI, but aren't list comprehensions exactly that?
  4. The nuances of creating packages/modules are annoying. In theory, it's easy. Fortunately, this is not just a python thing, but I'm dealing with this pain point now, so I'll mention it.
  5. Anytime someone has to go and read a butt-ton of manifestos to understand why or how python works is prima-facie evidence to me that something isn't right about the language. Nevertheless, I find more and more, when someone raises questions or concerns about something, they're told to read the PEP. I mean, I get it. You can't please 100% of the people 100% of the time.

I've decided that, like so many other computer-related holy wars, these arguments are subjective and I'm really just venting here. I mean, here I am coding something in python and grumbling about some of the things I hate about the language finding myself wanting to lament with others. Frankly, there's really not much someone can say that can change my mind. I know many languages. This one is one I just hate in comparison to the others that I know. I prefer Ruby the most. It's my favorite language. And the funny thing is the minute someone reads this, they will stop reading this rant after forming some opinion of how I must not know what I'm talking about. And that's fair. Everyone is entitled to their opinions. For that one reader, there are 50 others in agreement with me. Conversely, there are 50 others in agreement with that reader. Meh, whatever. All of that said, I absolutely, unequivocally, unabashedly, and in all other ways....hate python. It's a language that gets way more hype than it should get. It has some good qualities, but there are 10 other way, way, way better languages out there. I don't understand why python gets as much love as it gets.

@grahamnicholls

This comment has been minimized.

Copy link

@grahamnicholls grahamnicholls commented Feb 24, 2021

My heart sinks every time I'm forced to use Python. In the end, it amounts to : "it's ugly, arrogant (4 spaces, anyone - thanks, but I'll stick to tabs and set ts=2 sw=2 in vi), horribly verbose, but above all, it's prone to people writing unreadable code - just like Perl. Flame all you like, but I have 35+ years programming experience, and have been paid to program in 10+ languages as well as been competent in many more. This article is not a troll, and for those claiming it is, run back to mummy. For comparison, I love golang, Ruby, Lua, and for gluing things together, bash. Golang is just perfect for me. Small, simple, fast, powerful. The anti-Python!

PS Try reading version 3.8 of the article - the author loves Python in that version. Sorry that it's not backwards compatible.

@grahamnicholls

This comment has been minimized.

Copy link

@grahamnicholls grahamnicholls commented Feb 24, 2021

I love this thread. It's obvious that there are passionate people on both sides of the argument. Moreover, the python lovers are, like any other passionate human beings, capable of rationalizing the "good" of the language. Put me in the "I hate python" camp. I'll try to be as rational and dispassionate as I can, but every time I have to code in python, I find some ridiculous inconsistency about it that I end up just passionately hating the language even more. At any rate, I'm in such a bind right now. BTW, FTR, django sucks, too, but it's hard not to suck when you are written in a sucky language. A few top-level thoughts...
...

I was too lazy to type more than I did in an earlier comment. I couldn't agree more with your argument, especially wrt list comprehension. It seems such a shame to me that Ruby's star is on the wane, whilst the mess of Python is so popular. Why, for the love of God, WHY?

@RobertAKARobin

This comment has been minimized.

Copy link
Owner Author

@RobertAKARobin RobertAKARobin commented Feb 24, 2021

After an additional year-and-a-half of writing Python, I've decided to revise this article

@grahamnicholls

This comment has been minimized.

Copy link

@grahamnicholls grahamnicholls commented Feb 24, 2021

How prescient of me - version 3.8 coming. Written in ancient runic egyptian, but the author now loves Python. What do you mean, you don't read ancient runic egyptian - it's progress, and you should see the new pyramid constructor - it's great! Oh, and if you install using rosettaenv, you can read the old-style article on the same computer as Article v3.8. Simple. By the way, there's a new way of printing in the new version. You can have 23 ways to interpolate strings, but still no switch statement - that's f{syntactic sugar|not Pythonic}. Ugh, what a diabolical mess.

@juanfal

This comment has been minimized.

Copy link

@juanfal juanfal commented Feb 25, 2021

Python, compared with Ruby is, let me say poor. Boring, and whimsical. Full of absurd and never agreed for everybody syntactical limitations. Python is inconsistent. It doesn't respect what many years of UNIX mature use have shown and everybody agrees with, quotes and double quotes equivalence is an erroneous waste of syntax. I don't understand why the need of it. Please don't answer here that it is for nesting one type of quotes inside the other, my gosh. The many syntactical limitations like assignation made function finally added at 3.9 show it has been devised by a whimsical person. The horrible second class citizen regular expressions makes them almost unused by anybody. In Ruby/Perl regular expressions are so easy to use, ruby has for example string[/something/] directly!

Python is simply: dictatorship of the majority

@rai-gaurav

This comment has been minimized.

Copy link

@rai-gaurav rai-gaurav commented Mar 3, 2021

Perl to Python - You have become the very thing you swore to destroy.

  1. Multiple ways to interpolate string and it says there is only one way. Clearly Perl TMTOWTDI principle.
  2. Perl code are more readable than list comprehensions. :P. And they call Perl line nose language.
  3. Perl has anonymous subroutines since ages. Python has just given it the shining name 'lambdas'. Yet, a typical python developer boast about it like its some revolutionary thing.
  4. Closures - Look at this article. Its from 2002 . yes, even before 2002 Perl has it. For a new python guy, its again a revolutionary thing.
  5. Don't get me started on Decorator and Generators.
  6. regex meh!!!!. PCRE is industry standard.
  7. Look at there horrible scoping names (nonlocal ?).
  8. Why on earth I have to write if __name__ == "__main__ ?
  9. Backward compatibility ? I don't know what you are talking about
  10. I found newcomers who learn Python as first language, they have hard time adopting to any language. According to them python is best for everything.
@bratwiz

This comment has been minimized.

Copy link

@bratwiz bratwiz commented Mar 13, 2021

I've decided that I really don't like Python. After years of resisting learning it, I thought I'd give it a serious, earnest go.... I so totally agree with the commenter above, Perl to Python-- what was it you were saying again?? I'm going to stick with it some more, because it does look interesting for some very simple things. But, IMO, it's a language that has no natural grace and never will.

@lampuiho

This comment has been minimized.

Copy link

@lampuiho lampuiho commented Mar 29, 2021

I find myself always going back to matlab for all the maths I need to prototype, mainly for the convenience of indexing. If I am gonna do some stuff that needs more speed or better with OOP, I do it in C#/C++. I just prefer a strongly typed language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment