All Questions
3 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();
...
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 ...
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:
...