666 The Programming Language of the Future 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 Programming Language of the Future 667 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 objectoriented features. The most popular use for Objective-C is forprogramming 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. Book VII Chapter 5 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. The Future of Computer Programming 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#.