Path: utzoo!attcan!uunet!ogicse!ucsd!ucsdhub!hp-sdd!apollo!perry From: perry@apollo.HP.COM (Jim Perry) Newsgroups: comp.software-eng Subject: Re: problems/risks due to programming language, stories requested Message-ID: <494a1656.20b6d@apollo.HP.COM> Date: 19 Mar 90 16:11:00 GMT References: <159@uninet.vbo.dec.com> <1527@amethyst.math.arizona.edu> Sender: root@apollo.HP.COM Reply-To: perry@apollo.HP.COM (Jim Perry) Organization: Hewlett-Packard Company, Apollo Division; Chelmsford, MA Lines: 50 In article <1527@amethyst.math.arizona.edu> raw@math.arizona.edu (Rich Walters) writes: >In article <159@uninet.vbo.dec.com> vanavermaet@kerber.dec.com writes: >>O.K., the semantics are well-defined (as may people have pointed out), >>but it still IS dangerous. That (IMHO) is a very important factor (and to me, >>a reason not to use C). >> >>Peter Van Avermaet > > >Do you refuse to drive a car because an irresponsible person could drive one >through a crowded play ground? No, but I refuse to drive a car without a fuel gauge, or without brakes (even though I could opt to have aftermarket brakes, controlled by a bicycle brake handle clamped onto the gearshift, installed), or with no interlock preventing me from shifting into reverse at highway speed ("but that's a feature! it means you don't need brakes!") >Yes C can be dangerous. But many useful things can be or are dangerous. That >is why users(programmers) need to be trained in its correct use, just as >drivers need to be trained in the correct use of an automobile. To continue >the analogy, if the rules of the road aren't obeyed, chaos and destruction >reign. This isn't the issue, the problem with C is not that untrained programmers misuse it, it's that its "flexibility" and lack of error detection allow trained software engineers to make mistakes, through simple typos or similar dumb but common gaffes, that are detected by other languages. [Or, as has come out here, by better C compilers or interpreters than are commonly encountered, or by some versions of "lint"]. C is not magic, it's just another algol-derived programming language; it doesn't let you do anything that you can't do in other languages (not some particular other language, or implementation of some other language, but other, similar, languages). What C does have going for it is that it's simple, easy to write compilers for, and implemented on all sorts of iron. This is more a historical issue related to its association with UNIX than a feature of the language design. Nevertheless, it's why I at least write in C. A well-trained driver with years of experience can still run out of gas if they forget to check the gas dipstick before starting the trip. Presumably after this happens a few times, that driver will remember to check, or develop the habit of filling the tank when the car has travelled half the total expected range since the last fill-up, but I'd rather have a car with a fuel gauge in the first place and never have the problem arise. - Jim Perry perry@apollo.hp.com HP/Apollo, Chelmsford MA This particularly rapid unintelligible patter isn't generally heard and if it is it doesn't matter.