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

Nagaprasad Sathyanarayana nsathyan at redhat.com
Thu Jan 15 13:02:57 UTC 2015


Thanks Vijay for sharing these. Very informative. 

Thanks
Naga


> On 15-Jan-2015, at 5:38 pm, Vijay Bellur <vbellur at redhat.com> wrote:
> 
>> On 01/15/2015 12:13 PM, Nagaprasad Sathyanarayana wrote:
>> In a quest to find why good programmers are wary of the "Go To"
>> statement, came across this interesting article by /Edsger W. Dijkstra/ .
>> 
>> http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html.
> 
> goto statements that cause one to go back & forth across the code are annoying to me. However, if goto statements are used to return control from a common point within a function, they enhance readability and also help in ensuring that we perform necessary cleanup/terminal actions for a function in a single place.
> 
> It is to be noted that Dijkstra's article appeared before C was invented. If you are interested in understanding more about goto, Knuth's paper titled Structured Programming with go to statements [1] and a lkml thread on the same [2] can be helpful.
> 
> Cheers,
> Vijay
> 
> [1] http://dl.acm.org/citation.cfm?id=356640&dl=ACM&coll=DL&CFID=472165232&CFTOKEN=27447667 (needs access to ACM)
> 
> [2] http://koblents.com/Ches/Links/Month-Mar-2013/20-Using-Goto-in-Linux-Kernel-Code/
> 
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at gluster.org
> http://www.gluster.org/mailman/listinfo/gluster-devel
> 
> 


More information about the Gluster-devel mailing list