27
T99-
7y

Ok I'm finally learning Ruby and...

why the hell is an else-if 'elsif'

that's just disgusting

Comments
  • 7
    Read python that's even shorter as elif....
  • 1
    to avoid the nested if problem.
    Altough you should avoid that.
  • 4
    Yep. Depends on the language. Sometimes it's "else if", in another language it's "elseif", and then there's "elsif" and "elif".
    Still waiting for "eif" though.
  • 1
    might as well cut straight to ef
  • 1
    @mr-crazyhacker for some reason I'm more ok with that than elsif
  • 1
    I was doing some work in the North Pole, it's just elf up there!
  • 2
    Wrote a bash script the other day. Bash uses 'elif' as well, but the best bit was closing the if with 'fi'
  • 0
    lol i remember thinking the same thing!
    Wait till you get to the switch case statement 😉

    Overall i still prefer ruby to its alternatives..
  • 1
    @T99- @Schnouki You could always use:

    predicate1 ? function1() :
    ( predicate2 && function2() )

    🤢
Add Comment