M
Mirco Wahab
Hi Scott
your summary looks very concise and
good to read. I'd like to make some
minor additions,
So, al-imho, C 'abstracts out' some consistent
'von-Neumann' or 'Harvard-' machine from any
architecture where its ported to. And that
is - imho - the main strength of C.
It covers well most machine code vs. C instruction mapping (~1:1),
and RAM storage vs. coressponding data representation (1:1),
as you said partially.
It can't handle any aspect beyond these simple
mappings in its language core, this is where
more complex bulding blocks (libraries) will
come into play.
I would say, from my own experience, that you wouldn't
use all C++ features in all C++ projects. Most people
I know would write C programs 'camouflaged' as C++,
that is: write clean & simple C - and use some C++
features e.g, class bound methods for interfaces -
but no inheritance at all (use compound objects) and
no exceptions (handle errors 'the olden way').
Regards
M.
your summary looks very concise and
good to read. I'd like to make some
minor additions,
C can express neither exceptions nor coroutines (nor their fancy cousin,
continuations), which could be and were expressed in assembly. Nor does
C provide memory management. A few library functions give you some
primitives to roll your own, but garbage collection is out of the
question (despite Hans Boehm), because the language does not carry
enough infrastructure to find type information through introspection.
So, al-imho, C 'abstracts out' some consistent
'von-Neumann' or 'Harvard-' machine from any
architecture where its ported to. And that
is - imho - the main strength of C.
It covers well most machine code vs. C instruction mapping (~1:1),
and RAM storage vs. coressponding data representation (1:1),
as you said partially.
It can't handle any aspect beyond these simple
mappings in its language core, this is where
more complex bulding blocks (libraries) will
come into play.
In exchange for these losses, the C programmer can write code that
executes in response to an external signal and yet does not create a
total hash of the internal memory structures. That kind of thing is
important in an OS, and something few languages (including C++) can do.
If you intend to study C++, study C first (it is easier to grasp), as
almost everything you learn in C can be used in C++. C++ is a "big"
language, while C is a "small" one; it will take much longer to "know"
C++ even though C++ started with the goal of being "C with objects."
If you are interested in languages, reading "the Design and Evolution
of C++" is a great base; it explains how C++ got the way it is from its
initial design goals.
I would say, from my own experience, that you wouldn't
use all C++ features in all C++ projects. Most people
I know would write C programs 'camouflaged' as C++,
that is: write clean & simple C - and use some C++
features e.g, class bound methods for interfaces -
but no inheritance at all (use compound objects) and
no exceptions (handle errors 'the olden way').
Regards
M.