forked from basho/erlang_guidelines
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnesting.erl
More file actions
39 lines (35 loc) · 655 Bytes
/
Copy pathnesting.erl
File metadata and controls
39 lines (35 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-module(nesting).
-export([bad/0, good/0]).
bad() ->
case this:function() of
has ->
try too:much() of
nested ->
receive
structures ->
it:should_be(refactored);
into ->
several:other(functions)
end
catch
_:_ ->
dont:you("think?")
end;
_ ->
i:do()
end.
good() ->
case this:function() of
calls ->
other:functions();
that ->
internal_work()
end.
internal_work() ->
try do:the(internal, parts) of
what ->
was:done(in)
catch
_:the ->
previous:example()
end