Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Why don't you ask the converse question? Unlike C++, Python can give you <a href="http://xkcd.com/353/" rel="nofollow noreferrer">antigravity</a> and summon <a href="http://xkcd.com/413/" rel="nofollow noreferrer">souls</a> via its <code>import</code> command. On the other hand, C++'s 'equivalent' -- <code>#include</code> -- only allows you to get some boring I/O and math libraries.</p> <p>Seriously though.. C++ allows you to do more low-level stuff e.g. kernel programming, and allows you to write programs that run much faster (<em>approximately</em> ~20x). <strike>You can use it to create real threads that can take advantage of multiple-cored processors, while Python (<a href="http://jessenoller.com/2009/02/01/python-threads-and-the-global-interpreter-lock/" rel="nofollow noreferrer">due to its design</a>) can generally only run its simulated threads on a single core.</strike></p> <p>IMHO you should learn both; Python for web development and quick-and-dirty scripts, C++ to write systems code, desktop applications, as well as to have a better low-level understanding of the computer. If you're just starting out, then Python; it's much easier to begin with.</p> <p>More concrete measurements on the speed difference can be found <a href="http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&amp;lang=python3&amp;lang2=gpp&amp;box=1" rel="nofollow noreferrer">here.</a></p> <p><b>Edit:</b> Seems like my information on multi-threading is out of date; see John Paulett's comment.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload