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

Programmer Humor

25425 readers
983 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 25 points 6 days ago (9 children)

I always get irrationally angry when i see python code using os.path instead of pathlib. What is this, the nineties?

[–] UndercoverUlrikHD@programming.dev 4 points 6 days ago (4 children)

What big advantages does pathlib provide? os.path works just fine

[–] Diplomjodler3@lemmy.world 8 points 6 days ago (3 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.

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

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

[–] Diplomjodler3@lemmy.world 3 points 6 days ago

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

load more comments (1 replies)
load more comments (1 replies)
load more comments (5 replies)