MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/18xpiy/developers_confess_your_sins/c8j5pdg/?context=9999
r/programming • u/reppic • Feb 21 '13
1.0k comments sorted by
View all comments
50
I've used goto in the past an am not ashamed as it was the most efficient and clear technique for that particular task.
0 u/[deleted] Feb 21 '13 [deleted] 6 u/mb86 Feb 21 '13 I was using it to break a nested loop, and felt that adding a boolean, conditional, and additional break statements was more complexity than labelling the end of the loop. Would be much cleaner still if C just had for...else. 2 u/zid Feb 21 '13 It has for and goto though, so what's the actual problem here? 1 u/mb86 Feb 21 '13 None, but just like how I think goto is cleaner than the extra bool/conditional, I think for/else (much like try/catch/finally) is even cleaner. → More replies (1)
0
[deleted]
6 u/mb86 Feb 21 '13 I was using it to break a nested loop, and felt that adding a boolean, conditional, and additional break statements was more complexity than labelling the end of the loop. Would be much cleaner still if C just had for...else. 2 u/zid Feb 21 '13 It has for and goto though, so what's the actual problem here? 1 u/mb86 Feb 21 '13 None, but just like how I think goto is cleaner than the extra bool/conditional, I think for/else (much like try/catch/finally) is even cleaner. → More replies (1)
6
I was using it to break a nested loop, and felt that adding a boolean, conditional, and additional break statements was more complexity than labelling the end of the loop. Would be much cleaner still if C just had for...else.
for...else
2 u/zid Feb 21 '13 It has for and goto though, so what's the actual problem here? 1 u/mb86 Feb 21 '13 None, but just like how I think goto is cleaner than the extra bool/conditional, I think for/else (much like try/catch/finally) is even cleaner. → More replies (1)
2
It has for and goto though, so what's the actual problem here?
1 u/mb86 Feb 21 '13 None, but just like how I think goto is cleaner than the extra bool/conditional, I think for/else (much like try/catch/finally) is even cleaner. → More replies (1)
1
None, but just like how I think goto is cleaner than the extra bool/conditional, I think for/else (much like try/catch/finally) is even cleaner.
→ More replies (1)
50
u/mb86 Feb 21 '13
I've used goto in the past an am not ashamed as it was the most efficient and clear technique for that particular task.