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.

“Curly Bracket” Languages 63<br />

“Curly Bracket” Languages<br />

If you know BASIC or Pascal, you can rush out and start writing programs<br />

without ever needing to know another <strong>programming</strong> language again <strong>for</strong> the<br />

rest of your life. However, it’s far more common <strong>for</strong> programmers to know two<br />

or more <strong>programming</strong> languages. Typically, the one language that most programmers<br />

know is one that belongs to a family of related languages known as<br />

the “curly bracket” family.<br />

The “curly bracket” language family gets its name because they use curly<br />

brackets to define the start and ending of a block of commands, such as<br />

Book I<br />

Chapter 3<br />

Types of<br />

Programming<br />

Languages<br />

#include <br />

void main()<br />

{<br />

printf(“Notice how the curly brackets\n”);<br />

printf(“identify the beginning and end\n”);<br />

printf(“of your commands?\n”);<br />

}<br />

Rather than use curly brackets, many other <strong>programming</strong> languages use<br />

descriptive words, like Begin or End, to identify the start and end of a block<br />

of code.<br />

The most popular “curly bracket” language is C. The C language is popular<br />

<strong>for</strong> several reasons:<br />

✦ Power<br />

✦ Efficiency<br />

✦ Portability<br />

The power of C<br />

The C language is a curious combination of assembly language and high-level<br />

languages, like BASIC. Like assembly language, C provides commands <strong>for</strong><br />

directly manipulating every part of the computer, including memory, hard<br />

disks, and printers. Like a high-level language, C lets you focus on the logic of<br />

your program without worrying about the technical details of the computer<br />

so you get the best of both assembly language and high-level languages.<br />

Because C programs are nearly (note the emphasis on the word “nearly”) as<br />

easy to write and understand as high-level languages but still give you the<br />

power of accessing the computer’s hardware like assembly language, C is<br />

often used <strong>for</strong> creating large, complicated programs (such as operating systems<br />

and word processors) along with more exotic programs (like antivirus<br />

utilities or disk diagnostic programs).

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

Saved successfully!

Ooh no, something went wrong!