[SystemSafety] Candidates for the firing squad
Olwen Morgan
olwen.morgan at btinternet.com
Fri Sep 21 15:46:39 CEST 2018
I have considerable sympathy with these views and often find myself
wanting to use C++ simply to get abstract data types. (Note, I do not
mean I'd use OO programming, which IMO is something that, at least with
widely used "OO" languages, leading software engineering up a blind alley.)
After having written a C++ coding standard for BT back in the 1990s, I
decided that C++ was such a cr at p language that I'd never use it and
would leave any project that did. There is no doubt that, restricted to
a suitable subset, and with proper tools, C++ can be used safely.
Unfortunately, C++ allows lumpenprogrammers to produce worse messes much
more easily than C does. Even though I know how to use it safely - and
that's probably with even greater restrictions than David Crocker might
propose - there comes a point where one is so surrounded by people who
won't use it safely that it's just too frustrating to be working with them,
O
On 21/09/18 09:26, David Crocker wrote:
> This is one of many reasons why I much prefer writing in a subset of C++
> to C. In C++'11 and later you can specify the underlying type used to
> store your enumeration. It's obviously sensible to to have a coding rule
> that requires you to use that facility when declaring an enumeration.
>
> David Crocker, Escher Technologies Ltd.
> http://www.eschertech.com
> Tel. +44 (0)20 8144 3265 or +44 (0)7977 211486
>
> On 21/09/2018 07:12, David Haworth wrote:
>> Typical example: a range check on an enumerated type. Because
>> the signedness is implementation-defined, if you test for < 0
>> you'll get a warning (expression is always true) sometimes.
>> But you can't leave it out ...
> _______________________________________________
> The System Safety Mailing List
> systemsafety at TechFak.Uni-Bielefeld.DE
>
--
Olwen Morgan CITP, MBCS olwen.morgan at btinternet.com +44 (0) 7854 899667
Carmarthenshire, Wales, UK
More information about the systemsafety
mailing list