Chapter VII.5. The Future of Computer Programming

The computer industry is changing all the time, which means that the programming tools and techniques of today will likely become obsolete by tomorrow. Just trying to keep up with the computer industry is a full-time occupation, and even computer experts can never agree on what the future may bring.

Although it's impossible to predict the future, it is possible to identify trends in the computer industry, and based on these trends, predict what might occur in the future. In the world of computer programming, the most important lesson is to learn the logic of programming without getting bogged down by the specific syntax of any particular programming language. That's because programming languages rise and fall out of favor. If you learn to program in only one particular language, your programming ability will be restricted by the limitations of that particular language.

Programming is nothing more than problem solving, and problem solving is invaluable no matter which programming language, computer, or operating system may be popular at any given time. If you can solve problems, you'll always have a job.

Picking a Programming Language

Computer scientists eternally debate the merits of one programming language over another, but no matter which programming language may be popular today, the real issue boils down to efficiency and complexity.

Throughout history, the most popular language has always been the one that offers the greatest amount of efficiency for solving the most complicated problems. Initially, programmers used machine language to write entire programs because that was all they had available. However, as soon as assembly language appeared, few people wrote entirely in machine language. Instead, they switched to assembly language because it allows programmers to write more complicated programs.

In the early days of personal computers, nearly every programmer used assembly language. One of the first popular word processors, WordStar, even ran on two different processors — the Zilog Z-80 and the Intel 8088. To run on these two different processors, the company had to write WordStar in two completely different assembly languages.

When programs were fairly simple, that could be possible; but as programs grew in complexity, writing programs entirely in assembly language proved too cumbersome. That's when programmers switched to C.

Most operating systems today are written entirely in C for maximum efficiency; but as programs grow in complexity, C is quickly falling out of favor just as assembly language and machine language have done before. To maintain maximum efficiency to deal with growing complexity, most programmers have now switched to C++.

In the future, the complexity of programs will always make today's popular programming language too cumbersome to use tomorrow. So, it's likely that today's popular C++ language will one day become too clumsy to use for writing programs in the future. If you learn C++ today, plan on adapting and learning a newer programming language to write more complicated programs in the shortest amount of time.

The successor to C++ will have to make writing complicated programs easier than C++ while retaining maximum efficiency. This language of the future will depend heavily on the operating systems of the future.

Picking an Operating System

In the early days of computers, every computer had its own operating system, which made writing programs difficult. Not only did you have to learn a specific programming language, but you also had to learn how to write programs for a specific operating system.

To avoid this problem, computer companies standardized around a single operating system. The first standard operating system is CP/M-80, which later gave way to MS-DOS and finally to Microsoft Windows.

Initially, a single operating system made writing programs easier because you had to write programs for only one operating system instead of a handful of operating systems. By focusing on a single operating system, you could optimize your program for that one operating system. Knowing which operating system to support can define the success (or failure) of an entire software company.

Back in the early days of personal computers, two companies developed a program that everyone called a killer application (or killer app for short). Both of these programs were greatly improved spreadsheet programs used by businesses, but each company took a different approach. One company wrote its spreadsheet program entirely in assembly language and optimized it to run quickly on a single operating system (MS-DOS). The second company developed its spreadsheet to run on multiple operating systems, but to achieve this feat, the company wrote its program in the UCSD Pascal programming language, which runs slowly on all operating systems.

Although both programs offer similar features, there was no comparison from the user's point of view. The program written in assembly language and optimized for the MS-DOS operating system became Lotus 1-2-3, one of the most popular programs ever. The second program, Context MBA, ran so slowly on every operating system that nobody had the patience to use it. Context MBA went out of business, and Lotus 1-2-3 dominated the spreadsheet market —until the standard operating system changed from underneath it.

Lotus 1-2-3 had originally been written in assembly language, but as the program grew in complexity, major portions of the program had been rewritten in C. When personal computers switched from MS-DOS to Microsoft Windows, Lotus 1-2-3 wasn't ready. That's when Microsoft Excel, written in C, took over and has dominated the spreadsheet market ever since.

