Departments
 Info
   Home Page
   Articles
   Software Goodies

 Explanations
   How do they do that?
   The Web in Focus

 Resources
   Web Site Stuff
   Tech Books
   E-Books
   Tech Toys
   Web Hosting
   Links

 Women
   Opinion
   Tech Women
   Women's Studies

 Tech News
   Computer Security
   Databases
   Java
   Linux
   MP3
   PC Software
   Robotics
   Site Owner
   Tech Latest
   Web Development
   XML

 Spread the Word
   Newsletter
   Recommend this Page

 Site Info
   Legal Disclaimer
   Privacy
   Contact

 Lighter Side
   Crazy for Life
   crazy for romance
   Crazy for Kitties
   Crazy for Dogs
   Crazy for Cows

Copyright 2000-2001, hertechnology.com

 
The Web in Focus
Your Fourth Program

We're still on the subject of programming for this installment of The Web in Focus. If you're not interested in programming, there are still a few concepts you should understand to help you recognize that, while a program might be cool, it's not magic!

From the previous beginning-programming articles, we discussed some principles of programming that you should be aware of.

  • The computer is a picky beast that only does what you tell it to. If it doesn't understand what you are saying, it either does nothing or gives you an error message (sometimes helpful, sometimes not).
  • You have to be very attuned to details when programming -- the statements must be correct and complete. Otherwise you'll get errors. And the computer won't make assumptions for you and fill in where you forgot something, no matter how obvious.
  • You also need patience. The computer doesn't care if you're getting frustrated and feeling like tossing it out the nearest window.
  • Programs are written using statements which are like sentences (or commands). Statements tell the computer to do something.
  • Normally, the computer executes the statements in the order they occur, but there are other statements that can change the order (also known as "flow of control").
  • In the second and third articles, we saw a conditional statement -- an if. That allows us to see if something is true or not and do different things based upon whether that something was true or false.

Repeating yourself

Sometimes we want to do the something more than one time -- maybe pick 6 lottery numbers, for example. We could write out how to do that like so...

Pick first number.
Pick second number.
Pick third number.
Pick fourth number.
Pick fifth number.
Pick sixth number.

Repeating the pick action six times by writing each one out individually is tiresome and unnecessarily lengthy. We could just say...

Repeat this six times:
    Pick a number

This notion is the essence of a loop in programming.

Page 2

Tech Books

Tech Toys

More News

  Want to bookmark this site? Press Control-D. (Hold down the control key and the letter D at the same time.)