M
MikeP
"OMG", Leigh is back? Hi Leigh. How did that affair with you and Paul
work out?
work out?
Alf said:However, it illustrates that one often is willing to sacrifice some
efficiency in order to have simple, general, easy to follow rules.
It may be that the quality of the code as a whole improves by having
simple rules, even though that means non-optimal code for some
special cases.
Ebenezer said:The class in question is something that might be found in a library.
Every library writer I know is willing to learn some more of the ins
and outs to improve their library. If the library author does his job
well, users don't have to be aware of the complexities of the library.
jacob said:Le 25/05/11 12:15, Rui Maciel a écrit :
Yes, you are right in principle. It is conceivable that a huge
program uses only a small fraction of its executable foot print
and all of it fits in the cache.
Premature optimisation means performing "optimisations" before you have
sufficient knowledge to determine what is actually optimal.
I get really tired of how this quote is abused (I'm not accusing you of
abusing it, I'm speaking generally).
When Knuth wrote that, he was writing in the context of of algorithms.
Why C++ is vastly superior to C:
http://warp.povusers.org/programming/cplusplus_superior_to_c.html
"In conclusion, the reason why C is so vastly inferior to C++ as
described in this article can be summarized with one single sentence:
C has no support for RAII nor templates, while C++ does. That's two
of the most important features that make C++ by far the superior
language."
Lynn
Virchanza said:So what use is C nowadays? The answer is that the standard for C
is much simpler than C++ and so it takes far less man-hours to produce
a C compiler for any given platform. I've programmed microcontrollers
in C, purely because there was no C++ compiler available (PIC
microcontrollers). C is far more prevalent than C++ in the land of
microcontrollers.
Virchanza said:C is far more prevalent than C++ in the land of microcontrollers.
The functionality of C++ is a superset of the functionality of C.
So of course C++ has more features and functionality. Even if you have
a preference for "C style programming", you can always choose to use a
C++ compiler to compiler your code without using any of the C++-
specific features such as templates and classes.
So what use is C nowadays? The answer is that the standard for C
is much simpler than C++ and so it takes far less man-hours to produce
a C compiler for any given platform. I've programmed microcontrollers
in C, purely because there was no C++ compiler available (PIC
microcontrollers). C is far more prevalent than C++ in the land of
microcontrollers.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.