this post was submitted on 25 Aug 2023
761 points (87.6% liked)
Programmer Humor
32410 readers
164 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I think you're near enough alone... Python is up there with the best ways to call other people's code, due to the support for types beyond string...
So you're wasting hours of development time to save a couple of milliseconds of run time.
If that's your only criteria for choosing a language, you're gonna have a bad time.
To be fair, sometimes that runtime difference matters. That’s why it’s C++ and python is a fairly common skill-combo amongst devs. But the fact that this dude is basically bragging about writing shell scripts as if that’s something an experienced dev couldn’t figure out tells me that they don’t really know anything about when you would choose either.
If they had mentioned the Global Interpreter Lock or dynamic typing maybe they would have had some sort of real case for why you should avoid python in certain situations.
Totally agreed the run time difference matters sometimes. In my experience it's hasn't been the case for scripts, as they are generally small in scope in comparison to C++ applications.
Agree 100%. At work I write my code that needs to be performant in C++ and scripts in python. I wouldn’t even dream of writing a script in C++.
Slower than bash? Especially in bash script where it calls other utils?
“New processes have no overhead!” - this idiot probably
Tbh I think we should just ignore them. They clearly have no interest in actually learning anything.
Maybe you should check how python compares relative to shell scripts before you comment. You’re making it very apparent that you don’t actually know what you’re talking about. Regardless of how slow python is, it is significantly faster than bash, or any other shell language purely by virtue of the fact that shell languages are primarily glue between other programs. Spawning a new process has a ton of overhead, which you would know if you were capable of doing anything other than projecting.
You’re also woefully unaware that it is completely possible to write python bindings for C++ code, which many popular libraries do. In practice python is not as slow as you think it is. That’s not even considering the fact that python 3.12 increased performance of the language.
It’s not perfect for everything, but this performance argument shows that you don’t know enough to understand why that isn’t really a drawback for writing scripts, which is undeniably an area that python excels at.