Tuesday, June 5, 2012

Obviously a vast improvement

From a hilarious post by John D. Cook about the blessings of object-oriented programming:
In the dark ages of programming, functions acted on data. To slice your bread, you passed a bread data structure to a slice function: 
slice(bread);
Then came object oriented programming. Instead of having an external function slice our bread, we would ask the bread to slice itself by calling the slice method on a bread object: 
bread.slice();
Obviously a vast improvement.

No comments:

Post a Comment