Olin Lathrop wrote: >> K+R didn't set out to create a new language. They wanted to port an >> OS, needed something better than assembly for that ("better" in this >> context means mostly "more portable"), and had already B available. >> So they developed B into C, apparently making it more suitable for >> their task at hand -- not for you or me or anybody else. I don't >> think it became widely used outside the small scope of Unix until >> the 80ies, by which time the major features were already mostly >> settled -- not exactly as design from scratch, but as result of an >> ongoing development where the language was not a goal in itself, and >> the development of the language had to fit into all the normal >> resource constraints. > > Even if you take this as a excuse for why C was so poorly designed, > it still doesn't excuse its widespread use today. C got popular > because it tagged along with Unix and for other marketing reasons > like that compilers were available cheaply or freely. Somebody spent the money to write those compilers. There is often a reason why people spend money. I still think that Pascal has some characteristics that didn't make it (and still don't make it) well-suited for replacing C. Lack of standardization of a version that is suitable was one, and probably the major, hurdle. > Today we have a very different world. Even if we accept all the above > and understand C is required for some new projects only because it is > already popular, what is missing is the outcry of users demanding > something better. There is no single Pascal definition that somebody could invest a lot of money in. There are a ton of Pascal dialects, all adding their proprietary extensions to make the original Pascal workable in the real programming world, but no single standard. As long as there isn't one, there won't be money in it. Besides, it's funny you should say that. Remember our discussion about use of SI units? This is quite similar. People have lots of code (and money) in C, and once you're there, it's not so easy to switch, especially if there isn't a viable alternative. The one difference between the two situations is that the SI units are the only standard that will survive and some people are resisting (and spending money on resisting), whereas there is no usable Pascal standard, and not even the Pascal proponents seem to be willing to create a usable standard. > C is a horrible development language that encourages bad programming > and bugs. Not really... not anymore than assembly. It makes them possible, more than other languages, but not more (and arguably less) than assembly. There are tools available that discourage most bad programming constructs. One just has to get the head out of the sand and see that a compiler is not everything; the whole environment counts. Just as you improved on the PIC assembler with your environment (because the assembler is lacking for serious work), people have improved on the C environment (because most compilers are lacking for serious work). See lint et al. > I think the real problem > is that too many software developers fall into one of two catagories: > > 1 - I know C, like it well enough because I don't know anything > better, don't want to learn something new, so I view a new > language as a threat because I'd have to take time out to > learn it. It took me weeks to understand those pointer thingies > in C, and I don't want to go thru that again. > > 2 - I like C because I can do whatever I want without the compiler > whining about it. Type checking is for sissies. Look at this > really cool code I wrote that is a whole ray tracer on the back > of a business card. Betcha you can't figure out how it works! It may be that too many developers fall into these categories, but I also think that these aren't so many as to really make a difference. Most C users probably fall into the category "I need a programming language that is supported on most embedded systems, that doesn't cost me an arm and a leg to get the compiler, and that's reasonably standardized so that I'm not married to a single vendor's fate. Also, the company I'm working with has all this code base in C, much of which isn't ideal but nevertheless quite usable." What language would you choose in this situation? > All I'm looking for is some outcry from the minority rest of us to > keep pointing out the faults in C and complain about wanting > something better. It's not easy to change such intrenched thinking, > but if we keep beating on it more and more people may slowly realize > that C is a really bad idea. What would be your suggestion as to what's better? And don't say "Pascal", because we all agree that "the" Pascal is not usable. So you need to specify exactly which Pascal... and here the trouble starts. There is not a usable Pascal... there was Turbo Pascal, there is Delphi, there is Apollo Pascal, there is this and that Pascal -- not a good starting point to argue for adoption of "Pascal". > It's a mindset thing, and I think that's what K+R lacked. In the same vein, it's a mindset thing, and that's what the Pascal world seems to lack. There needs to be one single standard. The C guys got it together rather early; the Pascal guys after so many years don't seem to get anywhere near a usable standard. >> I think I have to repeat it: If someone wants to understand why C is >> how it is, IMO it's tremendously helpful to think of it more as a >> "portable assembly" than a "high-level language". That's how it set >> out, that's the mind frame that determined most of its basic >> structure. And IMO it's perfectly compatible with what it is. > > Right, but that mindset was itself irresponsible. At the least then > promoting this hack (which is after all what you describe) was then > irresponsible. It's not anymore a hack than the assembly code you have in stock. You use assembly because you don't have a better alternative. You'd like to use Pascal, and if you had the money to spend to create Pascal compilers for all platforms you work on, you probably would create an Olin Pascal compiler for each of them, and program in Olin Pascal. And possibly we all would; judging by your assembly environment, I'd probably like your Pascal environment. But you don't have the money, Wirth didn't have it -- and maybe K+R didn't either. This is not hacking, this is engineering: creating what's needed (and not much more) with what's available. And like all engineering, when you're through with it, you know what you'd do differently the second time around. But by that time you're already in a bind with the reality created by the first throw. Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist