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.

128<br />

Using Keywords as Building Blocks<br />

Every program consists of step-by-step instructions. Just as you can write<br />

the same instructions <strong>for</strong> a person in English, French, Spanish, Arabic, or<br />

Japanese, so can you write the same program <strong>for</strong> a computer in different<br />

<strong>programming</strong> languages.<br />

You can literally write a program with thousands of possible <strong>programming</strong><br />

languages. Every <strong>programming</strong> language is designed to solve one problem<br />

exceptionally well, but may solve other types of problems poorly.<br />

For example, the BASIC <strong>programming</strong> language is meant to teach <strong>programming</strong>,<br />

but it’s not very good <strong>for</strong> controlling the hardware of a computer, such<br />

as <strong>for</strong> writing an operating system or antivirus program. On the other hand,<br />

the C <strong>programming</strong> language is meant to give you absolute control over<br />

every part of the computer so that’s why most operating systems and<br />

antivirus programs are written in C. However, the C language can be much<br />

more frustrating and confusing <strong>for</strong> novices to understand compared to<br />

BASIC.<br />

Ideally, you want to pick the <strong>programming</strong> language best suited <strong>for</strong> solving<br />

your particular problem. Realistically, you probably know only a handful of<br />

<strong>programming</strong> languages, so out of all the languages you know, you have to<br />

pick the one language that’s best suited <strong>for</strong> solving your problem.<br />

You can write any program in any <strong>programming</strong> language. The only difference<br />

is that some <strong>programming</strong> languages can make writing certain programs<br />

easier than others. The “best” <strong>programming</strong> language to use is always<br />

the language that makes writing a program easy <strong>for</strong> you.<br />

Using Keywords as Building Blocks<br />

Every program consists of one or more commands (instructions), and each<br />

command is a line of code or a statement. The more lines of code, the more<br />

complicated the program.<br />

The goal of <strong>programming</strong> is to write the fewest lines of code that do the maximum<br />

amount of work.<br />

Each command tells the computer to do one thing. Put enough commands<br />

together and you can create a simple program, as shown in Figure 1-1.

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

Saved successfully!

Ooh no, something went wrong!