On Wed, Aug 30, 2017 at 06:26:18PM -0600, Eric Rescorla wrote:
> On Wed, Aug 30, 2017 at 4:41 PM, Jeff Gilbert wrote:
>
> > IMO: Never else-for. (or else-while)
> >
> > Else-if is a reasonable continuation of concept: "Well it wasn't that,
> > what if it's this instead?"
> > Else-for is just shor
On Wed, Aug 30, 2017 at 4:41 PM, Jeff Gilbert wrote:
> IMO: Never else-for. (or else-while)
>
> Else-if is a reasonable continuation of concept: "Well it wasn't that,
> what if it's this instead?"
> Else-for is just shorthand for "well it wasn't that, so let's loop
> over something".
>
> Else-if
Only negative reactions to `else for` so far, and it's only used a couple of
times in our code:
http://searchfox.org/mozilla-central/search?q=else%5B+%5D%2B(do%7Cfor%7Cswitch%7Cwhile)%5B+%5D&case=true®exp=true&path=*.cpp
So I'll add a clarification in the coding style page, that `else` should onl
IMO: Never else-for. (or else-while)
Else-if is a reasonable continuation of concept: "Well it wasn't that,
what if it's this instead?"
Else-for is just shorthand for "well it wasn't that, so let's loop
over something".
Else-if is generally used for chaining, often effectively as an
advanced swit
Let's keep the flames alive!
Should we always put braces after an `else`, with the only exception being
another `if`?
Or should we also have exceptions for the other control structures (while, do,
for, switch)?
A.
if (...) {
...
} else {
for (...) {
...
}
}
B.
if (...) {
...
} else
5 matches
Mail list logo