[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4 8/8] ioreq-server: bring the PCI hotplug controller implementation into Xen



On Wed, Apr 9, 2014 at 3:59 PM, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> wrote:
> Jan Beulich writes ("RE: [PATCH v4 8/8] ioreq-server: bring the PCI hotplug 
> controller implementation into Xen"):
>> On 09.04.14 at 15:42, <Paul.Durrant@xxxxxxxxxx> wrote:
>> > Personally I find using forward jumps to fail labels the most
>> > readable form of error exit - I wish they were used more widely.
>>
>> Interesting - almost everyone/-thing involved in educating me in
>> programming skills recommended to try to get away without goto
>> altogether, unless programming Fortran, Basic or some such.
>
> I think the hatred of goto is a "lie to children".  It is easy to
> misuse goto and make spaghetti.

I read the original "Goto Considered Harmful" paper many years ago,
and the vast majority of the objections are handled in a modern
language like C.

break, contine, and switch statement are all just very specific
versions of "goto".  But it's not possible (nor desirable) for a
language to implement all uses of "goto"; Ian mentions some other uses
below.  In this case, cleaning up partial acquisition of resources
(e.g., a malloc failure after several malloc successes) is a very
common and well understood idiom in OS design.

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.