0
Which language is faster: C, C++, Java or Python?
5 odpowiedzi
+ 1
C is not "more primitive", nor is C++. C (together with Cpp) is a lower level language, meaning it can speak directly to your hardware without any translation (not exacly, see my answer below). On the other hand, high level languages like python have to be translated down, even a couple of times, before they can run, which increase their execution time. You can find compares on the internet, C++ algorithms tend to run like 30% faster than pythons
+ 3
C, since its more primitive.
+ 1
C/C++ are basically the same language (C++ being a superset of C) so they are basically as fast as each other... Java and Python are higher level languages, so they are (usually) slower than C. You can sometimes go as fast as C, however
0
@Paul: C/C++ is compiled, it needs translation to work with your machine...
0
oh I know it is compiled, but the compilation together with execution takes so much less time than code from high level languages, so it was my point. and in Cpp you can include pure assembler code on the fly, which ofc have to be translated too, but the translation is fast and the execution in sped up. About the compilation tho: languages like c# have something like intermediate language to which they are compiled and then from there they are compiled to machine code, so that is something new. And it is not anly about the compilation ofc, it is more the level of the language that matters