Hacker News new | ask | show | jobs
by nathanielksmith 5709 days ago
I agree. The issue is not "I do or do not want $instance->method() in my code" but rather "Do I have state to encapsulate?"

I'm a full time perl programmer and often run into people from the perl community who think OO is just a calling convention or a style instead of a tool with a specific purpose. It's very frustrating. The fact that Perl's native OO support is incomplete and obtuse just makes it worse. This module follows that pattern of thought. Using it would just add arbitrary and unnecessary complexity to a project.

1 comments

I chose the logging because, log objects generally do not need to keep a lot of state, and mentioned OO being "An idiom in which you capture behavior along with state" but perhaps I could have expanded on it further.

If you don't like blessing refs yourself, use a module to hide the boring repetitive parts like you would with any other problem...

I'm pretty sure perl5's OO falls into the simplest-thing-that-could-possibly-work category, and obeys the "Rule of Separation: Separate policy from mechanism"