Olin Lathrop wrote: > Wouter van Ooijen wrote: >> Why? I guess C must have done something right, but I am not sure what >> it is. >=20 > Market acceptance is based on a number of factors, with technical > superiority not usually near the top of the list.=20 >=20 > In think C got popular for various reasons, some having to do with > history and luck. One technical point in its favor was that it was > relatively easy to write a compiler for. The syntax changes I would > have liked wouldn't have made it harder though I think.=20 >=20 > In my opinion, another factor is specifically because it is such a > "bad" language. Especially in the early 1980s when C was at its > steepest rise, there was a lot of "I don't need no stink'n type > checking" attitude and the like. =20 Most of arguments that go like this miss the simple fact that Turbo-Pascal on the MS-DOS PC was very popular, long before C on the PC became popular. At least as I experienced it, programming on the early PC was heavily slanted towards BASIC and (Turbo-)Pascal, C having been almost unknown. Probably one obstacle Pascal faced was that in order to be useful, the original language spec had to be extended, and every vendor extended it in its own way, usually incompatible with other vendors.=20 I think that much of the weirdness of C can easily be explained with its history. Let's say somebody ported Olin's PIC assembly environment to a mainframe and wrote a database application using it -- one could easily find many things to criticize if one were to forget that it once was a perfectly useful development environment for embedded systems based on PICs. C was developed mainly to help port an OS from one system to another, sort of a portable assembly language that is low level enough to allow expressing anything you may want to express in assembly in C, yet abstract enough to be easily implemented in different assembly languages, but not too abstract as to make compiler writing reasonably easy. It wasn't designed from scratch (the name!), but rather had history and pre-existing code base. You just don't write from scratch if you don't have to, you modify what you already have to suit your needs -- if the outcome is "good enough" for the purpose and if the modification is less work than writing from scratch. That's simply normal engineering. It's one of those local optimums that, from far away and high above, are easily spotted as not globally optimal, but at the time and for the given purpose may very well have been a perfectly suitable local optimum. The same goes for the shortcomings of Pascal that prevented it from becoming the language of choice on the PC, even though it was already almost there -- it was designed as teaching aid, not as application development language. Also sort of like the use of non-metric units and hardware in the USA... the switch period in most countries was probably around a decade (UK a bit longer), but the USA will probably hit a century or so -- even though eventually it will happen. While there are many "local optimum" reasons for this, it's definitely not a global optimum solution. But unless forced by a body that has the power to force it (like the switch to metric units and hardware in some countries), it's mostly those local optimums that determine how things are done. I'm sure you could appreciate the local optimum situation that led to C, with all the smaller and bigger compromise decisions that had to be made, if you could just let your grudge aside for a while :) The rest then is history... Pascal had its shot, was almost there, but some shortcomings in it prevented it from really happening. (I still feel the sadness I felt when I had to abandon Turbo-Pascal because it just didn't make it into the professional market. It was years -- probably a decade -- ahead of any C environment on the PC.) Gerhard --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .