Help with a C program

R

Randy Howard

Richard Heathfield wrote
(in article
Well, I'm not a doctor. But in fact programming is vastly more complicated
than general medical practice. The doctor has just one (admittedly very
complex) system to worry about, and he can devote years to studying just
that one system. The programmer has to deal with a great many complex
systems at many different levels of abstraction - far more than the doctor
will ever face. (It is normally the case, however, that the stakes are
higher for doctors, since a mistake can cost a patient's life; whilst some
programmers do deal with safety-critical systems, this tends to be the
exception rather than the rule.)

Well, thinking about the number of planes, trains, automobiles,
ships, missiles, air-traffic control systems, traffic light
controllers, microwave ovens, power plants, xray machines, etc.,
etc., etc. in the world, I begin to wonder about what the
"exception" and what the "rule" really should be, especially in
the bounds of currently implemented C.

In fact, the more I think of it, the more I would like a signed
document from the companies producing such products to the
effect that the developers had all read and understood the CLC
FAQ prior to start of the programs involved. :)
 
C

Chris Hills

Randy said:
Richard Heathfield wrote
(in article


Well, thinking about the number of planes, trains, automobiles,
ships, missiles, air-traffic control systems, traffic light
controllers, microwave ovens, power plants, xray machines, etc.,
etc., etc. in the world, I begin to wonder about what the
"exception" and what the "rule" really should be, especially in
the bounds of currently implemented C.

In fact, the more I think of it, the more I would like a signed
document from the companies producing such products to the
effect that the developers had all read and understood the CLC
FAQ prior to start of the programs involved. :)

This is where the licensing of Engineers starts to come in.... It is
happening in a dozen or so countries now including parts of the US

What is being required is conformance to a defined process ie 61508,
60601-1-4 etc using tools that have been tested and or validated (eg
like the certified Ada compilers,). The standards like 61508 usually
call for things like static testing and, in the case of C a subset (like
MISRA-C) etc as well as the use of suitably qualified programmers. H

However the lengths you need to go to depends on the SIL rating of the
product. So in some cases requirements are very loose through to Safety
Critical systems (ie something vital in a passenger jet) whey you have
to implement al the rules.
 
R

Randy Howard

Chris Hills wrote
(in article said:
This is where the licensing of Engineers starts to come in.... It is
happening in a dozen or so countries now including parts of the US

It's not even remotely close to "happening" in the US. I wish
it would, but don't hold your breath.
What is being required is conformance to a defined process ie 61508,
60601-1-4 etc using tools that have been tested and or validated (eg
like the certified Ada compilers,). The standards like 61508 usually
call for things like static testing and, in the case of C a subset (like
MISRA-C) etc as well as the use of suitably qualified programmers.

I knew when I wrote the above that you would probably come back
with something about MISRA. MISRA doesn't prevent bad
programmers from writing bad code though. Sadly.
 
C

Chris Hills

Randy said:
Chris Hills wrote


It's not even remotely close to "happening" in the US. I wish
it would, but don't hold your breath.

http://www.acm.org/serving/se_policy/report.html
//////////////
Finding 1: The licensing of Software Engineers will happen in Texas (and
elsewhere) with or without ACM involvement.

The Texas Board of Professional Engineers is charged by the state
legislature with implementing and enforcing the licensing of
professional engineers (PEs). Since the Texas Board interprets the
legislative mandate as including software engineers, it seems inevitable
that licensing will be required in Texas. In fact at least one Software
Engineer has already been licensed.
/////////////

There are a dozen countries looking at various forms of licensing.

In the UK it will be based on the long standing Chartered Engineer
"qualification" Which, like all the other similar methods, requires a
relevant degree + training + experience. In the case of those without a
degree and formal training there is usually a much higher experience
requirement and some sort of report/thesis signed off by other suitably
qualified people.

It's not perfect. Some "idiots" will get though and some good people
will be lost but overall it will be good. With more and more [embedded]
software controlling every aspect of life (and much of it directly
affecting the public) the insurance companies will start to require some
sort of licencing and legislation just as the do for

doctors
lawyers
civil engineers
architects
aero-engineers
teachers
etc
I knew when I wrote the above that you would probably come back
with something about MISRA. MISRA doesn't prevent bad
programmers from writing bad code though. Sadly.

It helps but... only as part of a calorie controlled process :) MISRA-C
is only one of several coding guides that could be used. However in
itself it is of little use if the development is a shambles.
 
R

Randy Howard

Chris Hills wrote
(in article said:
In fact at least one Software Engineer has already been licensed.

Oh goodie. Guess what percentage of all of the programmers in
the US is represented by 'one'. Thanks for reinforcing my
point.
There are a dozen countries looking at various forms of licensing.

And zero actually doing anything useful about it. Meanwhile,
just about all of them will arrest you for trying to pretend you
are a doctor without the appropriate proof of competency.
the insurance companies will start to require some
sort of licencing and legislation just as the do for

doctors
lawyers
civil engineers
architects
aero-engineers
teachers
etc

I am sort of wondering how an insurance company can require a
programmer to be licensed. I'm not sure the insurance company
had anything to do with any of the above groups until long after
they already had licensing in place.
It helps but... only as part of a calorie controlled process :)

I haven't seen any evidence that it has any beneficial impact at
all on a properly trained programmer. If anything, it seems
more like a crutch aimed at propping up people that aren't
grounded properly in the first place.
MISRA-C is only one of several coding guides that could be used.

One of an almost infinite number actually.
However in itself it is of little use ...

Couldn't agree more. :)
 
C

Chris Hills

Randy said:
Chris Hills wrote



Oh goodie. Guess what percentage of all of the programmers in
the US is represented by 'one'. Thanks for reinforcing my
point.

The difference between 0 and 1 is greater than between 1 and 1000...
And zero actually doing anything useful about it. Meanwhile,
just about all of them will arrest you for trying to pretend you
are a doctor without the appropriate proof of competency.

Or almost any other profession....
I am sort of wondering how an insurance company can require a
programmer to be licensed.

That is easy... Various standards for safety critical work require
personnel to be suitably qualified already.
I'm not sure the insurance company
had anything to do with any of the above groups until long after
they already had licensing in place.

Agreed.



I haven't seen any evidence that it has any beneficial impact at
all on a properly trained programmer. If anything, it seems
more like a crutch aimed at propping up people that aren't
grounded properly in the first place.

Probably true. It moves the minimum up a bit.
One of an almost infinite number actually.

Yes. Some are better than others. Due to the high profile and use of
MISRA-C it is getting a lot more feedback etc so MISRA-C3 will be better
still. Most of the other coding guides do not have such widespread use
or an active maintenance team.

Couldn't agree more. :)

The process is important. A coding guide is simply one (small) part of
it.
 
R

Randy Howard

Chris Hills wrote
(in article said:
The difference between 0 and 1 is greater than between 1 and 1000...


Or almost any other profession....

Exactly. Almost 'by definition', programming is not a
profession as a result. No wonder they are paying people in
grains of rice to do it.
That is easy... Various standards for safety critical work require
personnel to be suitably qualified already.

Those requirements might be generated by a company in response
to an insurance company requiring them to in order to get a
lower premium, sure. That, or they lobby government to pass
laws to that effect.
Probably true. It moves the minimum up a bit.

I disagree. It allows people to play in the space that might
otherwise be weeded out more quickly. Everytime you 'move the
minimum up', you need to determine whether or not that is
desirable.
The process is important. A coding guide is simply one (small) part of
it.

A coding guide will not save you from bad programming. You can
write broken code that adheres to almost any programming guide
you devise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,250
Latest member
Charlesreero

Latest Threads

Top