alternative joke
C++: “Hey, what’s your name?”
Python: *grabs C++* “what is my name?”please explain I want to laugh
one of python’s strong suits is it’s foreign function interface. it’s very easy to call code in other languages from python, which can speed execution up significantly
oh alright. Cheers, heheh. I laughed
One of the main implementations of Python is CPython, which is written in C or C++
It’s now cannon in my head that Python talks like Parappa the rapper
I know people joke around about this a lot. But I was blown away by a recent switch to I did from using cv2 with python to using cv2 with C++.
I had literally hundreds of thousands of images to analyze for a dataset. My python script would have taken 12 hours.
I ported it to C++ and it literally destroyed it in 20 minutes.
I’m sure I was doing something that really wasn’t optimized well for python. I know somewhere in the backend it probably was using a completely different library with multi thread optimization. Or maybe turbojpg is just garbage in python. I’m still not even sure what the bottleneck was. I don’t know enough to really explain why.
But holy shit. I never had that much of a performance difference in such a simple task.
Was very impressed.
If you had let me write the C++ code, I could have literally destroyed your dataset in a couple of seconds.
I don’t even need C++ for this just give me a rm with a side dish of -rf
Exactly what this comic is saying. C++ can handle in 20 minutes what takes python 12 hours, but something gets destroyed.
But make sure to bill for the full 12 hours.
Was a personal project. But absolutely. Half my job is trying to explain why something is taking so long when in reality I actually it’s already done I just don’t want to do nothing for the next few days.
Managers never really know. And other engineers don’t care. It’s all about balancing expectations.
Might be latency? Python is probably slower to respond to things like when one job is done and the next job can start, since it needs time to interpret the code and call the relevant C libraries.
This has got to be the best, most legitimately funny programmer/computer joke I’ve seen in years.
I thought that too! :D
Python’s core implementation is in C though. It’s just a fancy way to call C libraries.
You could say this about a lot of things…
I code in JS, so I’m something of a C dev myself!
Beginning your sentence with “I code in JS” really makes any follow-up statement sound sane in comparison.
Aschhually the most used JS engine is made in C++ (v8)
Python is actually pretty baller with string operations too since so much of the C has been heavily optimized.
so?
It might not be a language but a skill issue if your python code performs significantly worse than your C code
JavaScript fits too
Javascript’s still arriving to the meeting
Javascript took the wrong turn and ended up in [object Object]
NaN
It’s interesting that, with Python, the reference implementation is the implementation — yeah there’s Jython but really, Python means both the language and a particular interpreter.
Many compiled languages aren’t this way at all — C compilers come from Intel, Microsoft, GNU, LLVM, among others. And even some scripting languages have this diversity — there are multiple JavaScript implementations, for example, and JS is…weird, yes, but afaik can be faster than Python in many cases.
I don’t know what my point is exactly, but Python a) is sloooow, and b) doesn’t really have competition of interpreters. Which is interesting, at least, to me.
deleted by creator
$ python3 -c 'f = (lambda x: x + 0.5 - 0.5); print(f(2**52))' 4503599627370495.5deleted by creator
deleted by creator











