Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
genwin
13y ago
0 comments
Save
Share
I used to follow a bunch of best practices like this, that I now often find to be of too little benefit. If the function is small, multiple return statements won't significantly affect readability and it's simpler to code.
0 comments
4 comments · 1 top-level
top
newest
oldest
igouy
13y ago
· 3 in thread
>> If the function is small <<
And if the function is not small?
mseepgood
13y ago
Then extract functions until it's small, a.k.a. refactoring.
marshray
13y ago
...and if you end up needing to pass 20 variables via reference for state?
1 more reply
genwin
OP
13y ago
Then I might set a variable and return that. The goal is to make the function readily understood.
j
/
k
navigate · click thread line to collapse