:: Re: [DNG] Why C/C++ ?
Top Pagina
Delete this message
Reply to this message
Auteur: karl
Datum:  
Aan: dng
Onderwerp: Re: [DNG] Why C/C++ ?
Hendrik Boom:
> On Thu, Aug 08, 2024 at 09:35:50AM -0500, o1bigtenor via Dng wrote:

...
> > Why is C/C++ so absolutely wonderful?


C is a really nice language compared to assembler.
Though at the time, the assembler of e.g. MC68000 was
a little high level lang. inspired with mult. adressing
modes.

As with assembler, you can make the program work with very
low memory usage, useful for small microcontrollers.

In C, you program close to the hardware, unless you happen
to have an "interfering" operating system. On the other
hand, the OS is probably written in C since it has to be
close to the HW. Though, C doesn't work well with processors
that don't have 8 bit bytes.

C is a standard, there is lots of litterture about it as well
official ISO standard documents describing it.

In C the motto is: trust the programmer, the backside of that
is the programmer needs to be aware of many strange things,
mostly related to "undefined" behaviour and nitty-gritty details.
It is somewhat easy to make hard to find mistakes.

C syntax has inspired other languages, so even if you don't want
to use C, you can learn a little C to make it easier to learn
other languages.

C is one of the few remaining compiled languages that remain,
most other ones are interpreted or have a "runtime" abstraction,
e.g. pascals p-code.

And as grand prize:
C has inspired a semi annual competition to make the most
unreadable code in style:
https://en.wikipedia.org/wiki/International_Obfuscated_C_Code_Contest

///

I don't know much about C++ good points, except it allows you
do things more generally, more object oriented. It so to say,
allows you to write "cleaner" code in a more mystified way.

A bad thing with C++ is that the object files are linker dependant
so if you update or change the system linker, you might need to
recompile everything. The way around that is to build your program
static with as few external references as possible. That is why
boost is distributed as a set of header files with no "source" files.

...
> It was a breath of fresh air in the 1970's, but by now language
> technology has advanced a lot since then.

...

Ack, I loved it then (80's), still do.

Regards,
/Karl Hammar