Fastest Laguage

c or c++ which is faster and why ?
C. The '++' part creates a lot of drag on C++ at high speeds. C>> is really fast.

Edit for srs business: What speed do you mean? Execution? Compiling? Development time?
Last edited on
AFAIK, there isn't a notable difference in compile time or execution time.

I'm sure someone will come and just smash that statement at some point...
I don't know much about the differences between programming languages.

I'm sure if there was one superior language news of it would be plastered all over the internet and everybody would be using it.
Just about anything that can be done in C can be done the same way in C++. So the two languages are comparable.
C++ is a direct descendant of the C language; C++ retains almost all of C as a subset and it offers better ways to do things and of course some brand new capabilities.

In addition you don't need to know C in order to learn C++.

EDIT: I never really compare speed between two programming languages (i don't really care much about speed either) but since C++ is newer than C then i'd say C++ is faster? if not then they're probably the same speed, who cares anyways, they're both great for almost anything.
Last edited on
either one can be faster or slower: see

http://benchmarksgame.alioth.debian.org/u64q/cpp.php#faster-programs-measurements for example
Last edited on
Standards:
http://xkcd.com/927/

Of course, if you write in lower-level code, it will be faster than high-level code. It would be a pain in the arse to maintain if it gets big, but it would be faster....
Just about anything that can be done in C can be done the same way in C++. So the two languages are comparable.


Agreed, it depends on what you are writing, as a basic example, this C code is faster:
const char* str= "Hello";
Than this:
std::string str = "Hello";

But if you wanted to make "Hello World" with either one of those, C++ would probably be faster because it probably allocated more space than it needed for just "Hello". In C you would have to figure out lengths, allocate manually...
I'm pretty sure that would only be a millisecond if that difference in the two hello worlds.
if that.
closed account (Dy7SLyTq)
couple of things:
a) @giblit: its just a test to scale it to larger software
b) @op: speed is only comparable if the code is equivalent and even then it can vary from compiler to compiler. i can write assembly code, and there is no guarantee that it is faster than someone writing it in python because mine could be really obtuse while theirs is lean and mean.
c)
AFAIK, there isn't a notable difference in compile time or execution time.

i believe it varies from toolset to toolset. Cubbi would know better though
Topic archived. No new replies allowed.