Skip to content

Conversation

@creocoder
Copy link
Contributor

Fixed nesting

@qiangxue
Copy link
Member

qiangxue commented May 7, 2013

I think the original code is fine. I also think we should not spend time in refactoring code in favor of preemptive return. It has both pros and cons. Refactoring may be needed only if there are too many returns in the code.

@qiangxue qiangxue closed this May 7, 2013
@creocoder
Copy link
Contributor Author

@qiangxue We remove 1 level nesting here. Its important.

@qiangxue
Copy link
Member

qiangxue commented May 7, 2013

It's only important if the nested code is very long (and the rule is very vague here). I'm not saying your refactoring is worse, but it's not better either.

@creocoder creocoder deleted the active-record-refactoring-2 branch May 8, 2013 04:09
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 64962c6 on creocoder:active-record-refactoring-2 into * on yiisoft:master*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants