Re: Regrettable module names
by theorbtwo (Prior) on Jul 03, 2004 at 23:32 UTC
|
Here's one that I'm not sure of -- Sort::Merge. It implements the algorithim commonly called merge sorting. Unfornatly, it doesn't sort -- it takes multiple files, which are already sorted, and merges them info one file, that is sorted. But I'm stuck with the name, because it's what everybody calls the algo.
Another that I'm not sure of, that indicates a general problem, I think. I'm working on a interface to my bank's web-banking. It's called Finance::Bank::Norisbank (yeah, compony names don't make good namespaces, but there's really nothing better to call it, other then, perhaps, Finance::Bank::DE::Norisbank, or Finance::Bank::DE::<their bank routing number here>. The first is getting too long, the second is unreadable.
The real problem, though, is the class that is to be used to represent a transaction. By design, it's supposed to be general enough to represent any transaction, or at least any transaction against a german bank. Should I name it Finance::Bank::Transaction, Finance::Bank::DE::Transaction, or are those taking up valuable namespace for something that will probably only be used by me, and it should be Finance::Bank::Norisbank::Transaction?
(BTW, Finance::Bank::Norisbank is not ready for CPAN yet.)
| [reply] |
|
That Finance::* namespace is a wierd one. It has general things like interfaces to various accounting programs data formats as well as protocol sorts of things. Lingua::* has a similar complexity.
To make things really work there, someone needs to take charge and unify everyone, sort of like DBI did for databases and LWP did for many of the net interfaces. What you really care about is the transaction, not the institution, really. If I wanted to interact with four banks (and I do), I want to use the same script.
That stuff aside, I think in your case you can't escape having the bank name in the module name, because that's how people think about it. If Citibank disappears, for instance, Finance::...::Citibank probably won't be useful anymore anyway, whereas in my example Netscape lived on in other things.
As a PAUSE admin, in these cases I just follow the precedent.
--
brian d foy <bdfoy@cpan.org>
| [reply] |
Re: Regrettable module names
by davido (Cardinal) on Jul 04, 2004 at 05:06 UTC
|
This isn't my name, but it is nevertheless regrettable.
- Base: Not to be confused with base, but easily confused on operating systems that don't know how to deal with case-sensitive filenames. 'Base' really ought to just be removed from CPAN. From what I can tell it hasn't been maintained in ages, and is all but replaced by the 'base' pragma.
Often I find CPAN module functionality under module names that I wouldn't immediately have guessed, but as quickly as I stumble across such modules I forget my frustration and just go on using them. But the Base/base issue bugs me.
| [reply] |
Re: Regrettable module names
by TStanley (Canon) on Jul 04, 2004 at 06:25 UTC
|
| [reply] |
|
I like this one. The only thing that I think you could possibly do better would be to imply the Protocol somehow and just name it Acme::Remote::Strangulation. Also, some code examples in the perldoc would be nice too. :)
| [reply] |
|
| [reply] |
|
| [reply] |
Re: Regrettable module names
by hv (Prior) on Jul 04, 2004 at 14:48 UTC
|
To my mind, the biggest problem is uniqueness. How many different ways are there to design a "Foo::Simple" module? I'd suggest a name such as Config::Simple really doesn't tell anyone what they need to know, and rather only reflects who grabbed the name first.
As I understand it, perl6 will help solve this problem (or at least swap it for some new ones) by including the author as part of the significant namespace. That will free you up to release "Config::Reader" - to concentrate the name on what it does rather than how it does it.
Hugo
| [reply] |
|
| [reply] |
|
See also: *::Light (or Lite for those who can't speel)
| [reply] |
Re: Regrettable module names
by demerphq (Chancellor) on Jul 05, 2004 at 16:53 UTC
|
Naming things intelligently is hard. It requires a certain genius that frankly I think most people, like myself, lack. I spent a long time agonizing over what to call Data::Dump::Streamer. I eventually went with that name over some strong internal reservations (its too damn long for a utility modules) because a number of folks who i respect quite a bit seemed to favour it. Although a few releases later I added a "psuedo-namespace" to it called DDS, its not listed or registed but can be optionally installed when building DDS. The problem was that most of the Data:: namespace'es useful names are already taken, with a bunch of them taken by fairly poor quality modules. In fact I need to remove Data::BFDump as being obsoleted by Data::Dump::Streamer.
Also I've never understood why that name wasnt registered. Actually, while im not certain of this I have heard that of late very little registration is actually occuring. Perhaps because as you say you represent a SPOF and when you dont have the time the whole process comes to a halt.
The other one that _really_ annoys me is that the vast majority of Tie:: modules are horribly named. They should ALL be named Tie::Type(::Name)+. It seems so silly that there is no easy way to find out what types of tied array you can download for instance. I personally think Tie::Array::PackedC is a much better name than most of the Tie:: namespace. Consider:
Pretty much none of that last part of the list should have been registered IMO. I suppose its arguable that the ones _ending_ in 'Type' should be in the "not so badly named", but IMO they are just as bad. And there are probably a few in there that cant be better named because they have some special extra property, but even still I think the namespace is a just a big mess.
---
demerphq
First they ignore you, then they laugh at you, then they fight you, then you win.
-- Gandhi
| [reply] [d/l] |
|
And here we see why broadly-offered criticism is risky.
Take a look at Tie::Static which is one of your "outright badly named" modules. But take a closer look at it and tell me the better name that it should have, noting carefully that it handles scalars, arrays and hashes.
| [reply] |
|
And here we see why broadly-offered criticism is risky.
On the contrary I specifically mentioned that there would be a few such modules included in the "bad list":
And there are probably a few in there that cant be better named because they have some special extra property, but even still I think the namespace is a just a big mess.
So I think I preemptively resolved this point. Anyway, IMO that module should be named Tie::Any::Static or something along those lines. In fact, in my eyes the fact you cant tell that module can handle any type of tie just by looking at the name says to me its badly named.
---
demerphq
First they ignore you, then they laugh at you, then they fight you, then you win.
-- Gandhi
| [reply] |
Re: Regrettable module names
by tilly (Archbishop) on Jul 05, 2004 at 14:41 UTC
|
Talk about other people's modules at your own risk.
I'll risk it.
My complaint is about Class::Null. First of all it might help if the documentation clarified what the Null Class design pattern is supposed to be. Unfortunately it doesn't turn out to be that there is a Null object on which you can make any method call and get another Null back. (You can use overload to make your Null act like undef where appropriate.) Allowing you to chain method calls together. This is what I would have hoped for.
I can think of at least 3 perlmonks saints who have independently written what I would like Class::Null to be. I would happily write a version for release, but I don't have any decent name to give it, the obvious one already being taken. :-(
So, there is one useful CPAN module which is waiting on a decent name before it can be written. Any suggestions? | [reply] |
|
| [reply] |
|
I'd agree but I hate arguing over terminology. If someone cares enough about design patterns to have an opinion on what pattern they're using, I'm unlikely care enough to correct them. (I'm not a big fan of the design patterns movement. Shoot me.)
| [reply] |
|
I suppose Class::Null::Actually_Useful would be too facetious?
-QM
--
Quantum Mechanics: The dreams stuff is made of
| [reply] [d/l] |
|
| [reply] [d/l] |
|
Perhaps you mentioned the reference to overload? The needed changes to make the module do what I want are much bigger than what you said.
Which wouldn't be a problem except that the changes also have the disadvantage of not being backwards compatible with the current module. (For instance the returned objects should be false rather than true, which could mess someone up who tests that an object is there by checking for truth.) That incompatibility is why I decided to not offer a patch.
| [reply] |
Re: Regrettable module names
by beppu (Hermit) on Jul 05, 2004 at 13:49 UTC
|
This one's not my own, but (sorry Schwern):
- Ima::DBI
- It's a subclass of DBI that gives it a few extra methods, and it's widely deployed now thanks to the popularity of Class::DBI.
Hello, I'm a DBI.
| [reply] |
|
| [reply] [d/l] |
|
Quite right, since "Ima" means "Mother" in Hebrew (well, okay, Aramaic, but let's not get carried away), and I don't think it's supposed to be the mother of all DBI modules...
| [reply] |
|
That'll work great until you use some syntax-highlighting editor that mistakes it for a quoted string :)
You++ anyway, for finding an almost-good use of the single-quote package seperator.
----
send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.
| [reply] |
|
|
|
|
Re: Regrettable module names
by Matts (Deacon) on Jul 05, 2004 at 21:57 UTC
|
It's not my module, but I'm now the maintainer. I'd complain about XML::Parser.
It's such a bad name because it assumes it is THE parser for XML, and it's just not. So people download it thinking it's the best interface to parsing XML in perl, and it's not. | [reply] |
|
| [reply] |
Re: Regrettable module names
by grinder (Bishop) on Jul 06, 2004 at 09:14 UTC
|
With all due respect to matija for a great module (which is in use here as I speak), File::Tail isn't the best name for what it does (implementing Unix's tail -f (follow) idiom). I've needed the real tail (last n lines of a file) in the past, and the best I found was to use File::ReadFileBackwards and read the n lines needed and reverse the resulting array. I would say that File::Tail::Follow would have been a better name. That would leave File::Tail available for the standard Unix tail idiom.
Another poorly-named module, one of my workhorses, is Mail::Sendmail, which sends mail. It does not, however, require the sendmail program to do its job.
- another intruder with the mooring of the heat of the Perl
| [reply] |
|
Another poorly-named module, one of my workhorses, is Mail::Sendmail, which sends mail. It does not, however, require the sendmail program to do its job.
For that matter, Sendmail itself is a regrettable name. It probably made sense at the time, but is no longer the way to send mail.
----
send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.
| [reply] |
|
| [reply] |
|