1. Home
  2. Computing & Technology
  3. Ruby
photo of Amanda & Michael Morin
Amanda and Michael's Ruby Blog

By Amanda & Michael Morin, About.com Guides to Ruby

Obama and McCain Aren't the Only Ones Making Conditional Statements

Monday September 29, 2008

Last week, both McCain and Obama decided to place conditions on the emergency economic bailout plan. As you know conditions are simply a set of expressed criterion that need to be met before something can (or cannot) occur. Much like the candidates, in order for a computer program to have any meaningful effect, it has to be able to react differently to changing conditions.

Obama and McCain react to changing economic conditions by making statements about what has to happen in order for them to support the government bailing out the financial giants going under. A computer program also makes statements about what will happen depending on the value of a variable or statement. In both cases, these statements are called conditional statements.

The most simple form of a conditional statement is the "if" statement. Simply put, an if statement will do one thing if a condition is true and another thing (or nothing) if the condition is false. Well, at least that's true with computers. I've yet to see if it works as smoothly with presidential candidates.

It's unfortunate that the presidential candidates conditions can't work like conditional statements in programming. At least with a well-written program, you always know what's going to happen!

Comments

No comments yet. Leave a Comment

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Discuss
Community Forum
Explore Ruby
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Ruby

©2009 About.com, a part of The New York Times Company.

All rights reserved.