View Single Post
Old 04-03-2003, 02:43 PM   #48
angelbob
Member
 
Join Date: Feb 2003
Location: Bay Area, CA, USA
Posts: 39
angelbob is on a distinguished road
My experience has been that a problem involving a feature I have trouble understanding, or with serious subtleties, will take many times as long to debug. You can produce those in C as well (or any language), granted, though I've found that every situation in C where I have that problem involves a lot of indirection (pointers). Then again, I'm very comfortable with a lot of the parts of C that tend to give many people problems like unions, signedness, widths and bit-layout, and bitwise operators, so it's entirely possible that there are other features of C where other people would have problems like you describe.

If 10% of your problems take 10 times as long to debug as the other 90% (which is about right for me and C++ in my experience), you wind up spending half of your time on that 10%. That's fine if that's where the meat of your problem is, and in that case it's fully justified. But I've found that in C++ I wind up spending way too much time on trivial problems caused by nasty syntax or questionably-designed language features.

In C, I still spend half my time on 10% of my problems. But they're the 10% that occur in places with genuinely weird logic where the hard part is figuring out the algorithm. That'd be the right 10% to my mind.

There are certainly language features in C that could be clarified, changed or banned. Like I say, I'd love to have references in C, especially if pointers could be easily identified by the very distinctive syntax they required. Star and ampersand are okay except that star is used for multiplication as well, and pointers are currently used too readily.

And as far as figuring out what size an enum is, granted, that should be standardized. But it has the same problem C has always had -- too many platforms. C is old enough that it can't even be sure that its integer types are multiples of eight bits. Scary but true.

I haven't seen the returning static thing. I'll take your word for it.

And yes, it *is* too easy to make silly mistakes in C. I'll run the risk of irritating Yui by blaming some of that on the language designers :-)
angelbob is offline   Reply With Quote