r3d_f0x
  • Glossary
  • Info
r3d_f0x
  • Glossary
  • Info
  • Home
  • Technology
  • Programming
  • Use multiple if statements without else if even else

Use multiple if statements without else if even else

January 7, 2018 Leave a Comment Written by r3d_f0x

It’s possible to use multiple if statements in a row without chaining them with else if statements or a concluding else statement as the default condition.  When you have multiple if conditions without any other control flow, multiple code blocks can be triggered by different conditions.  In a normal if, else if, and else control flow, only one action will be triggered by the first condition that is satisfied.  This is the most common control flow for simple programs and programming is taught this way because a chain of if blocks can result in multiple condition triggers.  Sometimes multiple condition triggers are desirable and this is when you can use multiple if conditions.  Since you aren’t limited to keeping the control flow unbroken with only if statements, you can add additional code between the statements, but for readability you should only do this if you need to.

Programming, Technology
An opinion on Yankee Marshal’s meltdown on Iraq Veteran
SJWs hate white people so much I wouldn’t be surprised if they’ve been infiltrated by false flag racists

Leave a Reply Cancel reply

You must be logged in to post a comment.

Links

  • Wiki
  • Forum
  • Gitlab
  • Chat - discord.me/r3df0x
  • Recent Posts

    • Are you a Slav?
    • This is why conservatives keep ending up with the alt-right
    • Digital Ocean now has separation for different projects
    • Anti SJWs are NPCs
    • I can’t stand Tim Pool anymore

    Recent Comments

      Archives

      • March 2019
      • January 2019
      • November 2018
      • October 2018
      • September 2018
      • August 2018
      • June 2018
      • April 2018
      • March 2018
      • January 2018
      • December 2017
      • July 2017
      • May 2017

      Categories

      • Alternative Liberals
      • Centerism
      • Conservatives
      • Culture
      • Discourse
      • Discussion software
      • Fascism
      • Feminism
      • Gaming
      • Gender
      • Guns
      • Internet Culture
      • Neckbeards
      • Online comments
      • Politics
      • Programming
      • Psychology
      • Racism
      • Religion
      • Russia
      • Satire
      • Security
      • Slavs
      • Social Justice Warriors
      • Technology
      • Vulnerabilities
      • Web encryption
      • Youtube Gun Community

      Meta

      • Log in
      • Entries RSS
      • Comments RSS
      • WordPress.org

      evolve theme by Theme4Press  •  Powered by WordPress