Skip to content
DevMeme
5333 of 7590
Languages Post #5850 · source on Telegram

The Sophistication Ladder of Conditional Statements

Description

This is a four-panel, vertical meme format, similar to the 'Expanding Brain' or 'Tuxedo Winnie the Pooh' memes, which ranks different ways of writing an 'else if' conditional statement. The first two panels feature a crudely drawn, tense-looking Winnie the Pooh, representing lower sophistication. Next to these are the words 'Elsif' and 'elif' respectively. The third panel shows a standard, calm-looking Winnie the Pooh next to the more common 'else if'. The final panel breaks the pattern entirely, displaying a simple, light-blue cartoon character with a mustache clenching its fist in front of a Union Jack flag. Next to this is the word 'otherwise'. The humor is derived from the escalation of programming language syntax from common variants ('elif' in Python, 'elsif' in Ruby) to the standard C-family 'else if', and finally to the absurdly formal and British-themed 'otherwise', which is not a standard keyword in most languages but perfectly captures a sense of over-the-top, quirky formality

Comments

35
Anonymous ★ Top Pick Some developers use 'elif' for conciseness. Others prefer 'else if' for clarity. I, however, use 'otherwise', and my IDE is configured to only compile after it has queued up a formal complaint to the compiler's manager
  1. Anonymous ★ Top Pick

    Some developers use 'elif' for conciseness. Others prefer 'else if' for clarity. I, however, use 'otherwise', and my IDE is configured to only compile after it has queued up a formal complaint to the compiler's manager

  2. Anonymous

    The real portability layer isn’t POSIX - it’s a regex that translates every codebase’s preferred spelling of ‘else-if’ before the diff reviewer has an aneurysm

  3. Anonymous

    After 20 years of writing conditionals, you realize the real branching nightmare isn't elsif vs elif - it's explaining to the junior why your 'elegant' pattern matching solution with guards and monadic transformations takes 3x longer to debug than a simple switch statement

  4. Anonymous

    After 20 years in the industry, you realize the real sophistication isn't in choosing 'otherwise' over 'elsif' - it's in avoiding nested conditionals altogether by refactoring into a strategy pattern, only to have a junior dev rewrite it back to if-else chains because 'it's more readable.'

  5. Anonymous

    If the team is debating elif vs else if, the senior fix is a dispatch table or pattern matching - otherwise you’ve just built a 200‑line ladder

  6. Anonymous

    Polyglot repos prove the hardest cross-platform issue isn’t containers - it’s remembering whether the branch keyword is elif (Python), elseif (PHP), elsif (Ruby/Perl), else if (C/JS), or, if you’re in Spark, the aristocratic ‘otherwise’

  7. Anonymous

    15+ YoE truth: They all desugar to jumps, but 'otherwise' pairs best with a spot of tea during the perf regression

  8. @Sp1cyP3pp3r 2y

    if !

  9. @sersocks 2y

    haskell moment

  10. @EricKotato 2y

    unless

  11. @denis_klyuev 2y

    is there a new lang called pringles?

  12. @misesOnWheels 2y

    elif is stupid. but ending an if block with fi is beyond moronic

    1. @callofvoid0 2y

      bash :

    2. @CcxCZ 2y

      Well, Bourne really liked Algol. But in Algol that stuff actually kinda works and is consistent.

  13. @sylfn 2y

    please use English in this chat

  14. @callofvoid0 2y

    ifn't

    1. @purplesyringa 2y

      more like unless

      1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

        Duded you just reversed the whole lookup

      2. @callofvoid0 2y

        if(){} or(){}

    2. @callofvoid0 2y

      this thing got more attention than I expected let's inplement it somewhere

  15. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

    💀💀😂😂😂

  16. @byrustya 2y

    nested when 🤬

  17. @rangerhood 2y

    Elseways 🤴

  18. @callofvoid0 2y

    nextguess

  19. @callofvoid0 2y

    oddchance

  20. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

    Apparently

  21. @viktorrozenko 2y

    Perchance 🇬🇧

  22. @Ra_zor 2y

    But otherwise=else🤔

    1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

      Doesn’t need to be

      1. @Ra_zor 2y

        Semantically it is tho. And in no way otherwise=else if. if a==1 ... otherwise a==2 ... just doesn't work.

  23. @dovbenn 2y

    elfish

  24. @azizhakberdiev 2y

    we also need block in any case

  25. @man13hma 2y

    But still

  26. @callofvoid0 2y

    in another case

  27. @prirai 2y

    ow

Use J and K for navigation