Just curious, is it better to go for clarity in code, or for something totally obscure that fits into a one-liner? I’m thinking in particular about a nested if statement. If put into a conditional within a conditional, the result could be very confusing, while the nested if structure seems more clear.
Good one-liners are clear (the assignment was a special case where we emphasized one-liner-ness over clarity). If a one-liner starts to edge towards cloudiness, bring in the sun, and expand it to multiple lines.
October 12th, 2007 at 2:24 pm
And the solutions are mostly one-liners . . .
October 13th, 2007 at 6:04 am
Just curious, is it better to go for clarity in code, or for something totally obscure that fits into a one-liner? I’m thinking in particular about a nested if statement. If put into a conditional within a conditional, the result could be very confusing, while the nested if structure seems more clear.
October 15th, 2007 at 10:18 am
Clarity.
Good one-liners are clear (the assignment was a special case where we emphasized one-liner-ness over clarity). If a one-liner starts to edge towards cloudiness, bring in the sun, and expand it to multiple lines.