On Monday 01 June 2009, Rick Altherr wrote:
> C and C++ are both strongly typed

I'm used to definitions of "strong" typing that preclude the inability to
break out of the type system.  C makes that trivial:  cast to/from "void *"
pointers, and you're done.  That's because it was intended from the
start to be a low level language, for systems programming, which doesn't
hide the machine-specific details that "strong" typing does.

It is however worth pointing out that there are dozens of definitions
of what "strong typing" is ... although this is the first time I've ever
heard anyone apply that term to C.  (Since I first found a looseleaf
binder of line-printer output, called "The C Programming Language", in
one of the libraries at Case Western.  The printed/bound versions weren't
very available!)

C++ adds a few type frameworks to C, yes, but still doesn't have what I'd
call "strong" typing.  (Plus, all its dynamic/reinterpret/static/const
cast mechanisms get confusing.)


>        but proper use  
> of an abstract type can greatly simplify the implementation as the  
> efforts to simplify the target APIs has shown. We are already adopting  
> most of the encapsulation paradigm for targets and ADTs build on that.  

Encapsulation != strong typing (and vice versa!).  And I still stand
by my observation that I've usually seen *team* approaches to strong
typing fail, when they need to be built with weakly typed languages.
The dynamics rarely support it as the code base evolves.

However, I'm all in favor of evolving code to respect clearly defined
data types, which encapsulate roles and responsibilities to support
better system structures.  If there's a better way to do it, I've not
yet come across that answer.  :)


> I think that a well thought out implementation of an abstract target  
> type and interface will do wonders to the code base and maintenance.  
> Using encapsulation will make this even better for future expansion  
> and enhancement. 

All that's true, but it's still very different from "strong typing"
(using any definition I've worked with).

:)

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to