[comp.software-eng] software engineering in C

psrc@pegasus.ATT.COM (Paul S. R. Chisholm) (04/21/89)

In article <3210@ae.sei.cmu.edu>, rsd@sei.cmu.edu (Richard S D'Ippolito) writes:
> Software engineering implies a different way of thinking about code
> and procedures.  Without getting into the the question of whether
> one even tries to engineer software in "C", why would your software
> be so disorganized that you'd even need to do such a thing [search
> for function definitions]?

Rather than being one of the Sagans and Sagans of annoyed C programmers
who flames you, I'd like to encourage you to expand your statement.

I'm not sure what you mean by "whether one even tries to engineer in
C".  Are you implying that C programmers don't understand the value of
software engineering, or that one needs a "better" programming language
to do software engineering in?

Personally, I agree that it's impossible to "do software engineering"
in C . . . or C++, or Eiffel, or Ada.  The only things you can do with
those programming languages is write code, and specify low-level
design.  Software engineering includes the whole range of deliverables,
including requirements, design(s), code, tests, and schedules.

It takes very little discipline to write readable, maintainable,
straightforward, efficient C code.  With a little more discipline, you
can even write portable code.  C doesn't provide much of a safety net;
if your program has a bug, it's likely to fail gracelessly and
mysteriously, often well after the "real" fault.  More modern
programming languages help the programmers there.  C++ lets the
programmers help themselves.  (Eiffel does both, one of the reasons I
continue to study it.)

I'll agree that C doesn't let you specify low-level design
(descriptions of data types and actions upon them) as well as some of
the other languages I mentioned above.  The standard has added some
useful features for doing that; C++ has added more (and is in fact the
source of the new features in the standard, such as function prototypes
and the "const" keyword).  Eiffel does some nice stuff here, too.  Ada
does more than C, supporting encapsulation well, and polymorphism
fairly well, but not addressing inheritance and disciplined run-time
checking, a.k.a. object oriented design, at all.

As for why your code would be so "disorganized":  it might be part of a
very large project.  Your implication, I assume, is that the
environment should provide tools to help users find definitions.  I
agree.  You might write those tools in the command language, using text
manipulation tools like egrep; you might write those tools in C (and
you might call it ctags:-).  Were you talking about something else?

Paul S. R. Chisholm, AT&T Bell Laboratories
att!pegasus!psrc, psrc@pegasus.att.com, AT&T Mail !psrchisholm
I'm not speaking for the company, I'm just speaking my mind.