Linked by MOS6510 on Thu 10th Jan 2013 23:25 UTC
"For years I've tried my damnedest to get away from C. Too simple, too many details to manage, too old and crufty, too low level. I've had intense and torrid love affairs with Java, C++, and Erlang. I've built things I'm proud of with all of them, and yet each has broken my heart. They've made promises they couldn't keep, created cultures that focus on the wrong things, and made devastating tradeoffs that eventually make you suffer painfully. And I keep crawling back to C."
RE: Point by point
by saso on Fri 11th Jan 2013 12:30 UTC in reply to "Point by point"

Member since:
2007-04-18

In what way is C simple? Take someone who's got a good background and mind for programming and show them C.

This is a flawed premise. You are positing a hypothetical question and drawing conclusions without any data to show for it. In other words, what you're doing here is blind speculation.

const * char is a pointer to const... I think. Right? Very simple.

"const *char" isn't a valid C construct. I think you meant 'const char *' which is the traditional form to write the more proper 'char const *'. That is a "character constant"-pointer, i.e. a pointer to a character-constant. Contrast with 'char * const' which is a "character"-pointer constant. This is one of the more luxurious features in C, having the ability to keep a close eye on object mutability. How do I pass a constant array in, say, Java? I can't, there's no way to do it.

The rest of your comment, I have no problem with. C is not a one-size-fits-all solution.

RE[2]: Point by point
by telns on Fri 11th Jan 2013 17:36 in reply to "RE: Point by point"
Member since:
2009-06-18

'Collections.unmodifiableList()' will sometimes answer the need. But you are absolutely right; C has a lot more control.

RE[2]: Point by point
by ingraham on Fri 11th Jan 2013 22:22 in reply to "RE: Point by point"
Member since:
2006-05-20

You are positing a hypothetical question and drawing conclusions without any data to show for it.

Fair enough. I stand by the basic premise, however. Using function pointers to pass a compare function to a sort function is more complicated than blah.sort(). Particularly if your collection has a natural sort order, like strings.

"const *char" isn't a valid C construct.

Ha! Okay, it was 4 in the morning when I wrote that, but the fact that I screwed up my example kinda proves the point.