Hi, aman,<br><br>First, IMO, on Erlang, every function is real function, and every function returns something, that it depends on you to check what returned. Though a language with return statement guide programmers to check things returned but ignore those functions without a return statement. The later one is so-called 函式 in Chinese, a “function-like procedure.” It’s a weird concept of some function without a return statement, that in definition it does not return thing, but in memory of real computer system it return such as 0 but actually it does not return 0 because the 0 is a symbol to represent ‘nothing'.<br><br>For the second question, how to avoid cascade case statement, there are at least two way to do. The first way, case statement is similar to function statement, and if some thing goes through many states in cascade case statement, it seams to be some thing going through some functions and then becoming some state. The second way, if items existing in cascade case statement do not just occur in condition within case statement, layers of case statement may be reduced by putting items together: for example,<br><br>case A of<br>    ok -> case B of … end;<br>    {error, _} -> …<br>end<br><br>may be arranged as<br><br>case {A, B} of<br>    {ok, ok} -> …;<br>    {{error, _}, _} -> …;<br>    {_, {error, _}} -> …<br>end<br><br>/Y-H<br><br>On Tuesday, December 16, 2014, aman mangal <<a href="mailto:mangalaman93@gmail.com">mangalaman93@gmail.com</a>> wrote:<br>> Hi everyone,<br>> I have seen similar questions before on the forum but I could never understand the reason behind it. Is it due to theoretical reasons such as return statement makes it hard to reason about the program or practical reasons that it is hard to implement it (this doesn't seem right but I cannot think of anything else)?<br>> Moreover, is there a good alternate to avoid nested case statements? Making more functions just seems tedious. Using catch statement seems another good alternate but my intuition is that it is not good practice, is it?<br>> Thank you<br>> Aman Mangal<br>> <a href="http://www.prism.gatech.edu/~amangal7">www.prism.gatech.edu/~amangal7</a><br><br>-- <br><div><br></div>Best Regards.<div><br></div><div>--- Y-H. H.</div><div><br></div><br>