r/ProgrammerHumor • • 7d ago • Bravo 2 Popcorn 1

Meme pythonSlow

Post image
12k Upvotes

421 comments sorted by

View all comments

Show parent comment

11

u/hawkinsst7 7d ago

What you're saying is that for the most part librairies and frameworks shouldn't be written in Python, so it is meaningfully different from other langages you could write library/framework code in.

I don't disagree, but libraries in all languages are optimized, and their specifics are abstracted away. Even C can be linked against libraries written in assembly.

once those libraries are written and abstracted away, is it all that meaningful to (generally) say "it wasn't written in X language because the libraries are Y", outside of hyper specific conversations.

If I wrote a bash script that loops through a directory and sorts each file by md5, would it even be worth a comment that md5sum and sort are binaries written in C? The script is using tools it has, and it's calling them appropriately and correctly, and doing something with the result.

6

u/MHeaviside 7d ago

once those libraries are done being written

But we're not done writing libraries.

Yes if you wrote a script in Python or Bash you wrote in in Python or Bash even if it called something written in C that's fine, it's not my point

My point is somebody wrote that C code, and maybe they wrote it recently.

Python is nice when either performance doesn't matter, or when the library being called is doing 99% of the work anyways.

But people still write code where the actual performance of the code being written does matter.

1

u/AugustusLego 7d ago

I don't disagree, but libraries in all languages are optimized, and their specifics are abstracted away.

Python libraries are not optimised (by default)

1

u/hawkinsst7 7d ago

I don't mean at the binary level with compiler flags.

I mean in the "a purpose built library is probably better and fastee than my generalist ass could build myself" way.

Maybe I can write something that can kinda sorta parse html for a project I might be working on, but I'm not going to outperform, or out-correct BeautifulSoup.or even htmlparser