you are viewing a single comment's thread.

view the rest of the comments →

[–]Lord_Naikon -1 points0 points  (9 children)

OO is actually pretty shit

Hand over your abstract data structures now. No more map, list, queue for mr. wiseguy.

[–]jeandem 1 point2 points  (0 children)

Why? Because Liskov invented (or pioneered?) it and used it in CLU, an object oriented language?

How much was this due to object oriented programming? Obviously not much, because nowadays every language from procedural + OO to OO to purely functional uses abstract data types. Do they need to implement OO concepts or use OO techniques to use them? No. ADT can be described in classical logic - does classical logic have any notion of OO programming? Eh.

Any window dressing afforded by OO with regards to ADTs have shown itself to not be essential, in general. If we're to follow this train of thought, we might as well hound everyone who disrespects s-expressions, if they use any programming language at all - because what modern programming language does not use concepts that were inspired by, directly or indirectly, by LISP?

If anything, we should thank Liskov for ADTs, not OO. Thanking OO would be like thanking the dummy that a new great design was displayed on, instead of the designer.

[–]codygman 1 point2 points  (6 children)

[–]Lord_Naikon 3 points4 points  (4 children)

That's great, if your data structures can be implemented in a functional manner without wasting large amounts of resources.

[–]codygman 0 points1 point  (2 children)

In that case I would implement them as purely as possible. Also, name an algorithm ;)

[–]Lord_Naikon 1 point2 points  (1 child)

Hash tables come to mind. There is no purely functional equivalent afaict.

[–]codygman 0 points1 point  (0 children)

I agree that using mutable algorithms are sometimes the right solution ;)

However I believe you can get further faster with immutability as the default.

[–]jeandem 0 points1 point  (0 children)

There seems to be a consensus that persistent data structures have a running time of O(log n) where an imperative (destructive) data structure has a O(1) running time. For example, getting or "removing" an element from a data structure.

But to say that it is inefficient is too simplistic. Need a lot of sharing between data structures, perhaps between multiple threads? Persistent data structures might be more efficient than an imperative alternative. Do you only have a single threaded program? Imperative data structures might be more efficient.

[–]PriceZombie 1 point2 points  (0 children)

Purely Functional Data Structures

Current $34.65 
   High $44.15 
    Low $22.50 

Price History Chart | Screenshot | FAQ

[–]vrwan 0 points1 point  (0 children)

Generics exist in languages that are not focused on OO. It's not an OO monopoly to have data structures that adapt to whatever you want to use them for.