<?xml version="1.0" encoding="windows-1252"?>
<node id="587227" title="?: = Obfuscation?" created="2006-12-01 11:19:54" updated="2006-12-01 06:19:54">
<type id="120">
perlmeditation</type>
<author id="66612">
Melly</author>
<data>
<field name="doctext">
&lt;p&gt;A couple and half of monks (I'm the half ;) think that the ?: operator-pair is always less readable than an if/else block.&lt;/p&gt;
&lt;p&gt;As indicated, I half-agree, but I wonder if this is more a case of "I don't use or am not familiar with ?:, and therefore it's obfuscated" or "I understand the syntax of ?: perfectly, but I still think it makes code hard to read and/or maintain".&lt;/p&gt;
&lt;p&gt;The maintainability issue is a tricky one, but, given that ?: is not an operator-pair limited to perl, is it unreasonable to expect any code-maintainer to understand it? (or at least make the effort to find out about it?)&lt;/p&gt; 
&lt;p&gt;What's the consensus on this one?&lt;/p&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-66612"&gt;
&lt;code&gt;
map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2
-$d**2+$b);$c=$d**2+$e**2&gt;4?$d=8:_}1..50;print$c}0..59;print$/}0..20
&lt;/code&gt;
Tom Melly, pm@tomandlu.co.uk
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
