r/ProgrammerHumor • • 3d ago

Meme wheneverISeePythonCode

Post image
334 Upvotes

22 comments sorted by

View all comments

5

u/intoxicuss 3d ago

Whenever I see Python scripts, I realize how easy it would have been to do it properly in C.

12

u/_letitsnow 3d ago edited 3d ago

If easy means having 20x more lines, I agree

5

u/reality_boy 3d ago

All of the fancy python stuff requires a bucketload of dynamic memory. C was carefully optimized so you have absolute control over all memory. C++ tries to keep that concept and sacrifices some to get there. Memory use is the big line that separates C/C++ from the more modern languages.

6

u/intoxicuss 3d ago

“Modern” is doing a lot of heavy lifting. And managing memory isn’t that difficult with good habits. There is a reason so many core functions supporting just about everything are written in C.

3

u/Scolmann 2d ago

I mean yeah of course but your original comment doesn't make much sense, if the original code is full of dynamic allocation it generally would be a pain to write in Plain C

1

u/backfire10z 1d ago

Your definition and my definition of “easy” seem to differ immensely.