4 ms·
I didn't even know this was a big, controversial issue still. Coming from a PHP, Ruby, and Obj-C background (and having taken C and Java classes in college), I
by jarin 16y ago
I didn't even know this was a big, controversial issue still. Coming from a PHP, Ruby, and Obj-C background (and having taken C and Java classes in college), I always saw it as "use objects when you want things to be easy, use C when you want things to be fast".
Of course, being primarily a web developer and not having implemented a linked list or a bubble sort since college, the anti-OO people probably wouldn't consider me a "real" programmer anyway.
- bigfudge 16y agoThis is a serious question: is there ever an occasions when someone working on a real-world project should be implementing linked lists? I've no experience with C, but surely this stuff comes from libraries now?
- JoachimSchipper 16y agoThe C world has various reusable linked lists, but yes, there is occasionally a reason to implement one yourself: a {data, next} tuple usually fits in a single cache line, whereas some libraries only offer {data pointer, next} tuples, which requires loading in the memory that <data pointer> points to. The performance difference can matter. That said, some more agreement on reusable code may be useful, especially for things that aren't as easy to implement as linked lists.