Eric Poggel:

> On 11/10/2010 3:16 PM, dsimcha wrote:
> > Don't make it a class if it can be a free
> > function.
> 
> I agree with most of the others except for this one.

Object oriented programming is a way to think about code, so it may come more 
natural to you, or less natural, according to the way you think (often your 
first language matters a lot. If your first language was OOP then probably 
objects are more natural for you).

But in the end OOP was invented to face problems present in larger programs. OO 
is infrastructure that adds some complexity to reduce complexity in larger 
programs. It's not wise to add complexity unless it's necessary. So using a 
class where a free functions is enough may be over-engineering.

Bye,
bearophile

Reply via email to