<?xml version="1.0" encoding="windows-1252"?>
<node id="1013557" title="Re: Two simple code style advice questions" created="2013-01-16 05:45:40" updated="2013-01-16 05:45:40">
<type id="11">
note</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
&lt;p&gt; 1) I have no preference (&lt;small&gt;even if slice might Benchmark faster&lt;/small&gt;), its all the same , but I like to online the slice 
&lt;p&gt; &lt;tt&gt; my %foo; @foo{@bar} = (0) x @bar; &lt;/tt&gt;
&lt;p&gt;Just because its not legal to &lt;c&gt; my( @foo{ @bar } ) = (0) x @bar; &lt;/c&gt; doesn't mean it can't be onelined :)
&lt;p&gt; 2) This one is trickier, both of those irritate me slightly, though not enough prefer  either, or not-use either :)
&lt;p&gt; Out of habit, unless my editor helps out with whitespace, I multi-line my ternary &lt;c&gt;
my $foo = 42 == $bar
          ? ".."
          : "";&lt;/c&gt;
&lt;p&gt; Although I actually prefer
&lt;p&gt; &lt;tt&gt; my $foo = ""; 42==$bar and $foo = "forty two"; &lt;/tt&gt;
&lt;p&gt; I'm fine with &lt;c&gt; my $foo = ""; $foo = "forty two" if 42==$bar; &lt;/c&gt; too
&lt;p&gt; All the choices are very much a non issue for me, even if the slightly irritating versions break/disrupt flow/scanability/skimmability for some, like inline comments ( [id://915945]), I doesn't slow me down much , its mosquito or hurdle not doors/walls</field>
<field name="root_node">
1013548</field>
<field name="parent_node">
1013548</field>
<field name="reputation">
22</field>
</data>
</node>
