Re: [Koha-devel] Add rule for experimental features in coding guidelines

2015-09-30 Thread Jonathan Druart
Maybe it would be better to just specify that the code has to pass the koha-qa script. The experimental warnings is raised by perl -w and caught by this script. 2015-09-29 3:26 GMT+01:00 David Cook : > Hi all: > > > > I just noticed that we don’t actually have a rule against using experimental > f

Re: [Koha-devel] Add rule for no subroutines in PL scripts

2015-09-30 Thread Philippe Blouin
Because the code would be extremely specific to a specific functionality, whereas the code in the libraries is there to be reused. And let not go overboard with OO. A script is a script is a script. Make it readable, add functions to make it cleaner, make your functions readable. And make so

Re: [Koha-devel] Add rule for no subroutines in PL scripts

2015-09-30 Thread Tomas Cohen Arazi
2015-09-30 9:20 GMT-03:00 Philippe Blouin : > Because the code would be extremely specific to a specific functionality, > whereas the code in the libraries is there to be reused. > And let not go overboard with OO. > We embrace the OO paradigm for most of the CRUD operations, but we also have lib

Re: [Koha-devel] Add rule for no subroutines in PL scripts

2015-09-30 Thread Marcel de Rooy
I could understand that Philippe would write a sub in a script. If we forbid that, we could [theoretically] get here: Better write hard code in one big chunk and call it a script (without unit tests) than provide good code with some subs that have no real meaning outside the script and therefor

Re: [Koha-devel] Add rule for no subroutines in PL scripts

2015-09-30 Thread Christopher Nighswonger
On Wed, Sep 30, 2015 at 8:20 AM, Philippe Blouin wrote: > Because the code would be extremely specific to a specific functionality, > whereas the code in the libraries is there to be reused. > And let not go overboard with OO. > > A script is a script is a script. Make it readable, add functions

Re: [Koha-devel] Add rule for no subroutines in PL scripts

2015-09-30 Thread Barton Chittenden
On Wed, Sep 30, 2015 at 10:18 AM, Tomas Cohen Arazi wrote: > > 2015-09-30 9:20 GMT-03:00 Philippe Blouin : > >> Because the code would be extremely specific to a specific functionality, >> whereas the code in the libraries is there to be reused. >> And let not go overboard with OO. >> > > We embr

Re: [Koha-devel] Add rule for no subroutines in PL scripts

2015-09-30 Thread Michael Hafen
I thought I would share a bash script since Barton mentioned mucking with the environment. Thought in the context of this discussion it might not be appreciated. To use the script just log into Koha on any computer, and use this script on the server to get into perl's debugging mode. If the scri

Re: [Koha-devel] Add rule for no subroutines in PL scripts

2015-09-30 Thread David Cook
Thanks for that Tomas. I don’t think I have anything substantive to add. Recently, I’ve done a lot of work on another Perl project which often doesn’t use subroutines or has them scattered around in files, which make them impossible to test. It makes development more difficult and it makes r

Re: [Koha-devel] Add rule for no subroutines in PL scripts

2015-09-30 Thread David Cook
Sorry, Chris, but I'm not sure I understand what you're saying here. I suppose I don't really think about it in terms of libraries but rather in terms of classes. In theory, a script should be able to be broken down into concepts which fit into classes. I think sometimes we end up using subrou

Re: [Koha-devel] Add rule for experimental features in coding guidelines

2015-09-30 Thread David Cook
I'm perfectly happy with that : ) David Cook Systems Librarian Prosentient Systems 72/330 Wattle St, Ultimo, NSW 2007 > -Original Message- > From: koha-devel-boun...@lists.koha-community.org [mailto:koha-devel- > boun...@lists.koha-community.org] On Behalf Of Jonathan Druart > Sent: Wedne

Re: [Koha-devel] Add rule for no subroutines in PL scripts

2015-09-30 Thread Christopher Nighswonger
On Wed, Sep 30, 2015 at 8:08 PM, David Cook wrote: >Sorry, Chris, but I'm not sure I understand what you're saying here. Let me see if I can clarify it a bit. > I suppose I don't really think about it in terms of libraries but rather in > terms of classes. In theory, a script should be able to

Re: [Koha-devel] Add rule for no subroutines in PL scripts

2015-09-30 Thread David Cook
Hi Chris: Thanks for taking the time to explain your thoughts. In the case of http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=labels/label-create-pdf.pl;h=e69ba41e55634d5b15ad7a993edbd203b649424d;hb=HEAD, I probably would've structured the code differently. If you look at _print_text