From: Robert Wohlfarth 
  On Thu, Feb 13, 2014 at 2:46 PM, Jim Gibson <jimsgib...@gmail.com> wrote:

    CPAN modules should be OO nowadays, just to avoid namespace clashes (all 
the good function names are taken).


  Packages already prevent namespace clashes. Why add the overhead and 
complexity of objects?


  My personal rule of thumb is that objects represent "things". I think of 
objects as managing state - the state of an individual "thing". Modules with 
all class methods do not represent "things". They're just functions.


  Because if package A exports a function something() and the package B also 
export a function something(), they will clash and should be called using 
A::function() and B::function() which is not very nice nor productive.

  But yes, sometimes (or maybe most times?) there are no such clashes found, 
and the OOP package creates a single object in the whole program, and if that 
object is not needed to do polymorphism, them it appears to be pretty useless.

  In bigger programs using OOP can make the things clearer and easier to 
maintain.

  Octavian

Reply via email to