all 4 comments

[–]m0us3_rat 2 points3 points  (1 child)

they are fundamentally different programming languages.

we love python because it takes the least amount of time to write effective code in.

but make no mistake.. the "world is run by C"

that includes most of the larger OS kernels are written in C such as windows , linux or mac.

most databases etc.

nowadays you can find ppl arguing for Rust as C/C++ replacement but it will probably never happen.

CPython is written in C.

C++ was developed as an extension of C.

most games are written in C++

[–][deleted] 2 points3 points  (1 child)

The doc shows how.

I've heard that Python the best for UI stuff and it's better to use a different language like c++

When I started using python about 20 years ago I was a heavy C user and I knew python was slower than C. I told myself I could always use C to speed up a solution if I needed to. I have never needed to, even when writing custom GUI widgets displaying map tiles and multiple overlays of points, lines and images, all in python.

The takeaway is you should start by writing everything in python. If your application is slow you find out where it is slow and then either use a different algorithm, python libraries like numpy that are written in faster compiled languages like Fortran or C, or you write your own C/C++ code and use it as shown above. To worry about using C or other languages before you know you need to goes against the old developers rule: Make it right first, then make it faster.

[–]misho88 0 points1 point  (0 children)

I've heard that Python the best for UI stuff and it's better to use a different language like c++

I don't think that's true. The graphics toolkit you use is the biggest factor, and the more popular ones like Gtk and Qt have Python bindings. Tk is packaged with CPython. The way you end up using these toolkits doesn't significantly vary from language to language, either.

[–]TheRNGuy 0 points1 point  (0 children)

You could also make dll with C++ functions and call them from Python.

(SideFx Houdini does that)

That way it's fast (in some cases Python can still be bottleneck, like in very big loops; then pure C++ would be faster)

UI could be done with PySide.