I’m sorry to disagree with you. The difference is between “compile-time
typechecking” and “run-time typechecking”. The former can only be done
in a OO language featuring function-overloading and virtual functions.
This is true, but to be pedantic, that’s just getting the compiler to do work
you could do manually.
That’s not pedantry. I don’t know what that is, but if you believe
that is a valid argument for any reason, how exactly do you justify
not writing your software as machine code bit by bit?
And about that translating to C by the first C++ compilers … During the
translation a lot of extra variables and macro’s where inserted, e.g.
in order to generate unique function names for each method and function.
It is not completely impossible to do this by hand of course, but why
would you?
To have cleaner, safer, and more easily understood code. I wrote a lot of
object oriented C code both before and after C++ became available. It wasn’t
fully OO, just enough to make the code as robust as I wanted it to be.
I believe doing more things “by hand” neither makes your project
cleaner, nor safer, nor necessarily more easily understood. If a
necessary action could be an implicit action of your code, doing it
"by hand" does not make it cleaner, it makes it more cluttered.
Writing more code, and more complex code, does not make your code
safer, it makes it more error prone and dangerous. Your code might
be more easily understood, but only if we regard the implicit actions
of non-“by hand” code (implicit actions provided by your programming
framework: language, libs, runtime, SDK, etc.) to be more challenging
to comprehend than the code itself. This is sometimes the case: some
programming languages and SDKs are very complex, convoluted, or
difficult to understand, but I don’t think anyone would argue that is
the case when comparing ML to C (if anything, C is the more convoluted
one, due to things like side-effects, type casts, and pointer
arithmetic.)
These days I write mostly in C, and use C++ whenever the project benefits from
being more completely object oriented. C++ or C# tend to be overkill for some
projects, especially embedded systems work.
I agree, I enjoy using C more than C++, but only because of how many
times I’ve been stung by the vile temptress of template programming!
When my performance bottleneck is in the programmer, I choose to use
Python or Javascript in place of C or C++.On Mon, Feb 16, 2009 at 2:26 PM, Jeff Post <j_post at pacbell.net> wrote:
On Monday 16 February 2009 07:55, W.Boeke wrote:
–
http://codebad.com/