<?xml version="1.0" encoding="windows-1252"?>
<node id="999342" title="Re: 78/80 chars perl line still a meaningful rule" created="2012-10-16 10:18:36" updated="2012-10-16 10:18:36">
<type id="11">
note</type>
<author id="647953">
sundialsvc4</author>
<data>
<field name="doctext">
&lt;p&gt;
Thirty years ago I would have given you a different answer. &amp;nbsp; Today, I think that most source-code lines already do fit within a &amp;ldquo;reasonable&amp;rdquo; length, such that, if they don&amp;rsquo;t, they are probably already hard-to-read for reasons other than just the number of characters in the line.
&lt;/p&gt;&lt;p&gt;
A very common example is: &amp;nbsp; subroutine calls. &amp;nbsp; You can have very long lists of parameters there, sometimes. &amp;nbsp; Although I tend to prefer using a single hashref instead, &amp;ldquo;existing-code is what existing-code is.&amp;rdquo; &amp;nbsp; That&amp;rsquo;s where you encounter length ... &lt;em&gt;and&lt;/em&gt; a choice site for breaking the call into multiple lines, perhaps with comments. &amp;nbsp; Even so, what you are trying to simplify is not so much &amp;ldquo;scrolling from left to right,&amp;rdquo; but &amp;ldquo;counting commas.&amp;rdquo; &amp;nbsp; Ultimately you are trying to improve at-a-glance clarity, not merely to reduce line length.
&lt;/p&gt;&lt;p&gt;
Character strings: &amp;nbsp; write several shorter literals and concatenate. &amp;nbsp; Better yet, write a shorter error-message to begin with, because you&amp;rsquo;d prefer that the user actually reads it.
&lt;/p&gt;&lt;p&gt;
So, to me, this isn&amp;rsquo;t a &amp;ldquo;rule,&amp;rdquo; &lt;i&gt;i.e.&lt;/i&gt; strictly concerned with length and/or saying that you have actually made the code &amp;ldquo;better&amp;rdquo; just by folding the lines.
&lt;/p&gt;&lt;p&gt;
As I said in the other post, you can really &lt;em&gt;hose up&lt;/em&gt; a file, in terms of the source-code control system, if you reformat the whole thing, because you have just wiped-out the history of source-code changes to a particular area. &amp;nbsp; Hence, I advocated selective reformatting of particular problem areas &lt;i&gt;(with prior agreement from your management and from &lt;u&gt;all&lt;/u&gt; of your colleagues!)&lt;/i&gt; and checking-in those revisions separately, having made no other changes in the same commit. &amp;nbsp; Sometimes, the continuity of per-line history through a particular hot-spot is more important than &amp;lbrack;&lt;i&gt;e.g.&lt;/i&gt; as a result of all these many changes over time&amp;rbrack; &amp;ldquo;it stinks.&amp;rdquo;
&lt;/p&gt;/p</field>
<field name="root_node">
999267</field>
<field name="parent_node">
999267</field>
</data>
</node>
