2 ms·
The one thing I've never seen mentioned in style guide is that maybe the same piece of code should take the style of whatever is fitting in its context? For ex
by NhanH 11y ago
The one thing I've never seen mentioned in style guide is that maybe the same piece of code should take the style of whatever is fitting in its context?
For example, let's say there are 20 case where it's a single line return, then shouldn't be "if(rc < 0) return rc;" better. On the other hand, if the other condition in that block of code all need brackets, it just seems good sense for the single line condition to have bracket too.
It could be extending pretty much to all other syntactic sugar even in higher level language (map + lambda vs for loop?)
- voltagex_ 11y agoYeah, the replies here are making me doubt myself - I probably just need to slow down when reading code