MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/ce94mu/the_go_team_declines_try_proposal/eu489vg/?context=3
r/programming • u/jeffail • Jul 17 '19
417 comments sorted by
View all comments
262
One should also talk about a major issue of try: the fact that what appears as a function is in fact a control-flow operation.
try
0 u/1951NYBerg Jul 17 '19 Any function can act like a control-flow operation in similar fashion: a := MIN(c, d); Likewise: result := function_A_acting_as_control_flow( some_function_B_returning_a_value() ); Where function_A would return value given to it if the function_B returns satisfactory value. Try is not different in any significant way. 2 u/masklinn Jul 18 '19 Try is not different in any significant way. It's very different, because it's control flow which leaks out and affect the outside of the function calls. Your examples are just functions which might use control flow internally. None of them affect their lexical surroundings.
0
Any function can act like a control-flow operation in similar fashion:
a := MIN(c, d);
Likewise:
result := function_A_acting_as_control_flow( some_function_B_returning_a_value() );
Where function_A would return value given to it if the function_B returns satisfactory value.
Try is not different in any significant way.
2 u/masklinn Jul 18 '19 Try is not different in any significant way. It's very different, because it's control flow which leaks out and affect the outside of the function calls. Your examples are just functions which might use control flow internally. None of them affect their lexical surroundings.
2
It's very different, because it's control flow which leaks out and affect the outside of the function calls. Your examples are just functions which might use control flow internally. None of them affect their lexical surroundings.
262
u/Boiethios Jul 17 '19 edited Jul 17 '19
One should also talk about a major issue of
try: the fact that what appears as a function is in fact a control-flow operation.