[nama] Re: costs and benefits of singletons

  • From: "S. Massy" <lists@xxxxxxxxxxxx>
  • To: nama@xxxxxxxxxxxxx
  • Date: Wed, 7 Sep 2011 16:44:28 -0400

Hello,

It would seem to me the main advantage with the OO/singleton way, apart
from those Julien mentioned, is long term scalability. A programmer can
probably hang himself in any language, but perl is often sited as
amongst those giving him the greatest freedom to do so, for better or
worse. So far, Joel has done a wonderful job of tidying things up and a
better job than most at documentation, but if nama keeps growing
significantly (for instance with MIDI), a pretty crisp order would be
necessary IMVHO.

As for the performance hit, though the numbers are startling, I doubt we
would see a significant difference in practise: whether the setup takes
0.01s or 0.1s to arm is unlikely to impact our recording/mixing experience in
any significant way. 

The issue with object names and print is surprising (I would
have expected perl to be a bit friendlier) and perhaps constitutes the
real hurdle. Would we basically be looking at substituting something
like:
print "Project name: $project_name";
to:
print "Project name:" + $project->name;
?

Lastly, a naive question about the idea for a logging mechanism.
Wouldn't it be possible to create a simple logging sub and do a mass
substitution from print|say to "mylog 0,", where 0 is a placeholder
logleve, and then to work through the code section by section at our
leisure to implement discrete logging?

Cheers,
S.M.

Other related posts: