Re: Simplicity has a future
- From: "Mike S" <mgspross@xxxxxxxxxxxx>
- Date: 31 May 2006 14:10:21 -0700
jacob navia wrote:
[...]
C++, because of the very high learning curve, stays in the way of people
doing the JOB they want to do with the language.
<OT style="all my responses are OT, not just this part">
IMHO the "learning curve" associated with C++ has more to do with
learning the precepts of Object-Oriented Programming than the language
itself. If you have a solid understanding of OOP, then a lot of the
"complexity" of C++ disappears.
</OT>
C has less surprises, less to learn, and uses FAR LESS MEMORY.
C uses far less memory? If you mean a program written in C will compile
to a smaller executable than a comparable program written in C++, then
I can't believe that claim at all. Whether or not you can consistently
get your C compiler to spit out smaller executables than your C++
compiler for a similar piece of source code is more likely because the
C compiler generated better object code than the C++ compiler. Hell, if
I compile a C++ program to run in legacy 16-bit mode on my x86, I'll
bet it'll be smaller than the corresponding C program written to run on
32-bit Windows, by virtue of the fact that sizeof int will likely be 2
bytes smaller in the 16-bit version, *and* the fact that I can compile
the 16-bit version to a flat binary file, whereas the Windows version
will have to be packaged into the Portable Executable (EXE) file
format, which will invariably bloat the resulting program with EXE
headers, relocation tables, etc. My point is that the size of compiled
programs in either C or C++ (or any language) is more dependent upon
a) how well the compiler can generate object code for the given
language, including how well it can optimize the code
b) which machine you're compiling on and/or the target OS. E.g. if a
particular CPU has a single machine instruction equivalent to
printf("hello world\n") (let's assume stdout goes to a terminal on this
platform), then a "hello world" program you compile on that system will
probably be much smaller than it would be processors that don't support
the PRINT HELLO WORLD instruction.
As for "C has less surprises", I have two words: undefined behavior ;-)
Not only RAM, that nobody cares too much, but HUMAN MEMORY, a far more
precious resource than RAM!
The memory footprint of a language is the amount of data your brain
must load into your neural network to be able to use that language
efficiently.
Well, I don't usually sit down at my computer, ready to program, and
then wait 15 minutes while I "load" a page-for-page copy of the latest
C Standard into my brain. You learn a language by using it, not by
memorizing it.
People that reject a language where they can't possibly know what
are they calling, aren't stupid. The contrary is true. They just
follow the KISS principle!
KEEP IT SIMPLE!
Again, I don't think C++ is overly complex. I think it *can* be. That
is, the programmer is the one who controls how complex his code is - it
is fairly easy to obfuscate C++ code, but there are ways to
de-obfuscate it as well (such as the "using [namespace];" directive to
prevent code from being polluted with namespace qualifiers). The core
language isn't really that hard to grasp, especially if you already
have a knowledge of C and, as I mentioned, you understand the basics of
OOP.
Mike S
.
- References:
- Simplicity has a future
- From: jacob navia
- Re: Simplicity has a future
- From: Tomás
- Re: Simplicity has a future
- From: jacob navia
- Simplicity has a future
- Prev by Date: Re: C Pointer problem
- Previous by thread: Re: Simplicity has a future
- Next by thread: Re: Simplicity has a future
- Index(es):
Relevant Pages
|