15.04.2018 Views

programming-for-dummies

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

54<br />

Teaching Languages<br />

Now look at the command you need to use to print Hello, world! in<br />

BASIC:<br />

PRINT “Hello, world!”<br />

That’s it — a single line. To print Hello, world! on-screen, you can either<br />

write a 17-line assembly language program (and risk making a mistake on all<br />

17 different lines), or you can write a one-line BASIC program that’s immediately<br />

obvious and intuitive.<br />

Versatility<br />

Both professors Kemeny and Kurtz didn’t just want to create a <strong>programming</strong><br />

language that was easy to understand, but they also wanted to create a <strong>programming</strong><br />

language that could be put to practical use as well. That way, novices<br />

could understand BASIC and then use BASIC to write actual programs. After all,<br />

there’s no point in using BASIC to teach <strong>programming</strong> only to <strong>for</strong>ce programmers<br />

to later use a completely different language if they wanted to write a useful<br />

program.<br />

So BASIC not only provides descriptive commands like PRINT, but it also<br />

provides enough commands so you can write practically any type of program.<br />

The only type of program you can’t create easily in BASIC are programs<br />

that require you to understand and access the actual hardware of the computer<br />

or operating systems.<br />

One reason C programmers look down on BASIC as a toy language is because<br />

BASIC doesn’t let you access the hardware or operating system like C does.<br />

But one reason why C programs fail is precisely because programmers incorrectly<br />

manipulate the computer hardware or operating system. By shielding<br />

you from the details of the computer or operating system, BASIC reduces the<br />

chance that your program accidentally crashes the computer.<br />

Shielding you from having to know the technical details of the computer<br />

hardware or operating system is actually another goal of BASIC. By using<br />

BASIC, you can focus on solving a problem and not get distracted by the<br />

technical details of the computer.<br />

Another goal of BASIC is to provide the programmer with instant feedback.<br />

Most <strong>programming</strong> languages <strong>for</strong>ce you to write an entire program be<strong>for</strong>e<br />

you can run it. BASIC, on the other hand, was originally designed to let you<br />

type in a single BASIC command at a time, and the computer tells you right<br />

away whether the command works.<br />

Such instant feedback made BASIC <strong>programming</strong> much easier and faster<br />

than traditional <strong>programming</strong> languages. In addition, such rapid feedback<br />

helped novices quickly figure out what they were doing wrong so they could<br />

correct their mistakes right away.

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

Saved successfully!

Ooh no, something went wrong!