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.

96<br />

Writing a Program with an Editor<br />

Common editor features<br />

Whether you prefer a standalone editor or an<br />

integrated development environment (IDE),<br />

most editors offer the following features:<br />

Multiple undo/redo commands let you<br />

experiment with making changes to your<br />

source code. If they don’t work out, you can<br />

“undo” your changes.<br />

Typically, editors let you undo a large<br />

number of changes you made, such as the<br />

last 100 changes.<br />

Multiple file editing comes in handy so you<br />

can view different files in separate windows<br />

and copy code from one window to<br />

another, or just study how one part of your<br />

program will interact with another part of<br />

that same program.<br />

Syntax completion and highlighting is<br />

when the editor recognizes certain <strong>programming</strong><br />

languages, such as C++ and Java. The<br />

moment you type a valid language command,<br />

the editor can finish typing that command <strong>for</strong><br />

you at the touch of a button, thereby, saving<br />

you time. So if you type a typical IF-THEN<br />

statement, the editor automatically types in a<br />

generic IF-THEN statement (complete with<br />

necessary parentheses), so you just type in<br />

the actual data to use.<br />

Syntax highlighting occurs after you write<br />

a program; the editor highlights valid language<br />

commands to help you separate language<br />

commands from any data and<br />

commands you create. Without syntax<br />

highlighting, source code can look like a<br />

mass of text. With syntax highlighting,<br />

source code can be easier to read and<br />

understand.<br />

Macros let you customize the editor and<br />

essentially program the editor to repeat<br />

commonly needed tasks, such as always<br />

displaying program commands in uppercase<br />

letters.<br />

If the editor doesn’t offer a feature you<br />

want or need, its macro language lets you<br />

add that feature in. Without a macro language,<br />

an editor won’t give you the flexibility<br />

to work the way you want.<br />

Project management helps you keep your<br />

source code files organized. Most programs<br />

no longer consist of a single file, but<br />

of multiple files. Trying to keep track of<br />

which files belong to which project can be<br />

confusing, so an editor can help you store<br />

and organize your files so you won’t lose<br />

track of them.<br />

Features<br />

In addition to a compiler and all the usual features of standalone editors<br />

(as listed in the sidebar, “Common editor features”), many IDEs include<br />

other features in a convenient user interface:<br />

✦ Debugger helps identify problems in your program.<br />

✦ File management helps organize the source code <strong>for</strong> your various projects.<br />

✦ Profiler helps identify which parts of your program may be slowing<br />

down the per<strong>for</strong>mance of your entire program.<br />

✦ GUI designer helps you design the appearance of your program’s<br />

windows, pull-down menus, and buttons.

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

Saved successfully!

Ooh no, something went wrong!