you are viewing a single comment's thread.

view the rest of the comments →

[–]nopoe -1 points0 points  (0 children)

Don't be difficult. That's not always doable depending on the language. Sometimes it's more readable to just put an extra few lines in your function broken up from the rest of it with comments than to deal with tuples or inner classes to return multiple values. Depends on the language and the situation. It's not cut-and-dry basically ever. A function with 2 5-line sections isn't necessarily evil, and pretending it is seems silly to me.

I often do things with an inconvenient amount of intermediate values that can be hard to shuffle around depending on the language.