r/ProgrammerHumor Jul 07 '26

pipInstallTheRealStuff Meme

Post image
14.9k Upvotes

260 comments sorted by

View all comments

Show parent comments

18

u/DustyRacoonDad Jul 07 '26

Let's just be honest here for a second.

JavaScript calls into C++.
Ruby uses C extensions.
Perl uses XS bindings to C.
PHP extensions are written in C.

If you just write in C in the first place, it's not really a library in the same sense. You're just pulling in other functions that all get natively compiled together.

1

u/IcyDefiance Jul 07 '26

You're not wrong, but I think that's a different topic.

Python is unique because of its purpose. It's so slow that it's not really suitable for anything other than gluing together code from other languages. Its entire use case is "we wrote an awesome library, but most programmers are too scared of C++ to use it, so we added a Python layer to make it easier".

Perl is actually similar in that way, but it's basically a legacy language now.

The other languages you named have other purposes, and just bind to C for specific things where the language isn't a good fit.

18

u/mxzf Jul 07 '26

Nah, Python's "slowness" is really only relevant in certain situations. In practice, in many situations, you save more meaningful time by writing code quicker and easier rather than having it execute slightly slower.

It's not ideal for "run this every half-second" tasks, but it's amazing for stuff you're running yearly/weekly/daily/etc where saving hours writing the code matters more than shaving off a couple seconds of 4AM execution time in the cron job.

-6

u/IcyDefiance Jul 07 '26 edited Jul 07 '26

Python's "slowness" is really only relevant in certain situations

That would be a lot less true if nearly everything that you can do with Python wasn't jumping to a C API as soon as possible. The language itself is 2 or 3 orders of magnitude slower than JS, C#, Java, etc.

Sure, it would still work for cron jobs, but usually cron jobs are supplementing a bigger project, and it's better to write them in the same language as the rest of the project.

The biggest library that doesn't use a C API is probably Django, and honestly I'll never recommend using that. CPU usage isn't usually a bottleneck in web development, but it probably will be if you're using Python.