As Microsoft Excel grows in complexity, major portions of the program are now being rewritten in C++. Eventually, it's likely that maintaining Microsoft Excel in C++ will become too difficult, and a new spreadsheet program will emerge, written in an entirely different programming language.

That's because the days of a single operating system standard seem to be fading. Instead of Microsoft Windows being the dominant operating system, rivals — such as Linux and Mac OS X — have grown in popularity to challenge Microsoft Windows' popularity. Unlike the early days when you could write a program for the dominant operating system and capture 90 percent of the market, today if you write a program for a single operating system, you'll capture an ever-shrinking chunk of the market.

If you use a programming language that runs only on a single operating system, you're locking your programs into future obsolescence. With multiple operating systems becoming common, programs need to run on these major operating systems. If they don't, they risk losing market share to rivals that do run on multiple operating systems.

The growing trend these days is to support multiple operating systems, which requires a language that not only makes it easy to write more complicated programs, but also makes it easy to write and develop programs for multiple operating systems. To thrive, the language of the future needs to make writing complicated programs easier than C++, be as efficient as possible, and run on multiple operating systems at the same time.

Cross-Platform Programming

In the old days, writing programs to run on multiple operating systems was a waste of time because most people only used the same operating system. WordPerfect, a once popular word processor, wasted millions of dollars and several years devoting itsresources to creating a version of WordPerfect that ran on MS-DOS, Macintosh, Commodore Amiga, and Atari ST computers. Although WordPerfect focused on making its word processor run on multiple operating systems (known as cross-platform capabilities), Microsoft focused on making its Microsoft Word program run efficiently on a single operating system (Windows) and nearly wiped WordPerfect off the face of the Earth.

The problem wasn't that WordPerfect spent time writing a cross-platform version of its word processor. The problem was that it wasted time supporting operating systems that hardly anybody used. The number of people who used Atari ST and Commodore Amiga computers was miniscule compared to the number of people who used Macintosh computers, and the number of people who used Macintosh computers was just as tiny compared to the number of people who used MS-DOS and Microsoft Windows.

Cross-platform capabilities make sense only when supporting operating systems of near equal popularity. The most straightforward way to write a cross-platform program is to do what WordStar did — write identical programs with two completely different languages. That's possible for simple programs, but for more complicated programs, that approach takes too much time.

The portability of C

One reason why the C language has proven so popular is because of its portability. The C language is relatively simple, which makes it easy to create C compilers for different operating systems. That also makes compiling C programs to run on different operating systems with minimal changes easy.

Writing programs in C is how companies, like Microsoft and Adobe, can develop and sell programs that run on both Windows and the Macintosh, such as Microsoft Word and Photoshop. The bulk of their programs run identically on both operating systems, so all they need to do is write a small portion of their program to customize it to run on each particular operating system.

Unfortunately, as programs grow more complicated, writing programs in C is getting more difficult. Although most programmers have now switched to C++, eventually a time will come when even C++ will be too hard to use. Computer scientists may come out with a new and improved version of C++, but there's a better chance that a new language will take over instead.

Cross-platform languages

As operating systems grow more complicated, programmers are finding they're spending more time customizing their C/C++ programs for each specific operating system and less time actually updating their program. So another way to write cross-platform programs is to use a cross-platform compiler.

The idea behind a cross-platform compiler is that you can write a program in a specific programming language, and the compiler takes care of creating identically working programs for different operating systems, as shown in Figure 5-1.

A cross-platform compiler can turn a single source code into programs for multiple operating systems.

Figure VII.5-1. A cross-platform compiler can turn a single source code into programs for multiple operating systems.

One popular cross-platform compiler is REALbasic, which is based on the BASIC programming language. Not only is BASIC much easier for writing programs, but by taking care of the details of specific operating systems, REALbasic makes it easy to create a program that can run on Windows, Macintosh, and Linux with little modification. Essentially, REALbasic gives you the benefit of C portability with the simpler language of BASIC.

One problem with cross-platform compilers is that they're never perfect. Ideally, you want to write a single program, compile it for multiple operating systems, and have all versions of your program run identically under each different operating system. In reality, every operating system has its quirks, so you often have to write specific code for each operating system. The amount of operating system specific code is much less than rewriting your entire program from scratch for a different operating system, but this process isn't trivial.

