this post was submitted on 18 Nov 2024
33 points (88.4% liked)

Python

6392 readers
18 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] FooBarrington@lemmy.world -1 points 2 days ago* (last edited 2 days ago) (1 children)

Python is by far one of the worst languages I've ever seen in relation to maintainability, second only to Javascript (due to missing types, which are fixed by Typescript).

Seriously, it's rare for a Python project with more than 1,000 lines to not turn into an absolute mess thanks to the layers upon layers of meta programming, weird edge cases and so on. There are whole bad patterns I've never seen beyond Python codebases.

Things are improving slowly thanks to type hints and so on, but they are still far from where they need to be. Python is used in even more dynamic ways than JS, so the type system needs to be more expressive than TS. You can't even define a function that appends two tuples with proper type hints!

[–] onlinepersona@programming.dev 1 points 1 day ago (1 children)

I don't know when the last time you worked on a python project was (professionally or privately), but things have changed. If all you know if python and python projects from 10 years ago, I'd agree with you, but modern python projects can be made very maintainable. See my other comment.

As for meta programming, dude, I don't know if you're seen C++ templates...

Anti Commercial-AI license

[–] FooBarrington@lemmy.world 2 points 1 day ago* (last edited 1 day ago)

Yes, they can be written in maintainable ways, I didn't disagree in my original comment. That doesn't change that most of the projects I come across to this day are absolutely unmaintainable messes. I'm not talking about Python from 10 years ago, I'm talking about the projects I encounter now.

The biggest issue is that you have to limit yourself to a mostly non-dynamic subset of Python if you want type checking etc. to work, and you have to write your own type definitions for many dependencies. Most projects don't do that, they instead lean into the dynamic nature of Python, which makes them unmaintainable after little time.