<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
@font-face
        {font-family:"Segoe UI Symbol";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.moz-signature, li.moz-signature, div.moz-signature
        {mso-style-name:moz-signature;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:white;}
p.siginlibro, li.siginlibro, div.siginlibro
        {mso-style-name:sig_inlibro;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Trebuchet MS",sans-serif;
        color:#888888;}
p.sigcontent, li.sigcontent, div.sigcontent
        {mso-style-name:sig_content;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        background:#F6F6F6;
        border:none;
        padding:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
p.nom, li.nom, div.nom
        {mso-style-name:nom;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:#005B85;
        font-weight:bold;}
p.inlibro, li.inlibro, div.inlibro
        {mso-style-name:inlibro;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:#BFD13D;}
p.in, li.in, div.in
        {mso-style-name:in;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:14.5pt;
        font-family:"Times New Roman",serif;
        color:#BFD13D;}
p.libro, li.libro, div.libro
        {mso-style-name:libro;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:14.5pt;
        font-family:"Times New Roman",serif;
        color:#005B85;}
p.desc, li.desc, div.desc
        {mso-style-name:desc;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
p.small, li.small, div.small
        {mso-style-name:small;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:9.5pt;
        font-family:"Times New Roman",serif;
        color:black;}
p.tagline, li.tagline, div.tagline
        {mso-style-name:tagline;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:#00BCE4;}
p.sigfooter, li.sigfooter, div.sigfooter
        {mso-style-name:sig_footer;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        background:#EEEFEA;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;}
span.nom1
        {mso-style-name:nom1;
        color:#005B85;
        font-weight:bold;}
span.tagline1
        {mso-style-name:tagline1;
        color:#00BCE4;}
span.in1
        {mso-style-name:in1;
        color:#BFD13D;}
span.libro1
        {mso-style-name:libro1;
        color:#005B85;}
span.EmailStyle32
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><a name="_MailEndCompose"><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US'>Philippe, could you explain how it’s more messy to have code in modules? <o:p></o:p></span></a></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US'>Generally speaking, I can’t think of a reason why there would be code that is extremely specific to some script. I think the preference these days is to use object oriented code, which does isolate mess, so the code should be in the class. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US'>As Tomas points out, it also makes it more difficult to write unit tests for functions, if it’s isolated in a script with no other way of calling that code.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>David Cook<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>Systems Librarian<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>Prosentient Systems<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>72/330 Wattle St, Ultimo, NSW 2007<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'> Philippe Blouin [mailto:philippe.blouin@inlibro.com] <br><b>Sent:</b> Wednesday, 30 September 2015 12:52 AM<br><b>To:</b> Tomas Cohen Arazi <tomascohen@gmail.com><br><b>Cc:</b> David Cook <dcook@prosentient.com.au>; koha-devel@lists.koha-community.org<br><b>Subject:</b> Re: [Koha-devel] Add rule for no subroutines in PL scripts<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'>The alternative would be to add some code extremely specific to some script (like parsing some line of data) into a Koha/ library?  Seems more messy.<br><br>I like to isolate my mess.<o:p></o:p></p><div><div><div style='border-top:solid #DDDDDD 1.5pt;border-left:none;border-bottom:solid #BFD13D 1.5pt;border-right:none;padding:0cm 0cm 0cm 0cm'><p class=MsoNormal style='background:#F6F6F6'><span class=nom1><span style='font-size:11.0pt;font-family:"Trebuchet MS",sans-serif'>Philippe Blouin,</span></span><span style='font-size:11.0pt;font-family:"Trebuchet MS",sans-serif;color:#888888'><br></span><span class=tagline1><span style='font-size:11.0pt;font-family:"Trebuchet MS",sans-serif'>Responsable du développement informatique</span></span><span style='font-size:11.0pt;font-family:"Trebuchet MS",sans-serif;color:#888888'><o:p></o:p></span></p><p class=desc style='background:#F6F6F6'><span style='font-size:11.0pt;font-family:"Trebuchet MS",sans-serif;color:#888888'>Tél.  : (888) 604-2627<br><a href="mailto:philippe.blouin@inLibro.com"><span style='color:#005B85;text-decoration:none'>philippe.blouin@inLibro.com</span></a> <o:p></o:p></span></p></div><div><p class=MsoNormal style='background:#EEEFEA'><span class=in1><span style='font-size:13.0pt;font-family:"Trebuchet MS",sans-serif'>in</span></span><span class=libro1><span style='font-size:13.0pt;font-family:"Trebuchet MS",sans-serif'>Libro</span></span><span style='font-size:11.0pt;font-family:"Trebuchet MS",sans-serif;color:#888888'> </span><span class=tagline1><span style='font-size:11.0pt;font-family:"Trebuchet MS",sans-serif'>| pour esprit libre |</span></span><span style='font-size:11.0pt;font-family:"Trebuchet MS",sans-serif;color:#888888'> <a href="http://www.inLibro.com"><span style='font-size:9.0pt;color:#005B85;text-decoration:none'>www.inLibro.com</span></a> <o:p></o:p></span></p></div></div></div><p class=MsoNormal>On 09/29/2015 09:24 AM, Tomas Cohen Arazi wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>2015-09-29 9:23 GMT-03:00 Philippe Blouin <<a href="mailto:philippe.blouin@inlibro.com" target="_blank">philippe.blouin@inlibro.com</a>>:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal>Hi!<br>Morning here, maybe my brain is not ignited yet.  But why such a rule? (if i understand its meaning correctly).<o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Because that way there's no way to properly write unit tests for the function. And code gets messy too.<o:p></o:p></p></div><div><p class=MsoNormal>I'll call for a dev meeting and add this to the agenda.<o:p></o:p></p></div></div><p class=MsoNormal><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>-- <o:p></o:p></p><div><div><div><p class=MsoNormal><span style='font-size:9.5pt'>Tomás Cohen Arazi<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:9.5pt'>Theke Solutions (<a href="http://theke.io/" target="_blank">http://theke.io</a>)<br></span><span style='font-size:9.5pt;font-family:"Segoe UI Symbol",sans-serif'>✆</span><span style='font-size:9.5pt'> +54 9351 3513384<br>GPG: B76C 6E7C 2D80 551A C765  E225 0A27 2EA1 B2F3 C15F<o:p></o:p></span></p></div></div></div></div></div></blockquote><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>