Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Beginning Programming for Dummies 2004.pdf
Скачиваний:
121
Добавлен:
17.08.2013
Размер:
8.05 Mб
Скачать

Introduction

First of all, anyone can learn to program a computer. Computer programming doesn’t require a high IQ and an innate proficiency in advanced

mathematics. Computer programming just requires a desire to learn and the patience never to give up.

Programming is a skill like swimming, dancing, and juggling. Some people are naturally better than others, but anyone can get better with constant practice. That’s why so many kids become programming wizards at such an early age. The kids aren’t necessarily brilliant; they’re just willing to put in the time to learn a new skill, and they’re not afraid of failing.

If you ever dreamed about writing your own programs, rest assured that you can. Programming can be lots of fun, but it can also be frustrating, annoying, and time-consuming. That’s why Wiley publishes this particular book — to help you discover how to program a computer with the minimum amount of inconvenience and the maximum amount of enjoyment.

Whether you want to pick up computer programming for fun, to start a new career, or to help make your current job easier, consider this book your personal guide through the sometimes scary — and initially intimidating — world of computer programming.

After you finish this book, you can choose the best programming language to accomplish a particular task, understand the tools that programmers use, and even write your own programs for personal use or for sale to others.

And after you read Beginning Programming For Dummies, 3rd Edition, you

can find more detailed information about specific languages by reading Visual BASIC.NET For Windows For Dummies, by Wallace Wang; C For Dummies, by Dan Gookin; Visual C++ .NET For Dummies, by Michael Hyman and Bob Arnson; C++ For Dummies and C# For Dummies, by Stephen R. Davis;

Beginning Programming with Java For Dummies, by Barry Burd; Windows Game Programming For Dummies, by Andre LaMothe; or Perl For Dummies, by Paul Hoffman (all published by Wiley Publishing).

2Beginning Programming For Dummies, 3rd Edition

Who Should Buy This Book

Everyone should buy this book right now because you know the importance of stimulating the economy by spending as much money as possible so the current President can stay in office another four years. But you should especially buy this book if you want to know any of the following:

How to write a computer program

The best programming languages to use and why

Shortcuts for programming a computer as simply and quickly as possible

The evolution of computer programming languages

How to program a Macintosh, Palm handheld, Linux, Windows 98/Me/NT/2000/XP, or PocketPC computer

Whether to write your next computer program by using Visual BASIC, C++, Perl, SmallTalk, C#, or some other programming language

To help you start right away, this book shows you how to use a programming language by the name of Liberty BASIC, which is a shareware BASIC compiler that you can download from the Liberty BASIC Web site at www. libertybasic.com (or copy from the CD that comes with this book). By using this book and Liberty BASIC, you can start programming right away, and later, if you want, graduate to the other programming books in the popular For Dummies series.

How This Book Is Organized

This book follows the time-honored tradition of the printing industry by organizing consecutively numbered pages one after the other to form a book. To help you find what you need quickly, this book consists of seven parts, where each part covers a certain topic about programming a computer, as the following sections describe. Whenever you need help, just flip through the book, find the part that covers the topic you’re looking for, and then keep the book at your side as you get back to work.

Part I: Programming a Computer

If computer programming seems a mysterious arcane science, relax. This part of the book demystifies all the common myths about computer programming,

Introduction 3

shows you exactly how computer programs work, and explains why programming isn’t as difficult as many people think.

To help you better understand programming, this part also shows you how programming has evolved, why so many different programming languages exist, and how programming follows easy-to-remember principles so you can start programming your own computer right away.

Part II: Learning Programming with Liberty BASIC

Trying to pick up programming from a book is like trying to learn judo by reading a pamphlet. In both cases, you may glean a theoretical understanding of the subject, but until you actually practice your skill, you don’t know how much you really picked up.

To give you practical, hands-on experience in using an honest-to-goodness programming language, this part of the book explains how to install and use Liberty BASIC so that you can write real computer programs by using the BASIC programming language. Writing programs in Liberty BASIC helps you to better understand how programming really works as you work with programs and see the results right on your own computer.

Part III: Advanced Programming with Liberty BASIC

Liberty BASIC provides plenty of advanced features for displaying graphics, making sound, and debugging your programs. This part of the book shows you how to take advantage of these special features and shows you the principles behind writing programs in other languages at the same time.

Part IV: Dealing with Data Structures

As do people, computers need a place to store information. People usually dump their information in wallets, purses, filing cabinets, or garages, but computers don’t have that luxury.

Instead, computers must store information in something known as a data structure. Every computer program uses data structures, and programmers

4Beginning Programming For Dummies, 3rd Edition

invent all sorts of different data structures for various uses. So in this part of the book, I explain how every program uses data structures and provide hands-on examples you can try using Liberty BASIC.

Part V: Algorithms: Telling the

Computer What to Do

Algorithms are a fancy way of telling a computer how to accomplish a specific task, step-by-step. Think of an algorithm as a recipe that the computer blindly follows without question.

One perfect algorithm doesn’t exist for writing all computer programs, just as one perfect recipe doesn’t exist for making all dinners. To make programming easier, programmers invent common algorithms for accomplishing certain tasks. This part of the book explains how those algorithms work and why you want to use them.

Part VI: Internet Programming

The Internet is an integral part of the computer world, so this part of the book introduces you to the basics of various Internet languages, including HTML (which designs the appearance of Web pages), JavaScript, and Java.

In this part, you also see how other people create cool Web pages that look good and can display forms and respond to users. You can use this information to create Web sites that interact with users.

Part VII: The Part of Tens

To help gently guide you toward writing your own programs, this part of the book provides information that you may find useful to take your programming education a step farther.

This part is where the book shows you many of the opportunities that a career in programming can offer. In this part, too, you discover where to find and use various free or commercial programming languages available on the Internet or on this book’s enclosed CD. Many of these programming languages sport common names such as C++ and BASIC — or bizarre names such as LISP, Oberon, and Python.