Re: [PATCH] C++ breaks on linux/ioport.h

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Mon May 01 2000 - 15:52:35 EST


On Sun, 30 Apr 2000, Sean Hunter wrote:

> > You also need to provide an interrupt safe, thread safe and smp safe lockless
> > exception handling mechanism for the C++ exceptions. You can't really avoid
> > that as you will want to do memory allocation and a memory allocation can
> > and must fail gracefully.
> >
>
> I'd just like to emphasise that Alan is showing a greater knowlege of
> C++ than its advocates here. Specifically, the Ansi C++ standard
> requires that (for example) bad_alloc exceptions are thrown if c++
> memory allocations fail.[1]
>
[SNIPPED...]

It's interesting to observe the advocates of a specific computer
language. Most often a discussion about a particular compiler
of similar tool results from the failure of persons to understand
the basic nature of any computer language.

Computers don't communicate very well, even with other computers.
When humans try to communicate with them, they have to use certain
tools. These tools may range from devices such as keyboards to
software tools such as compilers and editors.

Since computers don't understand the human languages very well,
although there is continual work in this area, humans have to
learn computers' languages. Since the computers' internal languages
do not interface well with human languages, we have created tools
to translate. There are called assemblers, compilers, and interpreters.

Every one of these tools, and probably those to be created in the
future, pose major communications and control limitations. It becomes
necessary, for programmers using these tools, to provide work-arounds
for the limitations of these tools.

An expert in a particular computer language is really an expert in
the work-arounds necessary to use this language to perform useful
work. An ideal computer language would do exactly what it was told
simply from reading a specification. In the absence of a specification,
it would ask enough questions to produce such a specification, then
it would generate the code necessary to perform the specified functions.

So a programmer becomes a captive of the tools used to communicate
with the computer. With experience, the programmer starts to identify
with its captors and starts to believe that the language mastered,
is in fact, the only true language. Once captured, the programmer
becomes an advocate. Psychology teaches the name of this effect
as the "Stockholm Syndrome". It was first recognized during the
detention of World-Games competitors in Stockholm, Sweden.

You see this problem mostly with programmers who have mastered only
one language. If you have been around computers since 4-bit
nibbles on paper-tape, you have long ago abandoned the notion
that there is only one true language. But the first language you
truly mastered still seems to have been the best. The Stockholm
Syndrome affects us all to some extent.

I advise to not get trapped into the notion of the "correct" tool
for a particular use. Just because you have become expert in C++,
don't presume that it is the "correct" language for the kernel.

Even C has its shortcomings which have to be handled with assembly
language extensions. A Master Carpenter has many tools and is
expert with most of them. If you only know how to use a hammer,
every problem begins to look like a nail. Stay away from that
trap. It bytes (sic).
 

Cheers,
Dick Johnson

Penguin : Linux version 2.3.41 on an i686 machine (800.63 BogoMips).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:09 EST