Yes, Tres, I think we agree 100%. Naming conventions are one of the most
important things in programming; without them we'd probably all go crazy.
:-)

I should have made it clear in my original reply that I was just addressing
the question that I thought was being asked, "If I rename the .js file for a
plugin, will it break?" For example, suppose a plugin author (we'll call him
"Mike") didn't follow the recommended convention, and you are loading these
plugins:

  jquery.one-good-plugin.js
  jquery.another-good-plugin.js
  mikes-cool-plugin-with-an-unconventional-name.js

Would anything break if you renamed Mike's plugin with a more consistent
name?

  jquery.one-good-plugin.js
  jquery.another-good-plugin.js
  jquery.mikes-plugin.js

It's unlikely that this would do any harm, since a typical jQuery plugin (or
any JavaScript code) shouldn't care what its filename is, and in fact it
would have to go to some work to find out that filename.

So a developer should feel free to do that renaming, or better yet to
combine all of the plugins into a single file for faster loading:

  all-my-plugins.js

-Mike

> From: tres
> 
> Yes we are, sorry, I wasn't trying to offend you and I wasn't 
> trying to say one person is more important than another. 
> However, the distinction should have been made clear as it 
> sounded to me like your post was promoting bad practices. If 
> that is untrue, discard my message. And yes, personal 
> comments aren't cared for and I apologize.
> 
> Now to the main point:
> 
> No, jQuery and JavaScript will not care about your naming 
> conventions and the compiling of scripts. You can use 
> whatever you want, but it is recommended in the documentation 
> to use that naming convention. I think the naming convention 
> guideline exists so that plugin authors all follow the same 
> convention as many people have different ideas about what to 
> name their plugin file(s). It doesn't mean someone else's is 
> wrong or right, it is just a guideline.
> 
> 
> 
> On Jul 28, 3:51 am, "Michael Geary" <m...@mg.to> wrote:
> > Tres, personal comments like "If I were a colleague of 
> yours..." are 
> > not really called for. (Don't worry, no offense taken.) And no one 
> > here is more "important" than anyone else. We are all here to help 
> > each other out and learn from each other.
> >
> > Yes, of course it is important to use good naming conventions - for 
> > everything, files, functions, and variables too. I spend a 
> lot of time 
> > choosing function and variable names in the hope of making my code 
> > easier to read.
> >
> > But I'm pretty sure that Rick wasn't asking "If I write a 
> plugin, does 
> > it matter what I name the .js file?" I think his question 
> was, "If I 
> > use some plugins on my page, will anything break if I change their 
> > filenames or URLs?" (Rick, correct me if I misunderstood you.)
> >
> > I'm sorry I didn't make that distinction clear in my reply.
> >
> > Are we on the same page now? :-)
> >
> > -Mike
> >
> >
> >
> > > From: tres
> >
> > > @Michael Greary
> >
> > > In general it is good convention and good practice to follow a 
> > > naming convention with your files. That goes for any file and not 
> > > just JavaScript.
> >
> > > -- "Where does it say that" --
> >
> > > Onhttp://docs.jquery.com/Plugins/Authoringit says "Name your file 
> > > jquery.[insert name of plugin].js, eg.
> > > jquery.debug.js" under "There are a few very important points to 
> > > remember:"
> >
> > > -- "It's completely wrong" --
> >
> > > You sure about that? I'm thinking someone very important 
> in jQuery 
> > > wrote just those guidelines.
> >
> > > -- "The filename means nothing unless the JavaScript code itself 
> > > cares about it, and that would be a very rare case. --
> >
> > > If I were a colleague of your's, I would definitely care 
> about the 
> > > naming conventions that are used. JavaScript may not, but 
> JavaScript 
> > > also doesn't care if you compile all of your JS files 
> into one file 
> > > for less HTTP requests.
> > > On Jul 27, 3:29 pm, "Michael Geary" <m...@mg.to> wrote:
> > > > Where does it say that? It's completely wrong. The 
> filename means 
> > > > nothing unless the JavaScript code itself cares about 
> it, and that 
> > > > would be a very rare case.
> >
> > > > In fact, it's highly recommended practice to combine 
> all of your 
> > > > plugins and other JavaScript code into a single .js file for 
> > > > faster download.
> > > > > From: rickoshay
> >
> > > > > The documentation says the file name for a plug-in is very 
> > > > > important. There are no "files" from the browser's 
> perspective 
> > > > > but if we're talking about a URI pattern, why is it "very 
> > > > > important"? Having the flexibility to serve up 
> plug-in scripts 
> > > > > using any old URI would be preferable.
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to