r/Python • • May 02 '20

Discussion My experience learning Python as a c++ developer

First off, Python is absolutely insane, not in a bad way, mind you, but it's just crazy to me. It's amazing and kind of confusing, but crazy none the less.

Recently I had to integrate Python as a scripting language into a large c++ project and though I should get to know the language first. And let me tell you, it's simply magical.

"I can add properties to classes dynamically? And delete them?" "Functions don't even care about the number of arguments?" "Need to do something? There's a library for that."

It's absolutely crazy. And I love it. I have to be honest, the most amazing about this is how easy it is to embed.

I could give Python the project's memory allocator and the interpreter immediately uses the main memory pool of the project. I could redirect the interpreter's stdout / stderr channels to the project as well. Extending the language and exposing c++ functions are a breeze.

Python essentially supercharges c++.

Now, I'm not going to change my preference of c/c++ any time soon, but I just had to make a post about how nicely Python works as a scripting language in a c++ project. Cheers

1.7k Upvotes

219 comments sorted by

View all comments

Show parent comments

3

u/Schmittfried May 02 '20

Almost nobody cares.

-6

u/_370HSSV_ May 02 '20

And that's why you're always gonna be in the amateur category of programmers

1

u/super-porp-cola May 03 '20

Are you telling me that when you need to write a quick and dirty script to scrape a webpage, you'd rather spend an hour writing a C++ script that runs in 1ms than 5 minutes writing a Python script that runs in 100ms?

0

u/Schmittfried May 05 '20

Sure kiddo.

0

u/_370HSSV_ May 05 '20

Nice try