Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if를 지양하는 것이 좋은데 그 이유과 극복방법 #162

Open
inuinseoul opened this issue Jun 26, 2022 · 1 comment
Open

if를 지양하는 것이 좋은데 그 이유과 극복방법 #162

inuinseoul opened this issue Jun 26, 2022 · 1 comment
Labels

Comments

@inuinseoul
Copy link
Collaborator

No description provided.

@inuinseoul inuinseoul added the etc label Jun 26, 2022
@sustainable-git
Copy link
Member

  • if문을 사용하면 유지보수 측면에서 불리한 경우가 발생합니다. 새로운 기능이 추가된다면 else if가 발생하게 되고, 선행 조건을 더 많이 고민해야하기 때문입니다. 또한 다중 if문을 사용하게 되면 가독성이 좋지 않게 됩니다.
  • 극복방법
      1. Switch 사용
      1. 삼항연산자 활용
      1. Dictionary를 활용
      1. 다중 filter 사용
      1. 다형성을 활용

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants