::NonOO suffix for non-OO version of a module

I wrote one this morning: Number::Closest::NonOO is the non-OO version of Number::Closest (plus with some additional features).

Is there an existing convention for this? Or can you suggest a better candidate? Can't seem to find or be able to come up with any. ::Simple is too vague (and a bit misleading). ::Functional? ::Function? ::Procedural? ::NonMoose implies an OO version but without using Moose. NOO is not immediately obvious.

10 Comments

Dear God...

my $finder = Number::Closest->new(number => $num, numbers => \@num) ;
my $closest = $finder->find; # finds closest number

All that, plus Moose, to do a bit of subtraction and sorting? How about

@closest = sort { abs($a-$num) <=> abs($b-$num) } @num;

As the saying goes, 90% of everything is crap, and this is clearly part of the 90%. I would suggest politely contacting the author and politely telling him that his module is not useful.

I like the "I wrote and uploaded this thing to CPAN, now I'm looking for a good name for it." - why not blog *before* that? Did you email the module-authors list as well? Have you consulted people on IRC? Anything before uploading this?

The File::Spec and File::Spec::Functions namespaces comes to mind. I had this idea for NoOO, though :)

But, so much negativity today and not a direct answer among them. Nobody needs to get anyone's permission before they play around with Perl, certainly not from the IRC mafia. Maybe only 10% of stuff is good, but maybe that also means we need more 90% to get more 10%. CPAN has the philosophy of upload early and upload often. We want to capture as much value as possible and get people going as quickly as possible. We can refine later, and in a collaborative way. If you don't want to help, save yourself the hassle of replying so you can add value to whatever you think is good. :)

Most things we do don't really need modules because they aren't that complicated, but we still use modules. Giving things names not only makes code re-usable, but shows intent. educated_foo's code, for instance, doesn't care if the input are actually numbers, though. That's not so hard to fix because we could pull in Scalar::Util and throw a grep in there. It can get even more complicated.

But, if you don't want to use the module, don't.


I like Nooo. See also Object::Import and Acme::Nooo for generic solutions to this problem, which work in at least some cases.

I like the idea, but I'd favor doing this implicitly rather than having to time some extra stuff, for instance, implies non-oo usage

use Number::Closest "find_closest_numbers";

While importing no subs implies oo usage

use Number::Closest;

But it'd be a bit more work if the intention is to avoid loading OO deps or vice versa.

Leave a comment

About Steven Haryanto

user-pic A programmer (mostly Perl 5 nowadays). My CPAN ID: SHARYANTO. I'm sedusedan on perlmonks. My twitter is stevenharyanto (but I don't tweet much). Follow me on github: sharyanto.