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.

Figuring Out Programming 19<br />

✦ Linux is a free operating system <strong>for</strong> almost every computer (including PCs).<br />

Linux is becoming more popular with big companies (as opposed to individual<br />

users), so there’s a growing market <strong>for</strong> talented Linux programmers.<br />

If you want to prepare yourself <strong>for</strong> the future, it’s probably best to begin <strong>programming</strong><br />

on any computer that runs Windows, Linux, or Mac OS X.<br />

With the right software (www.parallels.com), it’s possible to run both<br />

Windows and Linux on a Macintosh computer that’s also running Mac OS X.<br />

That way you can practice writing programs <strong>for</strong> three different operating<br />

systems on a single Macintosh computer.<br />

Book I<br />

Chapter 1<br />

Getting Started<br />

Programming a<br />

Computer<br />

Writing programs with an editor<br />

After you have a computer that runs Windows, Linux, or Mac OS X, the next<br />

step is to get an editor. An editor acts like a simple word processor that lets<br />

you type, change, and save program commands in a file.<br />

In the world of computer <strong>programming</strong>, a single program command is a line<br />

of code. Most programs consist of thousands of lines of code, although a large<br />

program (like Microsoft Windows) consists of millions of lines of code. When<br />

you write a program, you don’t tell people, “I’m writing a program.” You say,<br />

“I’m writing code.” It sounds cooler — at least to other programmers.<br />

Almost every operating system comes with a free editor:<br />

✦ In Windows, the free editor is Notepad.<br />

✦ In Linux, hundreds of free editors — like Vi and Emacs — are available.<br />

✦ Mac OS X comes with a free word processor called TextEdit, which can<br />

work as a text editor.<br />

If you’re using Mac OS X, you may find it easier to use a dedicated text editor<br />

such as TextWrangler (www.barebones.com) or jEdit (www.jedit.org).<br />

Both TextWrangler and jEdit are free.<br />

Unlike a word processor, which offers commands <strong>for</strong> <strong>for</strong>matting text to make<br />

it look pretty or appear in different colors, a text editor is just designed <strong>for</strong><br />

typing commands in a particular <strong>programming</strong> language, such as assembly<br />

language or C:<br />

✦ The simplest editor just lets you type commands in a file.<br />

✦ More sophisticated editors can help you write a program by<br />

• Color-coding program commands (to help you identify them easily)<br />

• Indenting your code automatically (to make it easier to read)<br />

• Typing in commonly used commands <strong>for</strong> you

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

Saved successfully!

Ooh no, something went wrong!