C++ vs Python vs Mathematica vs Matlab? Whats the difference

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
8 replies · 13K views
Lagraaaange
Messages
82
Reaction score
0
What are the differences and pros/cons of each?
 
Physics news on Phys.org
C++ and python are general purpose programming languages. Matlab is a numerical computing platform. Mathematica is a symbolic computing platform.

The pros and cons depend on the desired use. Generally things are faster to program in python but faster to execute in C++. Matlab and Mathematica have different purposes.
 
There's also another kid on the block: Julia with a syntax similar to Matlab but with speeds orders of magnitude faster than Matlab ie near C/C++ speeds. Julia is especially useful for organizations that prototype algorithms in MATLAB and then convert them to C/C++ for production. With Julia, they don't have to spend developer time recoding and optimizing the Matlab code.

Julia Interoperates well with both Python and Fortran which is useful for handling legacy code and it's free.

The one thing Matlab has over Julia is its developer environment and its large base of tutorials, packages and tool kits.
 
  • Like
Likes   Reactions: FactChecker
It might help if you can narrow it down to an environment. MATLAB/Simulink is dominant in Engineering. It's expensive unless you are a student or work somewhere that already has it. Python is the hot new programming language. It is free. Julia is free. Neither Python nor Julia have the equivalent of Simulink (a diagram-based simulation tool). Where I work, we auto-generate code from Simulink diagrams. I don't know about Mathematica.
 
Dave Sanders on youtube has some good tutorials on Julia using the iPython notebook IDE which is really cool especially for presenting your work in an academic session.
 
I have zero programming knowledge.
 
As a first programming language I would not recommend C++. If you have easy access to Mathematica then it is a great platform for generic science and math. Otherwise I would probably recommend starting with Python. After either or both of those you might go to C++, particularly if you need a lot of speed.