On Thursday, 24 March 2016 08:41:55 UTC+1, Linus Drumbler wrote:
I dislike how "break" is treated inside switches in Go.
  The reason I think it is a worthwhile addition is that it reduces
"indentation" level. In your "if-else" you quickly run into cases where
you have 5 nested ifs, if you have no way of getting out of the "case".
With "break", you can do what you want and "return" early. That way you
don't stack up your ifs, making the code easier to read, similar to how Go
promotes "return early on errors".

You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 4 | next ›
Discussion Overview
groupgolang-nuts @
postedMar 24, '16 at 7:41a
activeMar 24, '16 at 12:05p



site design / logo © 2023 Grokbase