Create a program that can run on three different operating systems, and now you have to worry about maintaining and fixing problems with your program on three different operating systems. It's possible for your program to work perfectly under Linux, but crash under Windows and the Macintosh. The more operating systems your program supports, the greater the complexity in getting your program to work right under all these different operating systems.

Virtual machines

The main advantage of cross-platform compilers is that they compile programs directly into machine language for each specific operating system, which makes your programs run as fast as possible. With today's faster computers, speed is rarely as important as in the old days when slow programs could literally take hours to perform a single task.

Because speed isn't as crucial as in the past, computer scientists have created another way to create cross-platform programs known as virtual machines. Rather than compile a program for a specific processor, virtual machine programming languages compile programs to a generic format (called bytecode, pseudocode, or p-code) that can run on a virtual machine. This virtual machine, running on different operating systems, essentially tricks the program into thinking it's running on a single computer, as shown in Figure 5-2.

A virtual machine lets a program run on multiple operating systems.

Figure VII.5-2. A virtual machine lets a program run on multiple operating systems.

The biggest problem with virtual machine programming languages, such as Java, is their lack of speed. Because virtual machine languages aren't compiled, they run slower than true compiled programs.

Even worse, virtual machine languages can run only on operating systems that have virtual machines written for them. Sun Microsystems, the creator of the Java programming language, has created Java virtual machines for all the major operating systems, including Windows, Macintosh, and Linux. To maintain this ability to run on multiple operating systems, Sun Microsystems must constantly update each virtual machine for each operating system. This added complexity earned Java its initial reputation as a "write once, debug everywhere" language — you had to fix your program on multiple operating systems.

Despite this constant need to create and modify virtual machines for multiple operating systems, Java has proven capable of creating truly cross-platform programs. One company has even created a Microsoft Office clone, ThinkFree (www.thinkfree.com), which can run on Windows, Linux, and the Macintosh.

Software as service

As successful as ThinkFree and other virtual machine-based programs have been, the latest trend is toward selling software as a service. The idea is that instead of having a copy of a program stored on your computer, you use the Internet to access a program stored on another computer, or a server.

The main advantage of this software as service model is consistency. With programs written in C, cross-platform compilers (like REALbasic), or virtual machine languages (like Java), the end result is always a program stored on each person's computer. Therefore, one person could be using version 1.0 of a program, another could be using version 1.4, and a third could be using version 1.57, which makes supporting all these different versions difficult.

A second advantage of the software as service model is that it's based on Internet Web browsing standards, so if a computer can access the Internet, it can use any software as service program. This gives you a cross-platform program without the hassle of making sure your program runs on each particular operating system.

A third advantage of the software as service model is that it frees up space on your hard disk. Instead of cluttering your computer with dozens of separate programs, you only need to store your actual files on your computer because the software as service programs are stored on another computer.

Unfortunately, the software as service model has two drawbacks. If you aren't connected to the Internet, you can't use any software as service program. So if you use a word processor over the Internet but take your laptop computer on an airplane with no Internet connection, you can't use that word processor.

A second problem with the software as service model is that using it constantly costs money. Most software as service programs charge a monthly fee, which gives you the right to use the program for that month. Although this monthly fee is nominal (such as $5 a month), the cost can add up. Buying a simple word processor might cost you $50. Using a word processor as a software as service model might cost you $5 a month, so after ten months, you could've just bought a word processor instead.

For each succeeding month, the cost continues, so you'll wind up paying several hundred dollars just to use a single program. For large corporations, the software as service model can make sense. For individuals, the software as service model is too expensive.

To eliminate monthly fees, software as service companies are offering their programs for free but earning profits by selling advertising. Seeing advertisements may be a minor annoyance, but it makes software as service available to everyone, although there's still the problem of not being able to use a program without a constant and reliable Internet connection.

Rich Internet applications (RIA)

Rich Internet applications (RIAs) overcome the problems of the software as service model by creating a program that's stored on your computer but can update itself over the Internet. RIA programs combine the ideas of virtual machines with software as service.

