On Tue, 30 Jun 2009, Olin Lathrop wrote: > Gerhard Fiedler 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. > Don't be so dismissive of that tiny little word "free". It tends to be a VERY powerful incentive. > 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. I've seem users "demanding" something better. I've even seen users demanding to use better C compilers than the one currently being used. My experience: it's like farting in a hurricane! > > C is a horrible development language that encourages bad programming and > bugs. I agree completely. > I suspect even you largely agree with that. 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! > > Unfortunately there are sufficient numbers of type 1 (the dumb) and type 2 > (the immature) programmers out there that bosses have to cater to them and > development software suppliers have to cater to the bosses. My experience is slightly different. I've seen many bosses decide on using C because they want to use a particular dev tool, library or system that relies on C. Then these bosses go out and buy the relevent C expertise at the lowest price they can get. The bosses are often technical idiots who don't understand the realities of the dev tool, library or system they are tying themselves to, they just get swept up in the marketing hype, simple demos and promises made by the salesman. I remember when programmers were desperatly trying to add C to their CVs to make themselves more employable. I've also seen many programmers reach a certain proficency in C and then stop because they've had their hands tied with in-house coding standards. > > 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. > Ok so rather than simply write another C compiler I took the plunge and tried to do something better. How far did this actually get me with you an affirmed C detractor. In another post (same thread) you actually mention that although XCSB is purportedly not a toy and it is not C you haven't tried it. I've tried on various occations to get feedback from you (through this list) about what features you would like to see in a language but all I've been able to glean is that you'd like very strong type checking and the language should really be PASCAL. Yes there are things I really hate about C but I really don't want to be tied into just implementing a PASCAL compiler - I want to do better. I'll make you an offer, if you want to produce a free PASCAL compiler for the 16 series, I'll let you use my XCASM assembler as a back end free of charge provieded it is tied to the compiler so that it can't be used as a standalone tool. > > You could just as well bitch at the Pascal developers for not making > > it a generally usable language in the first place (that is, > > incorporating the features that later, proprietary versions added to > > make it useable) and standardizing it. If they had done this, maybe > > K+R would have felt it was easier to adopt the new language rather > > than building on their code for B. But there was no new language > > suitable for their task. > > Perhaps, but they still could have taken some of the concepts. Most of > these things don't make the compiler much harder to write or the resulting > code any less efficient. It's a mindset thing, and I think that's what K+R > lacked. I agree that the resulting code would not have been less efficient but I disagree that "the compiler would not have been much harder to write". The early C compilers didn't even deal with function prototypes. A lot of time was wasted actually tracking down bugs that were the result of passing the wrong type of parameter to a function. > > > 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. > Maybe it was but everyone's moral compass seems to be afected to some degree by money and fame. Regards Sergio Masci -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist