Choosing a Language

If you’re comfortable enough with a computer to prepare a nice-looking résumé, balance a checkbook, or share your vacation photos on Facebook, you can write computer programs.

The key to learning how to program is to start with the right language. The programming language you choose often depends on the tasks you want to accomplish. Each language has strengths and weaknesses. For many years, people learned to program with some form of the BASIC language because the language was created with beginners in mind.


Note

The BASIC language was invented in the 1960s to be easy for students and beginners to learn (the B in BASIC stands for Beginner’s). The downside to using some form of BASIC is that it’s easy to fall into sloppy programming habits with the language.


Microsoft Visual Basic has been used to write thousands of sophisticated programs for commercial, business, and personal use. However, programs created with some versions of Visual Basic can be slower than programs written in other languages such as C# and Visual C++. This difference is especially noticeable in programs that use a lot of graphics, such as games.

This book covers the Java programming language, which is offered by Oracle Corporation. Though Java is more difficult to learn than a language such as Visual Basic, it’s a good starting place for several reasons. One advantage of learning Java is that you can use it on the Web and mobile phones. Java programs can be used to create Android phone apps, browser games, and other hot areas of software development.

Another important advantage is that Java requires an organized approach for getting programs to work. You must be particular about how you write programs; Java balks when you don’t follow its rules.

When you start writing Java programs, you might not see the language’s persnickety behavior as an advantage. You might tire of writing a program and having several errors to fix before the program is finished.

In the coming hours, though, you learn about Java’s rules and the pitfalls to avoid. The benefit of this extra effort is that the programs you create are more reliable, useful, and error-free.

Java was invented by developer James Gosling as a better way to create computer programs. While working at Sun Microsystems, Gosling was unhappy with the way the C++ programming language was performing on a project, so he created a new language that did the job better. It’s a matter of contentious debate whether Java is superior to other programming languages, of course, but the success of the language over the past decade demonstrates the strength of his design. Three billion devices across the world are running Java. More than 1,000 books have been published about the language since its introduction. (This is my sixteenth!)

Regardless of whether Java is the best language, it definitely is a great language to learn. You’ll get your first chance to try out Java during Hour 2, “Writing Your First Program.”


Note

C++ is mentioned several times this hour, so you might be tripping over the term wondering what it means—and how it’s pronounced. C++ is pronounced C-Plus-Plus, and it’s a programming language developed by Bjarne Stroustrop at Bell Laboratories. C++ is an enhancement of the C programming language, hence the Plus-Plus part of the name. Why not just call it C+? The Plus-Plus part is a computer programming joke you’ll understand later in this book.


Learning any programming language makes it much easier to learn subsequent languages. Many languages are similar to each other, so you aren’t starting from scratch when you dive into a new one. For instance, many C++ and Smalltalk programmers find it fairly easy to learn Java because Java borrows a lot of ideas from those languages. Similarly, C# adopts many ideas from Java, so it’s easier to pick up for Java programmers.

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

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