gkz / LiveScript

LiveScript is a language which compiles to JavaScript. It has a straightforward mapping to JavaScript and allows you to write expressive code devoid of repetitive boilerplate. While LiveScript adds many features to assist in functional style programming, it also has many improvements for object oriented and imperative programming.
http://livescript.net
MIT License
2.31k stars 156 forks source link

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

Open determin1st opened 3 years ago

determin1st commented 3 years ago

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 commented 2 years ago

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

better to use switch instead ?

determin1st commented 2 years ago

you mean empty switch, hmm.. ooke

punund commented 2 years ago
switch
| a > b => true
| b < a => false