Skip to main content
5 events
when toggle format what by license comment
Aug 21, 2017 at 4:34 vote accept Maksim Dmitriev
May 23, 2017 at 12:40 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Jan 7, 2017 at 14:46 comment added Tunaki @MaksimDmitriev Actually, I do. I find returning directly the result when you know you have found it for sure to be clearer than storing it in a variable; that variable could be wrongly updated later in the code for example, introducing bugs. See also this question on Stack Overflow, more importantly, strive for consistency: if you use a result variable in one method but not others, it feels weird.
Jan 7, 2017 at 14:18 comment added Maksim Dmitriev Do you think many returns in a method make it more readable in this case? I'm asking because my fellow developers at work think a result variable and a single return make a method look better
Jan 7, 2017 at 12:32 history answered Tunaki CC BY-SA 3.0