Re: Simplicity has a future



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

.



Relevant Pages

  • Re: "STL from the Ground Up"
    ... high-level intermediate language than can interoperate with many other ... If your language lacks expressive features then you cannot write code ... memory management in comparison. ... Mostly because type errors mean that the programmer and compiler disagree ...
    (comp.programming)
  • Re: A note on computing thugs and coding bums
    ... It would handle international characters if the execution character ... method I used in "Build Your Own .Net Language and Compiler". ... work areas and counting on Nul is an illusion. ...
    (comp.programming)
  • Re: WaitForSingleObject() will not deadlock
    ... represent an incorrect implementation of the language. ... the *compiler* does not guarantee this. ... but to state it in terms of the execution instead of the formal semantics of the language ... as long as the optimizations do not change the semantics of the language). ...
    (microsoft.public.vc.mfc)
  • Re: subroutine stack and C machine model
    ... Use a compiler optimizer ... higher determinism means that optimizer has more information. ... C programmers like to brag that their "language" is more ... prospective computer science majors at Princeton. ...
    (comp.lang.c)
  • Re: "STL from the Ground Up"
    ... are not features of a language. ... To support reflection you make a compiler embbed type and functional information in the compiled program. ... When the OCaml compiler is given a complicated nested pattern match it ... virtual const Base *clone= 0; ...
    (comp.programming)