[Wayland-bugs] [Bug 67620] Code quality issue in weston?

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Aug 5 05:17:26 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=67620

--- Comment #3 from J <axuv49 at hotmail.co.uk> ---
While usage of 'goto' constantly receives a lot of negative press, it's usage
in C code for error handling is generally considered cleaner than alternatives.

In my personal opinion, I find it easier to read as well - rather than multiple
levels of scope/indentation based on every potential error, you get a normal
flow of code, where the (rare) errors cause the flow to break. If they require
the same cleanup code, we sure don't want any duplication either.

It's use should still be limited to specific applicable scenarios, but it's not
a 'use a single goto and you'll cause a nuclear war' level style of issue.
Hell, using a break in a switch statement is essentially a goto itself(!)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-bugs/attachments/20130805/e80133b1/attachment.html>


More information about the Wayland-bugs mailing list