Why is switch but is not if-else?