Like a virtual machine language, RIA programs need a special virtual machine for each operating system. This gives RIA programs the ability to run on multiple operating systems. Because RIA programs are stored directly on your computer, you can use them any time without an Internet connection and you aren't locked into paying a monthly fee to access the software. Like the software as service model, RIAs can connect to the Internet and update themselves to insure that you're always using the latest version.

One popular RIA programming tool is Adobe AIR, which combines the languages of Web page designing (HTML and Flash) with scripting languages (JavaScript) to run on multiple operating systems through a virtual machine (like Java).

Another popular RIA programming tool is Microsoft Silverlight, which allows programmers to create RIA programs using any .NET language such as Microsoft's own C#, C++, or Visual Basic languages, or third-party .NET compatible languages including Delphi, IronPython, and IronLisp. Unlike Adobe AIR, which is designed to run on Windows, Mac OS X, and Linux, Microsoft Silverlight runs only on Windows and Mac OS X, and you can only run Silverlight applications on Mac OS X, but not use Mac OS X to develop RIA programs.

As more people gravitate toward other operating systems, RIA programming will likely become the hottest trend for programming. Essentially, RIA programs let you create programs by designing them like Web pages that can run independently of any browser on multiple operating systems.

Robotics programming

If programming a computer sounds like fun, programming a walking, flying, or rolling robot might be even more exciting. Programming a robot is essentially like programming a computer that can move and manipulate its environment.

Since programming a robot from scratch can be tedious, much of robotics programming revolves around developing and using special robotic programming frameworks. The framework provides basic commands for controlling the robot, such as making it move. Such a robotics framework isolates programmers from the tedium of how to make a robot work and just tells the robot what to do. A typical robotic program might look like this:

Move arm 34 degrees
Close gripper
Move arm 180 degrees
Open gripper

Just as high-level languages like BASIC or FORTRAN isolate you from manipulating the details of a computer, robotics programming frameworks can isolate you from manipulating the specific details of a robot's parts.

Microsoft offers its Robotics Studio development tool, which lets you control a simulated robot on your computer so you can test out your program in the absence of a real robot. After you get your robot program to work, then you can download the program into an actual robot and see your program in action.

Besides Microsoft Robotics Studio, other robotics programmers have used programming languages like Java, C++, and even Python to control a robot, so if you master a popular computer programming language, there's a good chance you'll be able to transfer your skills to program a robot as well.

For a playful introduction to robotics, buy a copy of Lego's Mindstorms NXT robotic kid, which lets you create a robot out of Legos and use the Lego visual programming language to make your robot move.

Robotics combines mechanical engineering with computer science and artificial intelligence. You can program a robot to learn, recognize spoken commands, navigate around obstacles, and make decisions on its own given incomplete information. While artificial intelligence often remains an academic exercise, robotics lets you put artificial intelligence in a moving robot so you can see how well your programs actually work. (A well-designed robot program might know enough to avoid trying to roll down a staircase. A poorly designed robot program might make the robot cheerfully roll off the top of a staircase and crash at the bottom steps below.)

Robotics is a growing field with no clear-cut robotics language standard yet to emerge. Who knows? With a little bit of creativity, you might be responsible for creating the next standard in robotics programming.

The Programming Language of the Future

Although there will always be dominant programming languages, there will never be a single perfect programming language because everyone's needs and preferences are different. Some people prefer C for its raw power and control, whereas others prefer BASIC and other high-level languages for making programming easier by hiding the technical details of manipulating the computer. If you're planning to learn programming, the only certainty is that the language you learn today will likely not be the language you'll be using tomorrow.

Low-level languages

The three most popular low-level languages are machine language, assembly language, and C. Machine and assembly language are best for creating small, fast programs. Machine language programs are often embedded in chips, such as the ones inside your computer that help your computer boot up. Assembly language is also used to create small, fast programs embedded in chips. The main difference is that assembly language is easier to write, so it allows programmers the ability to write more complicated programs than if they use machine language. The C language is used most often to create much larger programs, such as drivers for running printers, scanners, or Web cams.

Learn these three low-level languages if you need speed or absolute control over the computer. If these aren't your priority, you can safely ignore these languages, although knowing them will definitely help you better understand how a computer works.

