Skip to main content

All Questions

1 vote
1 answer
58 views

Best way to refactor If-statement

I have the following code: if (adSetting.Core_standard_application_role) { rc = new IntegrationRoleCompany(); ...
mrjasmin's user avatar
  • 1,270
2 votes
2 answers
4k views

Java best style for return statement - inside or outside if condition? [closed]

Is there a better way to write the code below? I'm checking if an object is null, returning false if it is, otherwise I check another variable and choose what to do based on that. private boolean ...
user3553107's user avatar
7 votes
5 answers
11k views

Use of return in long if-elseif-else statements (Python)

I am using Python for my example, but my question is referring to programmming languages in general. def some_function(eggs): if eggs == 1: do_something_1() elif eggs == 2: ...
D K's user avatar
  • 5,760