3 ms·
Statments, that's in no way easer to parse than that some code on a single line. (Assuming you have collar coding for the ()'s in your IDE.) c = 9 * ((d > 7
by Retric 18y ago
Statments, that's in no way easer to parse than that some code on a single line. (Assuming you have collar coding for the ()'s in your IDE.)
c = 9 * ((d > 7)?e:f);
x = ( a = 7 * (b = 14)) + c;
IMO is not that bad, it's the mixing of all the assignments and the conditional that makes it hard to parse, and
c = 9 * ((d > 7)?e:f);
x = c + (a = 7 * (b = 14));
is fairly readable even if some of the ()'s are not needed.
PS: ;'s I thought it was clear that the ;'s denoted lines not the whitespace which is meaningless.
- philwelch 18y agoSemicolons do denote statements, but that doesn't prevent you from clever use of line breaks. I still think my version is more readable.
- Retric 18y agoEdit: NM, reply is now working. I just wanted to say that personaly I have tryed learn to ignore indention and other clues becasue it's far more costly to misunderstand what the code is doing than try and use hint's that may have become old over time. To paraphrase: in that way lay bugs that look like dragons. I also tend to do the same thing with comments on the first pass though. It's only when I don't understand the code or or it looks "odd" that I start to notice the extras like that.