Skip to content

Instantly share code, notes, and snippets.

@RobertAKARobin
Last active September 23, 2025 17:05
Show Gist options
  • Save RobertAKARobin/a1cba47d62c009a378121398cc5477ea to your computer and use it in GitHub Desktop.
Save RobertAKARobin/a1cba47d62c009a378121398cc5477ea to your computer and use it in GitHub Desktop.
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.
  • Named arguments.
  • Multiple inheritance.

What should be good

  • It's easy to learn and read. However, it's only easy to learn and read at the start. Once you get past "Hello world" Python can get really ugly and counterintuitive.
  • 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 Python actually stuck to this philosophy. See below.

What's "meh"

  • Forced indentation. Some love it because it enforces consistency and a degree of readability. Some hate it because they think it enforces the wrong consistency. To each their own.
  • 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 ways (more or less) 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 sounds nice, but in reality it makes things confusing.

  • map doesn't return a list, even though the whole point of a mapping function is to create one list from another. Instead it returns a map object, which is pretty much useless since it's missing append, reverse, etc. So, you always have to wrap it in list(), or 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 fine for simple examples. It's bad for more complex logic because you have to first find the middle of the expression before you can really understand what you're reading.

  • Syntax for tuples. If you write a single-item tuple (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 [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]. You shouldn't have a catch-all in production of course, but in development it's very useful, so this unintuitive extra step is annoying.

  • Dev environments. Setting up an environment is a problem in any langauge, but other languages have solved the problem better than Python. For example, while npm has its warts, it is widely accepted that a fresh environment should be set up with npm i && npm run [script]. Meanwhile each Python project seems to require a unique mish-mash of pip and pipenv and venv and other shell commands.

What's bad about the culture

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

Most programmers will say a piece of code is bad if it's inefficient or hard to read. Pythonists will say a piece of code is bad if "it isn't Pythonic enough." This is about as helpful as someone saying your taste in music is bad because "it isn't cultured enough."

Pythonists have a bit of a superiority complex.

@brettwhitty
Copy link

brettwhitty commented Aug 23, 2025

I now understand that this gist is just an outlet for malicious people who want to project their hatred onto Python without providing or addressing any factual arguments.

I appreciate your passive aggression.

I didn't repeat all the points others have made because they are all correct, at least the ones about Python being a hobby language with serious deficiencies that should have been addressed years ago were it a real production-ready language for adult professionals doing serious work. Any language can wrap a C library with an interface and call it a module. The language itself doesn't deserve any credit for that. That's stolen valor.

Semantically significant whitespace is sociopathic. And it really doesn't make any sense in modern times where we are developing across platforns, in webpages, etc. etc. Relying on the consistency of whitespace is stupid; doing it to force a certain behavior on others to impose your esthetic preference is beyond stupid. That's malicious intent.

[An IDE can take care of the whitespace issue! As it can with any language, so why does it even matter? Why purposefully choose an invisible character as your code block delimiter? That's indefensible in the abstract.]

How many years does a language need to exist before it gets a stable tool ecosystem? And when that fails to ever happen --- well here's a solution --- add another layer of complexity and confusion, just do a full local install of the entire runtime for every single throwaway script somebody wants to run. That's prosocial. That doesn't harm anything to do that.

And as another commenter said, you really didn't read (or maybe have comprehension issues) if you don't think the jump from Python 2 to 3 didn't cause a lot of problems with maintaining garbage legacy code.

@tomvanschaijk
Copy link

tomvanschaijk commented Aug 23, 2025

Feel free to delete my contribution, but I'd just like to thank you for over a year of being able to laugh my ass off whenever new comments appear :-D I'm not one to actively contribute to language wars, I have my own preferences, and whatever somebody else uses or what people think about my choices is the least of my concern, To be fair, I'm firmly in the "Python, no thx lol" camp after working on a few bigger projects that relied mainly on Python, but as long as I can limit my contact with it to a few small prototypes and toy examples here and there, I'm fine. I don't want to dive into the back and forth, cause it's like religious arguments: it's just a yes/no battle anyways. But I've had my fair share of chuckles reading all contributions so far, for which I'm grateful. I'm counting on more! And to the people losing their minds over this: it's a programming language :-D we're going to be dead at the end of this, don't lose sleep over what somebody else thinks about the little letters you type :-D (but by all means, keep going at each others throats)

@Odalrick
Copy link

Semantically significant whitespace is sociopathic.

I can understand most problems people have with Python, but the absolute vitriolic hatred of white-space is just baffling.

I can understand not liking it; but beyond the dislike of braces on the end or start of a line...?

invisible character

If you can't see white-space, I advise you to get your sight checked; you might be blind.

[An IDE can take care of the braces issue! As it can with any language, so why does it even matter? Why purposefully choose different representations of code block delimiters between human and computer? That's indefensible in the abstract.]

You better not be using indentation in your C-code, or whatever you're using! Or else I'm going to laugh and point at you.

@lampuiho
Copy link

lampuiho commented Aug 26, 2025

If you can't see white-space, I advise you to get your sight checked; you might be blind.

try copying some code snippet or try to have scoped execution.
Python people also seem to have unhealthy obession of new lines. Every line of statement is seperated by an empty line. On my 720p screen, I lose track pretty fast what scope they are supposed to be in.

You better not be using indentation in your C-code

People also do single line stuff with simple statements.

@Odalrick
Copy link

try copying some code snippet

I do it all the time. Selecting the text to copy is harder than fixing the white-space.

try to have scoped execution.

What does that have to do with white-space?

On my 720p screen, I lose track pretty fast what scope they are supposed to be in.

I don't think I ever had one of those. 340 in the nineties of course, but even then that was more a limitation of the computer than the monitor.

Still, look up: everything is in the scope of the first def you see,

People also do single line stuff with simple statements.

Yeah... your point? Are you trying to say multiple statements are "simple" so often that it bothers you? To me preventing idiots from trying to be too clever is a feature.

I'm not saying Python is perfect; and I can see why people would dislike is intensely.

Except for the white-space issue, if anything the common usage of "{}" in other languages should be worse, as they are difficult to type on some keyboard layouts.

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