News for hackers. Stuff that matters.
Re:Anti-If: The missing patterns (2016) by sago on Wednesday June 27, 2018 @06:08PM (#17412283)
Thank you. For clarity, here would be the GP example:

   Foo foo = acquireFoo()
   defer releaseFoo(foo)

   if !isValid(foo) {
      return FAIL
   }

   moreWork(foo)
   return SUCCESS
That is impressively clear. I don't use go, myself.

I agree, I am quite comfortable using goto in C/C++ in this context. Though it may be better in C++ to use RAII in this specific example.

There are no comments on this comment yet.