For years, I have been doing Algorithmic stuff, writing scalable data structures
ID: 652476 • Letter: F
Question
For years, I have been doing Algorithmic stuff, writing scalable data structures for internet search, for example Randomized Binary Search Trees for Auto Recommendation, BitMaps, Wisdom of Crowd based Algorithms using Graphs, writing some interesting Machine Learning Algorithms like Clustering, Anomaly Detection, working on Information Retrieval stuff and so on
There is a common thing in the things that I have mentioned above. All the above stuff;each if coded in a language like C++ requires handful of classes. I mean they are interesting problems but they are not complex in terms of heavily loaded Object Oriented stuff. I have never used Inheritance, virtual stuff etc. Though I have heavily used Generic Programming, Templates and so on.
I love C++ (- Bulky OO stuff, As I like what Joe Armstrong's, creator of Erlang says, In OO World if you ask for a banana you get a big jungle alongwith gorilla holding the banana). I enjoy coding in other languages like Java, Python too.
Now my question is since I am enjoying the kind of projects/Algorithms I am working on do I need to really learn OO stuff, will I be a better coder/designer just by using the stuff like Inheritance, Dynamic Polymorphism (virtuals)? OR can I move to the world of Functional Programming (I have not done it till now) which attracts me more as I can just focus on tasks/algorithms and not let Kingdom Of Noun based OO stuff, has-a, is-a rule me?
In short will/can OO stuff help me at all for the kind of projects/Algorithms that I have mentioned above?
Explanation / Answer
Object oriented programming is really good at hiding your complex fancypants mathy stuff behind easy to understand words and making it easier for the lessers among you to actually use the things you've written. It doesn't replace functional programming ... it just gives you a really easy way to switch out implementations or add behavior.
In your Randomized Binary Search Trees example above, what if you were given the requirement that on April Fools Day, the Randomizer was replaced with an order-by-distance-from-three-stooges. It's really handy to create StoogeBinaryTree : RandomBinaryTree and override the protected int GetSortOrder (Tree a, Tree b) method, so on April 2nd, you can switch implementation back to the RandomBinaryTree without having to have changed any of that code.
In one simple example, I've shown both adding tiny sliver of behavior and switching implementation...