Re:Things Every Programmer Should Know
by barking on Friday September 20, 2013 @09:09AM
(#6417426)
That's why it's worth having short methods that do one thing and are meaningfully named.
And from a personal point of view I'd prefer several lines containing short expressions that are then assigned to meaningfully named variables etc, rather than 1 really long hard to parse line of code.
[ Parent
| on HN ]
Re:Things Every Programmer Should Know
by reginaldjcooper on Friday September 20, 2013 @10:45AM
(#6418005)
This is how I originally felt a few years ago doing Ruby, and I have tried to make all my code human-readable since.
Yeah, nothing wrong with that, and if you do have a longer/more complex equation (like a C# LinqToSql where statement), you can always make it formatted multi-lined instead of in-line to improve readability. My point was mostly about not using comments that describe the code.