3 ms·
100% agree. These optimizations in readability help a lot. Also, a failure to optimize code for readability makes reading code difficult. I once read some code
by cjfd 7y ago
100% agree. These optimizations in readability help a lot. Also, a failure to optimize code for readability makes reading code difficult. I once read some code where I immediately concluded that something was wrong because a function was being called from the wrong method. Turned out that it actually was in the right method but there was no vertical space between two methods giving the wrong impression of where that particular method call actually was. I feel quite alone with this opinion though. I see messy code all around me. One particular thing that everybody seems to agree on but that is pretty much objectively bad is the common way to line up lambdas. People do
some_object.some_method((p, q) =>
{
do_things()
})
while the right way of doing this clearly is
some_object.some_method(
(p, q) =>
{
do_things()
})
The 'broken lambda' that one tends to see everywhere is driving me nuts.
The principle is that code already should give the right impression of what is going on at the first glance. Another thing that is quite a spectacular failure in this regard is the google style guide. The indents of 2 tabs combined with braces that do not line up must have been optimized to be as unreadable as possible.
- deleted 7y ago[deleted]
- majewsky 7y agoSee, that's how different people are. For me, the clearest formatting is obviously some_object.some_method((p, q) => { do_things() }) Your preferred version has way too much useless whitespace.