Linked by MOS6510 on Thu 10th Jan 2013 23:25 UTC
General Development "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."
Thread beginning with comment 548643
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[8]: Point by point
by ingraham on Sun 13th Jan 2013 19:52 UTC in reply to "RE[7]: Point by point"
ingraham
Member since:
2006-05-20

I think you just consider it simpler because it's what you're used to.


Always a danger, but I think it's more likely the way my mind works than experience. I learned C and qsort a good decade before picking up Java and C++. In general, the implementations are quite similar. In C, you write a compare function, calling it whatever you want. In Java, you write a compare function and make sure you call it compareTo. Anyway, you have a point.

your example covers custom sorting of objects, but not of first class types - how do I do a custom sort on strings, or ints, or something else atomic?


I've never needed to do that, so I'll have to think about it. You may be right that wrapping the type in a new class may be the only way to do it. Of course, in Java ints would have to get wrapped in an object anyway, so that's a sunk cost. While it is a niche case, it's pretty interesting.

Reply Parent Score: 1