Results 1 to 9 of 9
Hello,
this might be very simple question but i want to dare to ask "what makes C language mote faster than any other language ".....
is there any forum only ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-21-2005 #1Just Joined!
- Join Date
- Aug 2004
- Posts
- 12
why c?
Hello,
this might be very simple question but i want to dare to ask "what makes C language mote faster than any other language ".....
is there any forum only for C Programming .........
javascript:emoticon('
')
- 09-21-2005 #2Linux User
- Join Date
- Aug 2005
- Location
- Italy
- Posts
- 401
C
C is not faster than any other language... C is a procedural (correct english?) imperative language, wich was designed for programming operating systems.
C should be (a little) faster than C++ because is procedural, so the compiled code should be simpler because the programming model: C++ is an object oriented language, and must take care about objects, garbage collector, derivations and so on... a C program istead "simply" execute routines, wich need only to allocate a frame on a memory stack.
Because OSes are written in C, all the OSes interfaces are C bindings, so if you write a C program you can iteract with the OS natively with any further latency caused by wrapper libraries.
But because C can create executable near to the machine architecture you can remove abstraction dependencies and write a very fast program.
C should be faster than Java, because Java is compiled Just In Time, during runtime, because Java don't generate a native code, but an intermediate assembly non architecture-dependent.
C should be faster than Visual Basic, because.... I must explain why? I don't think...
However, a C++ or Java program can be faster than a C program... that because humans write programs... if a C++ programmer uses a better algorithm? Or simply makes the thinkgs simpler in its program?
And what about fortran? Pascal? you can't generalize about the speed of program basing on the programming language, because there a lot of reason because a program is faster/slower than another...
NOTE: I like programming in C...When using Windows, have you ever told "Ehi... do your business?"
Linux user #396597 (http://counter.li.org)
- 09-21-2005 #3
Re: why c?
Originally Posted by dakoo
I would ask where you heard that quote. Different languages all have their strengths. I won't get into a debate about which is "inherently better" because I don't think any one language is. C is very popular for systems programming in Linux/UNIX, among other things, but so is Python/Perl/LISP...Registered Linux user #270181
TechieMoe's Tech Rants
- 09-21-2005 #4Linux User
- Join Date
- Jan 2005
- Location
- Florida
- Posts
- 414
If you want to talk about speed you should probably mention assembly. Of course, optimized code from c, or the like, is just about as fast but I would think that low level assembly would outstrip any compiled language.
Oh, and to make the most out of the speed of assembly you should use as little of it as possible.
registered linux user: 387197
- 09-21-2005 #5Linux Engineer
- Join Date
- Mar 2005
- Posts
- 1,431
As allready stated, other languages can be just as fast when programmed good, but if you use C, it's a lot lower-level language than for example python and perl, thus you usually write more functions yourself instead of using the generic functions with lots of features you don't actually use. However, if you import lots of prewritten libraries in C, it becomes at the level of the other programming languages. I belive java and python can be compiled as native linux code as well, for exampel by using gcj, thus making it run faster on linux-boxes.
- 09-21-2005 #6Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Not in the time it takes to write it, though!
Originally Posted by jimbaloo 
I think the reason for the popularity of C is that it's really a high-level assembler language - you can "feel the bits" with it, which most other languages only let you do with a lot of pain.
- 09-21-2005 #7Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
The Computer Language Shootout Benchmarks might be an interesting resource.
- 09-21-2005 #8
C++ is often considered slower, as it often is. This is because of two things:
1. As mentioned before, the Object Oriented model is a bit more complex
2. You have to link it against libstdc++, which is a big piece of overhead.
- 09-22-2005 #9Just Joined!
- Join Date
- Aug 2004
- Posts
- 12
got the reson for "why c?"
Hello ,
now i am in position to give reason "why c?".....
thanking you all.


Reply With Quote
