note
Melly
<p>Hmm... I half agree with you. A week ago, any code containing ?: would have confused the hell out of me, but purely because I'd never used it or made myself familiar with what it did (or, to be honest, even knew it existed).</p>
<p>However, I think one has to make a distinction between "this is obfuscated because I don't recognise the operator" and "this is obfuscated because I don't understand what the use of this familiar operator is going to produce under these conditions".</p>
<p>IMHO, once the basics of ?: are understood, then one could argue that one line of code to assign a value to a variable, rather than 6 is no more or less obfuscated, but may make the code more readable purely on the basis of being shorter... still, this might make an interesting discussion point in meditations, so I'll raise it there, and edit my tutorial accordingly according to the consensus...</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-66612">
<code>
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>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
</code>
Tom Melly, pm@tomandlu.co.uk
</div></div>
587193
587211