15.04.2018 Views

programming-for-dummies

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

60<br />

Teaching Languages<br />

If the idea of using a “kid’s” <strong>programming</strong> language to figure out <strong>programming</strong><br />

bothers you, grab a copy of KPL’s more sophisticated version, Phrogram<br />

(www.phrogram.com). Like KPL, Phrogram is free. (If you want to compile<br />

your video games into programs that you can give or sell to others, buy the<br />

commercial version of Phrogram.)<br />

Both KPL and Phrogram use a proprietary language that combines the readability<br />

of Pascal with the object-oriented features of more advanced languages,<br />

as shown in the following example:<br />

Program HelloWorld<br />

Method Main()<br />

PrintLine (“Hello, World!”)<br />

End Method<br />

End Program<br />

The goal of KPL and Phrogram is to make <strong>programming</strong> simple, easy, and fun<br />

by focusing on graphics, sound, and animation so you can create video<br />

games. After you know how to program with KPL or Phrogram, you can<br />

migrate to more popular languages later.<br />

Alice<br />

The latest <strong>programming</strong> technique <strong>for</strong> creating, organizing, and maintaining<br />

large programs is object-oriented <strong>programming</strong>. Un<strong>for</strong>tunately, figuring out<br />

object-oriented <strong>programming</strong> can be difficult, especially <strong>for</strong> beginners who<br />

already have enough trouble just figuring out how to program a computer.<br />

So to help beginners understand object-oriented <strong>programming</strong>, Carnegie<br />

Mellon University has created a free <strong>programming</strong> language dubbed Alice<br />

(www.alice.org). To make <strong>programming</strong> fun and teach object-oriented<br />

principles at the same time, Alice lets beginners write simple programs to<br />

animate characters on the screen, as shown in Figure 3-3.<br />

When you write an Alice program, your commands create an animated character<br />

on-screen. Then you need to write additional commands to tell that<br />

animated character how to move to create a simple story. In the process of<br />

telling the animated character how to move, you wind up discovering both<br />

how to program and how to use object-oriented principles while having fun<br />

in the process.<br />

Like most teaching <strong>programming</strong> languages, Alice <strong>programming</strong> uses plain<br />

English commands, like move <strong>for</strong>ward or play sound. By using simple<br />

commands, Alice lets you focus on understanding the principles of objectoriented<br />

<strong>programming</strong> without getting bogged down in understanding the<br />

peculiar syntax of a specific <strong>programming</strong> language.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!