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.

660<br />

Cross-Plat<strong>for</strong>m Programming<br />

The growing trend these days is to support multiple operating systems, which<br />

requires a language that not only makes it easy to write more complicated<br />

programs, but also makes it easy to write and develop programs <strong>for</strong> multiple<br />

operating systems. To thrive, the language of the future needs to make writing<br />

complicated programs easier than C++, be as efficient as possible, and run on<br />

multiple operating systems at the same time.<br />

Cross-Plat<strong>for</strong>m Programming<br />

In the old days, writing programs to run on multiple operating systems was a<br />

waste of time because most people only used the same operating system.<br />

WordPerfect, a once popular word processor, wasted millions of dollars and<br />

several years devoting itsresources to creating a version of WordPerfect that<br />

ran on MS-DOS, Macintosh, Commodore Amiga, and Atari ST computers.<br />

Although WordPerfect focused on making its word processor run on multiple<br />

operating systems (known as cross-plat<strong>for</strong>m capabilities), Microsoft focused<br />

on making its Microsoft Word program run efficiently on a single operating<br />

system (Windows) and nearly wiped WordPerfect off the face of the Earth.<br />

The problem wasn’t that WordPerfect spent time writing a cross-plat<strong>for</strong>m<br />

version of its word processor. The problem was that it wasted time supporting<br />

operating systems that hardly anybody used. The number of people who used<br />

Atari ST and Commodore Amiga computers was miniscule compared to the<br />

number of people who used Macintosh computers, and the number of people<br />

who used Macintosh computers was just as tiny compared to the number of<br />

people who used MS-DOS and Microsoft Windows.<br />

Cross-plat<strong>for</strong>m capabilities make sense only when supporting operating systems<br />

of near equal popularity. The most straight<strong>for</strong>ward way to write a cross-plat<strong>for</strong>m<br />

program is to do what WordStar did — write identical programs with two completely<br />

different languages. That’s possible <strong>for</strong> simple programs, but <strong>for</strong> more<br />

complicated programs, that approach takes too much time.<br />

The portability of C<br />

One reason why the C language has proven so popular is because of its<br />

portability. The C language is relatively simple, which makes it easy to create<br />

C compilers <strong>for</strong> different operating systems. That also makes compiling C<br />

programs to run on different operating systems with minimal changes easy.<br />

Writing programs in C is how companies, like Microsoft and Adobe, can develop<br />

and sell programs that run on both Windows and the Macintosh, such as<br />

Microsoft Word and Photoshop. The bulk of their programs run identically on<br />

both operating systems, so all they need to do is write a small portion of their<br />

program to customize it to run on each particular operating system.

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

Saved successfully!

Ooh no, something went wrong!