r/ProgrammerHumor • • 16h ago

Meme wheneverISeePythonCode

Post image
214 Upvotes

21 comments sorted by

View all comments

4

u/intoxicuss 16h ago

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

6

u/_letitsnow 12h ago edited 11h ago

If easy means having 20x more lines, I agree

4

u/reality_boy 15h 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.

3

u/intoxicuss 13h 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.

1

u/Scolmann 6h 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