If Else vs Switch Statements #shorts

preview_player
Показать описание
When should you use an if else statement vs a switch statement.
Рекомендации по теме
Комментарии
Автор

the downside is that they can only be used as a replacement for ==, so definitely not for floats or some strings. Also in many cases the compiler is smart enough to take a long enough if-else chain and just turn it into a switch or a boolean op if practical

justalonelypoteto
Автор

Bro you deserve some more support for your brilliant teaching!

lukeeditz
Автор

First time seeing a black person teaching me to code

cuofhem
Автор

I don’t think you need break; in a default: case

rockorso
visit shbcf.ru