this post was submitted on 26 Jul 2025
869 points (99.0% liked)

Programmer Humor

25311 readers
131 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Diplomjodler3@lemmy.world 8 points 1 day ago (2 children)
  • Everything is in one library which offers consistency for all operations.
  • You can use forward slashes on Windows paths, which makes for much better readability.
  • You can access all the parts of a pathlib object with attributes like .stem, .suffix or .parent.
  • You can easily find the differences between paths with .relative_to()
  • You can easily build up complex paths with the / operator (no string additions).

Just off the top of my head.

[–] brucethemoose@lemmy.world 1 points 20 hours ago* (last edited 20 hours ago)

I suppose os.path is simpler? It's a string and operation.

Python is all about 'attention efficiency,' which there's something to be said for. People taking the path of least resistance (instead of eating time learning the more complex/OOP pathlib) to bang out their script where they just need to move a file or something makes sense. I'm with you here, but it makes sense.


...Also, os.path has much better Google SEO, heh.

[–] nibbler@discuss.tchncs.de 0 points 1 day ago* (last edited 1 day ago) (1 children)

if you don't need those, why burden the program with another dependency?

[–] Diplomjodler3@lemmy.world 3 points 1 day ago

It's in the standard library, just like os or shutil.