Beginning Programming All-in-One For Dummies. Wallace Wang
Чтение книги онлайн.

Читать онлайн книгу Beginning Programming All-in-One For Dummies - Wallace Wang страница 21

Название: Beginning Programming All-in-One For Dummies

Автор: Wallace Wang

Издательство: John Wiley & Sons Limited

Жанр: Программы

Серия:

isbn: 9781119884422

isbn:

СКАЧАТЬ

       Desire

       A computer

       An editor

       An assembler or compiler

       A lot of time on your hands

      

Find out more about programming tools, like an editor and a compiler, in Book 1, Chapter 4.

      Desire beats technical training every time

      Desire is probably the biggest factor in studying how to program a computer. Many people think that you need a college degree or a mathematical background to know computer programming. Although a college degree and a mathematical background can definitely help, they aren’t necessary. Saying you need to know math before figuring out computer programming is like saying you need a college degree in biology before you can reproduce.

      Some of the most influential and popular programs in the world were created by people who had no formal training in computer programming or computer science. (Conversely, some of the most intelligent PhD candidates in computer science have done nothing to make this world a better place using their programming skills.)

      So, if you have an idea for a program, you can create it. After you have the desire to understand computer programming, you have (almost) everything you need to program a computer.

      Picking a computer and an operating system

      If you want to know how to program a computer, you need a computer to practice on. You can actually discover programming on any computer, from a top-of-the-line machine to an obsolete relic (that was once a top-of-the-line machine) to a simple handheld computer. As long as you have a computer, you can figure out how to program it.

      

Some websites let you practice writing and running code completely within a browser. This spares you the trouble of installing a compiler directly on your computer and lets anyone learn to program as long as they have a browser and access to the Internet.

      An operating system is a special program that makes all the hardware of your computer work together. The operating system tells the processor how to work with the hard disk, read keystrokes typed on a keyboard, and display information on the monitor. Without an operating system, your computer is nothing more than separate chunks of hardware that do absolutely nothing.

      

One of the most popular operating systems in the world is Unix, commonly run on big, expensive computers. Linux is based on Unix, so if you understand how to program a Linux computer, you can also program a Unix computer and vice versa.

      It’s still possible to write programs for obsolete computers like the Atari ST, PDP-11, or Commodore Amiga, but most people choose to write programs for one of the following operating systems:

       Linux: Linux is a free operating system for almost every computer (including PCs). Linux is becoming more popular with big companies (as opposed to individual users), so there’s a growing market for talented Linux programmers.

       macOS: macOS is the operating system that runs the Apple Mac computer. Although Macs aren’t as popular as Windows computers, macOS is still a large and lucrative market.

       Windows: Windows is the operating system that runs on most personal computers (PCs). Because so many people use Windows PCs at work and at home, the software market for Windows is huge and lucrative.

      If you want to prepare yourself for the future, it’s probably best to begin programming on any computer that runs Linux, macOS, or Windows.

      

With virtualization software such as VirtualBox (www.virtualbox.org), you can run different operating systems at the same time, such as running both Linux and Windows on a PC or running both Linux and macOS on a Mac. That way you can practice writing programs for different operating systems on a single computer.

       Android: Android is Google’s free operating system that runs on the majority of smartphones and some tablets.

       iOS and iPadOS: iOS and iPadOS are the operating systems that run on the iPhone and iPad, respectively. The iPhone is the most popular smartphone in the world, and the iPad is the dominant tablet in the world.

       watchOS: watchOS is the operating system that runs on the Apple Watch. The Apple Watch is one of the most popular wearable devices in the world.

       Wear OS: Wear OS is Google’s free operating system for smart watches. It’s a version of Android that runs on smart watches to compete against the Apple Watch.

      To write apps for mobile and wearable operating systems, you normally need to use a computer that runs Linux, macOS, or Windows. However, you can use some of the more powerful tablets to write apps for smartphones and tablets, too.

      Writing programs with an editor

      After you have a computer that runs Linux, macOS, or Windows (or a powerful tablet), the next step is to get an editor. An editor acts like a simple word processor that lets you type, change, and save program commands in a file.

      

In the world of computer programming, a single program command is a line of code. Most programs consist of thousands of lines of code, although a large program (like Microsoft Windows) consists of millions of lines of code. When you write a program, you don’t tell people, “I’m writing a program.” You say, “I’m writing code.” It sounds cooler — at least to other programmers.

      In the old days, you had to buy a programming editor. Today, you can often get a powerful, professional editor for free. Some editors are bundled with an integrated development environment (IDE), which combines the features of an editor with a compiler (to convert your code to assembly language or machine СКАЧАТЬ