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

"else if" to "ef" or other shorthand? #1114

Open
determin1st opened this issue May 30, 2021 · 3 comments
Open

"else if" to "ef" or other shorthand? #1114

determin1st opened this issue May 30, 2021 · 3 comments

Comments

@determin1st
Copy link

determin1st commented May 30, 2021

hey, what if livescript introduce shorthands to those basic statements?
not a real issue, just a question to discuss maybe.

if a > b
  true
else if a < b
  true

may become

if a > b
  true
ef a < b
  true

comparisons are perfectly aligned - is it better for code readability?
i've noticed new versions of php have both else if and elseif valid syntax constructs, also, python has elif statement that is perfectly aligned with else..

@sourcevault
Copy link

comparisons are perfectly aligned - is it better for code readability?

better to use switch instead ?

@determin1st
Copy link
Author

you mean empty switch, hmm.. ooke

@punund
Copy link

punund commented Jun 5, 2022

switch
| a > b => true
| b < a => false

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

No branches or pull requests

3 participants