Re:The Evolution of C Programming Practices: A Study of Unix...
by zzzcpan on Friday May 11, 2018 @08:45AM
(#17046885)
Unstructured and unrestricted equivalent of goto then is a method call in OOP. Where method is basically a label and object is a shared state it randomly messes with.
[ Parent
| on HN ]
Re:The Evolution of C Programming Practices: A Study of Unix...
by coldtea on Friday May 11, 2018 @10:48AM
(#17047658)
That's not unrestricted though -- control returns to the caller after the end of the function.
With goto that's not guaranteed to be the case -- that was the spaghetti part.
Re:The Evolution of C Programming Practices: A Study of Unix...
by zzzcpan on Friday May 11, 2018 @06:22PM
(#17051148)
No, that's not a restriction, but just a behavior. It doesn't keep you from jumping all over the place and modifying shared state by calling methods within methods. You can only use conventions to have some restrictions and structure here. Just like with goto.
Re:The Evolution of C Programming Practices: A Study of Unix...
by goalieca on Friday May 11, 2018 @08:59AM
(#17046949)
if (False)
goto error;
vs.
if (False) throw ExceptionE;
Re:The Evolution of C Programming Practices: A Study of Unix...
by Gibbon1 on Friday May 11, 2018 @12:10PM
(#17048483)
Ehem
if(False) longjump(error, 1);
vs
if (False) throw ExceptionE;
Re:The Evolution of C Programming Practices: A Study of Unix...
by hindsightRegret on Friday May 11, 2018 @05:52PM
(#17051027)
Good job, compiler :)