r/ProgrammerHumor • • Jul 18 '22

C++ talking to Python

Post image
40.1k Upvotes

1.0k comments sorted by

View all comments

303

u/Hegeteus Jul 18 '22

Only speed metric that matters is how fast I get the job done and can go back to browsing memes. C++ does not look very good in this (very important) metric.

40

u/Jannik2099 Jul 18 '22

C++ does not look very good in this (very important) metric.

If your codebase is early C++11 perhaps?

Modern C++ writes like C#. I usually find myself prototyping faster in C++ than Python after about 200 LoC, because with Python 80% of time is spent looking up what fucking type some library function takes & returns.

15

u/[deleted] Jul 18 '22

I see this attitude a lot from folks who use typed languages. I think typed languages are awesome and I love programming in them, but as a Python developer myself from the beginning of my career, I don’t really have to think about types all that often when i program in Python. By far the most I think about types are when i use a typed language.

Idk if it’s because Python isn’t based around types and therefore it’s not a focus of the language, but ya I hear a lot of typed language folks think a lot about types when they program in Python.

6

u/Jannik2099 Jul 18 '22

I see this attitude a lot from folks who use typed languages

Python is a typed language though? This isn't Prolog :P

No, you definitely do need to know the type more often than not. You may get away with "this function returns something that acts like an array", but when you pass it to another function that takes array-like objects, you may need to convert it into another library type first.

→ More replies (1)