[Gluster-devel] An interesting take on GoTo statement by Dijkstra -

Jeff Darcy jdarcy at redhat.com
Thu Jan 15 18:50:51 UTC 2015


> Since the goto idiom that Gluster uses generates the same code — which
> is what matters — I gave up my short-lived battle for not using it.

One handy rule of thumb is based on whether a "goto" is forward or back,
in (to a loop or other control contruct) or out.  Forward and out are
generally OK - no worse than extra state flags and better than code
duplication - so they generally don't bother me.  A handful of times in
my entire career, I've seen a backward goto that was (weakly) justified.
I've never seen an inward goto that was anything but pure evil, and I
don't expect to.  Fortunately, many people don't even know they're
possible, so they're rare.


More information about the Gluster-devel mailing list