337
submitted 11 months ago by 257m@lemmy.ml to c/programming@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] escapesamsara@discuss.online 23 points 11 months ago

Python is legitimately the best language by far for the vast majority of non-performance critical tasks, and most tasks that need to be developed for are not performance critical.

[-] foo@withachanceof.com 18 points 11 months ago

Heh, I was about to comment how my hot take is that Python is overrated. It's... fine and I don't really have anything against it for the most part, but I greatly prefer Ruby to Python.

I'm speaking purely about the language itself here, not any libraries available for it (since someone will always point out how great Python is for data work).

[-] fubo@lemmy.world 9 points 11 months ago* (last edited 11 months ago)

My impression at the time was that Ruby and Python both caught on with people who were ready to be done with Perl.

And, later, that Go set out to be a replacement for Java, but ended up being a replacement for Python for people who were ready for type checking and built-in multithreading.

[-] zagaberoo@beehaw.org 4 points 11 months ago* (last edited 11 months ago)

Me too! Even just the fact that only false and nil are falsey is enough for me to prefer Ruby. Being able to use ||= as an idiomatic one-time initializer is rad. Python's OOP bothers me in a lot of ways compared to Ruby as well. And don't get me started on Ruby's blocks. . .

[-] lolcatnip@reddthat.com 7 points 11 months ago

The OOP in Python isn't bolted on. It was there from the first version I ever saw in the 90s.

[-] zagaberoo@beehaw.org 1 points 11 months ago* (last edited 11 months ago)

You're absolutely right, not sure where I thought I had read that.

Edit: It's actually a bit less clear cut when you consider new vs old style classes, which took the Python 3 discontinuity to resolve. But still, it was wrong to imply that Python didn't originally support OOP.

[-] railsdev@programming.dev 3 points 11 months ago

Long term Ruby developer here; I did a coding bootcamp that focused on Django and hated it. The language feels like a step down. Crystal on the other hand…

[-] CMahaff@lemmy.world 12 points 11 months ago

Oh man, I actually like the language, but you made me think of my own hot take:

Python has inexcusably poor docs.

Just a smattering of examples, which aren't even that good, while failing to report key information like all the parameters a function can take, or all the exceptions it can throw. Any other popular language I can think of has this locked down and it makes things so much easier.

[-] navi@lemmy.tespia.org 7 points 11 months ago

I really enjoy typescript these days. Is there a Python typed equivalent?

[-] TerrorBite@meow.social 6 points 11 months ago

Python has had syntax support for type annotations for a while now. The Python runtime doesn't enforce the typing at all, but it can be enforced by a linter or by your IDE. And I believe you can introspect the type annotations at runtime, because they are actually part of the syntax.

There's even an alternative way of doing type annotations through specially formatted comments, just in case you might still need to write code that is backwards compatible with Python 2.

@escapesamsara @navi @programming

[-] TehPers@beehaw.org 2 points 11 months ago

mypy is great, but it doesn't come close to what you can do with TypeScript. I don't think that's necessarily a jab at Python (though TypeVar's limitations do come up here and there), more just throwing TypeScript on a pedestal.

[-] TerrorBite@meow.social 0 points 11 months ago

@TehPers I really wish Python had a satisfying way to do interfaces.

[-] TehPers@beehaw.org 1 points 11 months ago

I really wish Python had multi-line lambdas. Sadly Python is very opinionated in ways I don't quite understand, but I can at least respect while using it.

For interfaces, honestly all I can suggest is using an ABC with only @abstractmethods. It's not perfect, but it's basically what you'd do in C++ anyway. If you're looking for an interface that models data, you could look at dataclasses or TypedDict (depending on what kind of data it is), but it's just not going to match what's possible in TS sadly (mapped types, conditional types, complex union types, custom type guards, etc).

[-] r1veRRR@feddit.de 3 points 11 months ago

For bigger projects, anything with MANDATORY types is a must for me. Optional, not compiler checked hinting doesn't cut it.

Not that i hate the language, but I do hate the tooling around it. I don't think I've ever had a pleasant experience with setting up a Python project. And all the data stuff is just wrappers for code in other languages, making the packaging story even uglier, even harder.

[-] MajorHavoc@lemmy.world 1 points 11 months ago* (last edited 11 months ago)

You're right now to compromise on this, but you can give yourself mandatory types in Python, using MyPy, if that's your only issue with it.*

Because you don't need elegant subprocess handling, intuitive reliable logging, and don't mind needing a to autonate a linter to check for whitesoace bullshit.*

**Python is my favorite language, actually. Really.

this post was submitted on 01 Sep 2023
337 points (96.2% liked)

Programming

16687 readers
169 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS