DEV Community


Hierarchy of else if compression

Ryan Westlund
I'm a programmer, writer, and philosopher. My Github account is yujiri8; all my content besides code is at
・1 min read

C, Rust, Go, Javascript: else if

Julia: elseif

Ruby: elsif

Python: elif

Discussion (1)

patarapolw profile image
Pacharapol Withayasakpunt • Edited

Personally, I love Kotlin's style of when (x) control flow. Don't have to worry about noFallthroughCasesInSwitch as well.

Not sure about the optimization and how does it compare to pattern matching, though.