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.

248<br />

Object-Oriented Languages<br />

Arabic-speaker to write a letter completely in English, so at least it’s easier<br />

<strong>for</strong> English speakers to understand.<br />

So which type of language should you learn and use? If you need to update<br />

programs written in older <strong>programming</strong> languages, like C, BASIC, or Pascal,<br />

you have no choice but to update those programs by using a hybrid<br />

language.<br />

Ultimately, it’s probably best to <strong>for</strong>ce yourself to know at least one pure<br />

object-oriented language so you fully understand the benefits of OOP and<br />

put those benefits into practical use. After you completely understand how<br />

to design and use object-oriented techniques, you’re more likely to use OOP<br />

features in a hybrid language.<br />

The <strong>programming</strong> language you use is less important than designing a program<br />

correctly from the start. Languages are tools to help you achieve a<br />

goal, so don’t get caught up in the “religious” wars arguing whether one<br />

<strong>programming</strong> language is “better” than another. The “best” <strong>programming</strong><br />

language is the one that makes you most efficient.<br />

Disadvantages of object-oriented <strong>programming</strong><br />

Despite its clear-cut advantages, object-oriented <strong>programming</strong> isn’t perfect<br />

and suffers its share of drawbacks:<br />

✦ OOP is best suited <strong>for</strong> organizing large programs. If you need to write a<br />

small program to make a printer work with an operating system, organizing<br />

your program into objects doesn’t likely give you any benefits and<br />

may take more time to write.<br />

✦ OOP requires more memory to run than non-OOP programs. So if<br />

you’re writing a small program that needs to be fast and use as little<br />

memory as possible, OOP actually makes your program harder to write<br />

and slower to run.<br />

Like all <strong>programming</strong> techniques, such as structured <strong>programming</strong>, objectoriented<br />

<strong>programming</strong> isn’t a magical solution <strong>for</strong> writing large programs<br />

flawlessly. Instead, object-oriented <strong>programming</strong> is more of a guideline <strong>for</strong><br />

steering you into using proven techniques <strong>for</strong> organizing programs and<br />

making them easier to modify and update.<br />

The ultimate goal of any programmer is to write software that works, is easy<br />

to fix and modify, and gets completed on time. If you can achieve these three<br />

goals on a consistent basis, you’ll always have plenty of people willing to<br />

hire you at whatever salary you want.

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

Saved successfully!

Ooh no, something went wrong!