Skip Menu |

This queue is for tickets about the XML-Compile CPAN distribution.

Report information
The Basics
Id: 35138
Status: resolved
Priority: 0/
Queue: XML-Compile

People
Owner: Nobody in particular
Requestors: adamk [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Switch to Perl-style method names?
If you recall our conversations from Oslo, you might have noticed I was making comments that were as much about public perception as about technical correctness. With regards to both XML::Compile and XML::Compile::SOAP, I note that you are currently using Java method naming throughout both modules. The documentation does not specific why this is being done. Is there a specific reason for using Java method naming, such as to match the method naming against some specific well-known Java API? If there's no technical difference between the two, would you consider switching to Perl-style method naming? I'm aware this would be a significant change, and it wouldn't be back-compatible. But it would most certainly increase the "comfort level" for people using the module, and thus help lead to higher acceptance and greater adoption. I learned this lesson myself in a previous project where I was using non-standard method naming, and it eventually became an annoyance and distraction in what was technically an excellent module. Since both modules are still quite young, I feel we probably still have an opportunity to move to Perl-style method names before adoption of the module gets high. If it becomes a matter of the work involved, I'd be happy to assist you in the conversion process. Best Regards Adam K
Subject: Re: [rt.cpan.org #35138] Switch to Perl-style method names?
Date: Thu, 17 Apr 2008 08:48:11 +0200
To: Adam Kennedy via RT <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Adam Kennedy via RT (bug-XML-Compile@rt.cpan.org) [080417 03:39]: Show quoted text
> Transaction: Ticket created by ADAMK > Queue: XML-Compile > Subject: Switch to Perl-style method names? > > If you recall our conversations from Oslo, you might have noticed I was > making comments that were as much about public perception as about > technical correctness.
Please do, but please do not expect me to always agree... Show quoted text
> If there's no technical difference between the two, would you consider > switching to Perl-style method naming?
What is "Perl-style naming", I have never encountered any reference to it. In all of my 8 years of Perl programming. And all the few dozen of conferences I went to. Programming Perl says: "You may find it helpful", which is pretty weak. What "They" taught me a very long time ago (and I consequently use) was ALL_CAPS Filehandles, Perl predefined, constants PerWordCaps package names oneSmall method names _startDash private methods small_chars my variables, functions, pragmas _small_chars private functions It is extremely useful to be able to distinquish between public and private, and between even more between functions and methods. Are you afraid for Java? It is also the naming scheme consequently used by Python and PHP. Exactly like I use it. C++ seems to use the a_method in its standard library. In Perl6 A12 (Objects) my quickscan found only 1 example which uses the_underscore. For the rest, there are only single word names being used. Maybe, it is a good idea if you join the standard set by all these languages. As alternative to the fague suggestion in the Perl book? Doesn't matter what the outcome is, I would certainly like to see a standard name scheme for Perl6, but there is no chance we can convince people into a PPD to describe that. And if someone like Larry would declare a standard for Perl5, I will write all my new modules with that standard. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #35138] Switch to Perl-style method names?
Date: Thu, 17 Apr 2008 19:14:49 +1000
To: bug-XML-Compile [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
Method names in CPAN modules are almost always done in with small_chars as well, the few modules that do use methodName are generally ports from Java. The best and most though documentation on naming conventions is Chapter 3 of Perl Best Practices, which covers this in depth. It does not make a distinction between identifiers when used as variables, functions or methods, they all follow the same convention "Separate words with underscores". Apart from the camel-casing of the methodNames, the rest of the casing you have there matches current conventions. Adam K
Subject: Re: [rt.cpan.org #35138] Switch to Perl-style method names?
Date: Thu, 17 Apr 2008 14:09:55 +0200
To: Adam Kennedy via RT <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Adam Kennedy via RT (bug-XML-Compile@rt.cpan.org) [080417 09:21]: Show quoted text
> Queue: XML-Compile > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=35138 > > > Method names in CPAN modules are almost always done in with small_chars > as well, the few modules that do use methodName are generally ports from > Java.
I don't know. I cannot distinuish between methods and function whens I grep. YAML, Data::Dumper, GetOpt::Long use a leading capital for functions and methods. The standard you suggest is not there, even not in core. I would like it to exist, please make it happen. Discuss the official standard for Perl5 on p5p. Once agreed upon, I will follow that standard in all new modules I develop. Perl is a mess, and we have to live with it. Or simpler: try to get this standard in the Perl6 design. We cannot easily correct mistakes from the past, but may prevent them for the future. Certainly, I would embrace this kind of increased quality for Perl. I'll back you in the attempts. Show quoted text
> The best and most though documentation on naming conventions is Chapter > 3 of Perl Best Practices, which covers this in depth.
Sorry, gave my own copy ways to new users, already twice... have none at hand, at the moment. I have read it once (when it came out), so probably I have read his opinion about the subject. As far as I know, no-one has declared "Best Practices" the official standard. Gladly, a lot of companies use it to have a start for a coding standard based on that book. None so far got as far as declaring it the official standard for internal use... or do you know any? Last YAPC::EU, it was auctioned which page to rip out the book. For 400 euros, someone had Damian rip-out the first rule: where to put the accolades. Another of these holy wars. Show quoted text
> It does not make a distinction between identifiers when used as > variables, functions or methods, they all follow the same convention > "Separate words with underscores".
Well, it is quite impractical. A lot of code mixes function calls and method calls. It is a little bit harder to remember which one of those should be called when you have no visual help from the name. Real-life story: today I had a visit from a guy who I never met before, and who does program perl a lot without being in touch with our core community, who used the same function/method differentiation as I did (and Java/JavaScript/C#/PHP/Python use). I am not alone! Damian's/your suggestion, and applied by many -but far from all- core modules, is shared by Ruby and C++. Show quoted text
> Apart from the camel-casing of the methodNames, the rest of the casing > you have there matches current conventions.
... matches the conventions proposed in the book by Damian, is probably what you mean. XML::LibXML is my base module, and is using my convension for its library, so it seems me best not to divert from that. This is the best reason not to change the current notation. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #35138] Switch to Perl-style method names?
Date: Sun, 4 May 2008 21:31:21 +0200
To: Adam Kennedy via RT <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* MARKOV Solutions (solutions@overmeer.net) [080417 14:09]: Show quoted text
> * Adam Kennedy via RT (bug-XML-Compile@rt.cpan.org) [080417 09:21]:
> > Queue: XML-Compile > > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=35138 > > > > > Method names in CPAN modules are almost always done in with small_chars > > as well, the few modules that do use methodName are generally ports from > > Java.
Show quoted text
> The standard you suggest is not there, even not in core. I would like > it to exist, please make it happen. Discuss the official standard for > Perl5 on p5p. Once agreed upon, I will follow that standard in all new > modules I develop.
I must say, I am a bit disappointed that our thread ended prematurely. You were so convinced about the existence of a standard, which is nowhere pro-claimed it to be, not by Larry and not by Damian. I did not see any continuation of this discussion on either Perl5 or Perl6 mailing-lists, which is a pitty. Quality requires some coding standards. Are you preparing a debate to get the conventions Damain suggest in "Best Practices" as de-facto standard for Perl5 or Perl6? Or maybe only for core modules, to start with? Subject for a nice talk at YAPC? You may share my feeling that this is a hopeless battle in our community. In any case, I think I will close this ticket. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #35138] Switch to Perl-style method names?
Date: Mon, 05 May 2008 14:51:33 +1000
To: bug-XML-Compile [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
Mark Overmeer via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=35138 > > > * MARKOV Solutions (solutions@overmeer.net) [080417 14:09]: >
>> * Adam Kennedy via RT (bug-XML-Compile@rt.cpan.org) [080417 09:21]: >>
>>> Queue: XML-Compile >>> Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=35138 > >>> >>> Method names in CPAN modules are almost always done in with small_chars >>> as well, the few modules that do use methodName are generally ports from >>> Java. >>>
> >
>> The standard you suggest is not there, even not in core. I would like >> it to exist, please make it happen. Discuss the official standard for >> Perl5 on p5p. Once agreed upon, I will follow that standard in all new >> modules I develop. >>
> > I must say, I am a bit disappointed that our thread ended prematurely. > You were so convinced about the existence of a standard, which is nowhere > pro-claimed it to be, not by Larry and not by Damian. I did not see any > continuation of this discussion on either Perl5 or Perl6 mailing-lists, > which is a pitty. Quality requires some coding standards. > > Are you preparing a debate to get the conventions Damain suggest in > "Best Practices" as de-facto standard for Perl5 or Perl6?
There will not be an official standard. There's more than one way to do it, as they saying goes. That's not to say that one way isn't better, and while it may not be an official standard, it would be a reasonable proposition that the conventions Damian details in PBP are the defacto standard. I note the JSON module, which has deprecated the camelCase interface. It comes down to this though. Just because your choice may hurt adoption rates, doesn't mean you "can't" do it, and you've clearly demonstrated that you won't be changing your method naming scheme, regardless of anything I might do, so a public debate would be rather pointless. You can close this bug. Show quoted text
> Or maybe only > for core modules, to start with? Subject for a nice talk at YAPC? You > may share my feeling that this is a hopeless battle in our community. > > In any case, I think I will close this ticket.
Subject: Re: [rt.cpan.org #35138] Switch to Perl-style method names?
Date: Mon, 5 May 2008 09:17:48 +0200
To: Adam Kennedy via RT <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Adam Kennedy via RT (bug-XML-Compile@rt.cpan.org) [080505 04:57]: Show quoted text
> > Are you preparing a debate to get the conventions Damain suggest in > > "Best Practices" as de-facto standard for Perl5 or Perl6?
Show quoted text
> Just because your choice may hurt adoption rates, doesn't mean you > "can't" do it, and you've clearly demonstrated that you won't be > changing your method naming scheme, regardless of anything I might do, > so a public debate would be rather pointless.
I do not suggest a "public debate about XML::Compile naming scheme", but a "public debate about adopting Best Practices as Perl Standard". Or parts thereof. That is certainly not a pointless discussion. When I have a brave moment, I will ask Larry on the Perl6 list for a decission. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Discussion naming convensions should take place on Perl5 and Perl6 mainling-lists. There is no official Perl standard, nor consequent behavior in Perl Core modules.