This probably certainly only makes sense to a small proportion of the worlds population, but I wish to share something I dislike about programming, about parenthesis in particular.
Now if I am changing the following line;
if ($flight['CostWithTax']) == $out['cost']) {
to
if (floatval($flight['CostWithTax']) == floatval($out['cost'])) {
..I obviously have the option of putting the extra bracket either in the red position or the green position...
...$out['cost']•)• {
Now if I were to put it in the green position, I would feel the code was wrong. It would haunt me and I would feel upset, possibly even shedding a tear or two. It's just so BAD to put the bracket there, since the bracket closing the if expression would be inside the bracket closing the floatval() function.
Therefore, every time, I -have- to put the closing parenthesis inside the existing bracket, at position red. Even if this means pressing a few more keys.
I'm curious, does anyone else have this problem?
No.
by Mac at 18:31 on 14th Sep 2004
Depends on my mood. If it's the start of the day, yes. By the end of the day, I will usually do just about anything, as long as the code compiles. None of the CSS I wrote today is even indented.
by 1086 at 21:52 on 15th Sep 2004
its funny, thinking about it i always put the additional closing parenthesis before the existing bracket without really realising until now that you have pointed it out, i don't think i've ever put it after the existing bracket.