The next generation: C++, Objective-C, C#, and Java

Most large programs are no longer written in C but in C++ for its object-oriented features. If you want to write programs professionally, learn C++ because that can get you a job practically anywhere.

Another object-oriented version of C++ is Objective-C, which also offers object-oriented features. The most popular use for Objective-C is for programming the Macintosh, so if you want to use the fastest, most powerful programming language to develop Macintosh programs, learn Objective-C. If you want to develop programs for other operating systems, such as Windows or Linux, learn C++.

The latest variant of the C language is C#, which has been embraced as the programming language for Windows. Because C# programs run only on Windows, you can't port your C# programs to run on other operating systems, such as the Macintosh, although there's currently limited support for running C# programs on Linux.

If portability is important, stick with C++. If you want to write programs only for Windows, learn C#. If you want to write programs for the Macintosh, learn Objective-C. All three languages are similar enough that you can switch among writing C++, C#, and Objective-C programs with few problems; but for now, learning C# locks you into a specific operating system, which ultimately will limit the market for your programs.

Java is fast becoming the new standard programming language. If you need true compilation on multiple operating systems, stick with C++. If you want the power of C with the ability to manage large software projects, like C++, learn Java. Because Java is so closely related to the C family of languages, learning Java can indirectly teach you the basics of C, C++, C#, and Objective-C.

REALbasic and Visual Basic

BASIC is one of the easiest programming languages to learn, so it's only natural that so many programmers continue using BASIC. Currently the two most popular versions of BASIC are REALbasic and Visual Basic.

At one time, Visual Basic was one of the most popular programming languages in the world. Then Microsoft introduced a new version that wasn't compatible with previous versions of Visual Basic. Therefore, older Visual Basic programs wouldn't run on newer versions of Visual Basic.

In addition, Microsoft added object-oriented features to Visual Basic that essentially turned Visual Basic into a simplified version of C#. As a result of these changes, Visual Basic users were faced with the choice of learning the new version of Visual Basic or switching to a different programming language altogether. In general, most Visual Basic programmers have switched to C#.

However, some Visual Basic programmers have switched to REALbasic, which not only can run older versions of Visual Basic programs but can also compile them to run on multiple operating systems, such as Windows, Macintosh, and Linux.

All this means that the latest version of Visual Basic has lost much of its appeal to programmers. Think of the current version of Visual Basic as an easier version of C#. If you don't want to learn C#, learn Visual Basic. If you already know older versions of Visual Basic, learn REALbasic.

The scripting languages

Traditional programming languages, like C and BASIC, are known as systems languages because they're used to create programs, like word processors and spreadsheets. As a programmer, learn at least one systems language, such as C++, but make sure you also learn a second language so the syntax of one particular programming language doesn't restrict your ability to think about programming in general. Some people learn a second systems programming language, like BASIC, but others prefer learning a scripting language instead.

Scripting languages, such as Perl, Tcl, JavaScript, and Python, are often used to connect, or glue, various components together, such as a Web page interface with a database. As a result, scripting languages are designed to solve problems that traditional languages aren't very good at. With more companies needing Web applications, there will be more opportunities for work.

More important, figuring out scripting languages to build Web pages also translates into creating rich Internet applications. The odds are greater that you'll need to use a scripting language more than you'll ever need to use C++, so learning any scripting language is crucial for your future as a programmer.

The best programming language

Finding the best programming language to learn is like finding the perfect car; everyone's needs are different. At the very least, learn one systems programming language (such as C++), one scripting language (such as JavaScript), and one database language (such as SQL). Because you'll likely have more opportunities for writing rich Internet applications than systems programs, like operating systems or word processors, rich Internet application programming is likely the wave of the future, so be sure you understand different Web page languages such as HTML and Flash.

As long as you arm yourself with programming knowledge of a variety of languages, such as C++, JavaScript, and SQL, you can get a job practically anywhere and your skills can be transferred easily to other languages that may become popular in the near future.

Just remember that the programming language you use is less important than your ability to solve problems and create useful programs. What you do with your programming skills will always transcend the specific knowledge of knowing a particular programming language. Ultimately, the most important part of programming is you.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset