its ur plugin... u r the boss... but i think u misunderstood my point. so,
just to make it clear... i am not a fan of long method names. i am all for
short and sweet.

My intention was to tell you that the jquery plugin architecture is such
that, each plugin is kinda a method on the jquery object itself.
since there can only be one method with a given name, i am suggesting that
mask() can be used by some other plug-in which is gonna deal with elements
that are more generic.
since ur plugin specifically addresses form input elements, it would make
more sense to give it the more specific name.
This way, both ur plugin(which is specific to form elements) and the more
generic plugin(fictious at the moment) can work seamlessly without
conflicts.

Again, u r the boss, so ignore my suggestions if u dont find value in it.

-GTG

On 6/28/07, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:

 I would prefer .maskInput as the method name, coz, it conveys both the
intention and what it applies to. "mask" doesnt convey where it applies to
and probably can be used for a more generic plugin.

$('input.date').mask(...) should be good enough to imply what is meant I
think. I used to be in favor of longer function names myself a while back,
but recently found that shorter is better in most cases. A good example is
jQuery itself:  we have css() instead of setStyle(), load() instead of
ajaxLoad() etc. The thing is as longer your name get's the less intuitive it
is. When I started using jQuery I would discover functions by virtually
guessing their names and only use the API if that resulted in an error. So
I'm going to vote for mask() again ; ).

-- Felix
--------------------------
My latest blog posts:

[image: ThinkingPHP and beyond]<http://feeds.feedburner.com/~r/thinkingphp/~6/1>

My Business: http://www.fg-webdesign.de


Ganeshji Marwaha wrote:

I would prefer .maskInput as the method name, coz, it conveys both the
intention and what it applies to. "mask" doesnt convey where it applies to
and probably can be used for a more generic plugin.

Regarding, the namespace for additional methods. I agree that MaskedInput
is the one that actually makes sense. But for the sake of simplicity and
consistency, i would name it MaskInput instead.

-GTG


On 6/28/07, Josh Bush <[EMAIL PROTECTED]> wrote:
>
>
> As my masked input plugin approaches 1.0, I'm noticing that my plugin
> isn't following the conventions of the jQuery library itself.
>
> Currently my plugins main method is .maskedinput(mask,options)
>
> I'm thinking I should change it to .maskInput(mask,options) or
> simpley .mask(mask,options)
>
>
> I think this change is good because it's a verb and it shows action.
>
> Also, there is a global method which allows user defined char
> placeholders which Jörn advided me to namespace off.
>
> So, I plan to put it in $.MaskedInput.addPlaceholder(character,regex).
>
> What do you all think of the proposed name changes?  I think it's
> important to remain consistent with the base library.  I want to make
> sure that I get everything settled once I reach 1.0.
>
> Thanks
> Josh
> digitalbush.com
>
>

<<inline: thinkingphp.1.gif>>

Reply via email to