Beginning Programming For Dummies, 4th Edition

( 22 )

Overview

Do you think the programmers who work at your office are magical wizards who hold special powers that manipulate your computer? Believe it or not, anyone can learn how to write programs, and it doesn’t take a higher math and science education to start.

Beginning Programming for Dummies shows you how computer programming works without all the technical details or hard programming language. It explores the common parts of every computer programming language and how to write for ...

See more details below
Paperback (Revised Edition)
$16.39
BN.com price
(Save 34%)$24.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (13) from $2.63   
  • New (5) from $13.16   
  • Used (8) from $2.63   

Overview

Do you think the programmers who work at your office are magical wizards who hold special powers that manipulate your computer? Believe it or not, anyone can learn how to write programs, and it doesn’t take a higher math and science education to start.

Beginning Programming for Dummies shows you how computer programming works without all the technical details or hard programming language. It explores the common parts of every computer programming language and how to write for multiple platforms like Windows, Mac OS X, or Linux. This easily accessible guide provides you with the tools you need to:

  • Create programs and divide them into subprograms
  • Develop variables and use constants
  • Manipulate strings and convert them into numbers
  • Use an array as storage space
  • Reuse and rewrite code
  • Isolate data
  • Create a user interface
  • Write programs for the Internet
  • Utilize JavaScript and Java Applets

In addition to these essential building blocks, this guide features a companion CD-ROM containing Liberty BASIC compiler and code in several languages. It also provides valuable programming resources and lets you in on cool careers for programmers. With Beginning Programming of Dummies, you can take charge of your computer and begin programming today!

Read More Show Less

Product Details

  • ISBN-13: 9780470088708
  • Publisher: Wiley
  • Publication date: 11/6/2006
  • Series: For Dummies Series
  • Edition description: Revised Edition
  • Edition number: 4
  • Pages: 408
  • Sales rank: 141,732
  • Product dimensions: 7.44 (w) x 9.30 (h) x 0.90 (d)

Meet the Author

Wallace Wang is a bestselling author with more than 2.3 million For Dummies books in print, including Microsoft Office For Dummies. He's also a stand-up comic who has performed on TV.

Read More Show Less

Table of Contents

Introduction.

Part I: Programming a Computer.

Chapter 1: Learning Computer Programming for the First Time.

Chapter 2: All about Programming Languages.

Chapter 3: How to Write a Program.

Chapter 4: The Tools of a Computer Programmer.

Part II: The Building Blocks of Programming.

Chapter 5: Getting Started.

Chapter 6: The Structure of a Computer Program.

Chapter 7: Variables, Constants, and Comments.

Chapter 8: Crunching Numbers and Playing with Strings.

Chapter 9: Making Decisions with Branching Statements.

Chapter 10: Repeating Yourself with Loops.

Chapter 11: Dividing a Program into Subprograms.

Chapter 12: Storing Stuff in Arrays.

Chapter 13: Playing with Object-Oriented Programming.

Part III: Advanced Programming Topics.

Chapter 14: Sorting and Searching Algorithms.

Chapter 15: Debugging Programs.

Chapter 16: Optimizing Your Code.

Chapter 17: Creating a User Interface.

Part IV: Internet Programming.

Chapter 18: Playing with HTML.

Chapter 19: Making Interactive Web Pages with JavaScript.

Chapter 20: Using Java Applets on Web Pages.

Part V: The Part of Tens.

Chapter 21: Ten Additional Programming Resources.

Chapter 22: Ten Cool Programming Careers.

Appendix A: Common Loop and Branching Structures.

Appendix B: Free Language Compilers and Interpreters.

Appendix C: Common Programming Terms.

Appendix D: Installing the CD Compilers.

Index.

Wiley Publishing, Inc. End-User License Agreement.

Read More Show Less

First Chapter

Beginning Programming For Dummies


By Wallace Wang

John Wiley & Sons

ISBN: 0-7645-4997-9


Chapter One

How to Write a Program

In This Chapter

* Designing your program

* Understanding the technical details

* Choosing a programming language

* Defining how the program should work

* Knowing the life cycle of a typical program

Although you can sit down at your computer and start writing a program right now without any planning whatsoever, the result would likely to prove as messy as trying to bake a cake by throwing all the ingredients together without following a recipe.

You can write a simple program that displays your cat's name on-screen without much planning, but for anything more complex, you want to take time to design your program on paper before you even touch a computer. After you're sure that you know what you want your program to do and how you want it to look on-screen, you can worry about writing a program that actually accomplishes this task.

Before You Write Your Program

If you design your program before writing it, you don't waste time writing a program that doesn't work or that solves the wrong problem and isn't worth trying to salvage afterward. By planning ahead of time, you increase the odds that your program actually works and performs the task that you want.

The following three items are crucial to consider in designing a program:

  •   The user: Who's going to use your program?
  •   The target computer: Which computer do people need to run your program? Is it a Windows 98/Me/NT/2000/XP computer, a Macintosh, a mainframe, a computer running Linux, a handheld Palm or PocketPC, or a supercomputer?
  •   You: Are you going to write the entire thing yourself or get help from others? If you're going to get others to help you, which parts of the program are they going to write?

When you're designing a program, you don't need to worry about which programming language you're going to use. Once you know exactly what you want your program to do, then you can choose which programming language might be easiest to use.

The program's users

If you're the only person who's going to use your program, you can pretty much make your program look and act any way you want, just as long as you know how to make it work. But if you plan to give or sell your program to others, you need to know who's going to use your program.

Knowing your program's typical user is critical. If users don't like your program for any reason, they're unlikely to use it. Whether the program actually works is often irrelevant.

By designing your program with the user in mind, you increase the odds that people use your program and (you hope) buy a copy for themselves.

Even if you write a program that works perfectly, users still may ignore it because they don't like the way it looks, they don't understand how to give it commands, it doesn't work the same way as the old program they currently use, the colors don't look right to them, and so on. The goal is to make your program meet your users' needs, no matter how weird, bizarre, or illogical they may seem. (The needs - not the users.)

The target computer

After you identify the user, you need to know what type of computer the user intends to run the program on. The type of computer that your program runs on can determine which computer languages you can use, the hardware that your program can expect to find, and even the maximum size of your program.

If you're writing a program to run on a Macintosh, for example, your program can take advantage of sound, color graphics, a large hard disk, and plenty of memory. You need to rewrite that same program drastically, however, to run it on a Palm handheld computer, with its limited sound capability, much simpler color graphics, and limited amount of memory and storage space.

If you can copy and run your program on another computer with little or no modification, your program is considered portable. The computer language that you use to write your program can affect its portability. That's why so many people use C/C++ - C and C++ programs tend to be more portable than other programming languages.

Your own programming skill

When designing any program, consider your own programming skill. You may get a great idea for a program, but if you're a beginner with little experience, writing your program may take a long time - if you don't give up out of frustration first.

Your programming skill and experience also determine the programming language that you choose. Experienced programmers may think nothing about writing entire programs in C or C++. But novices may need to spend a long time studying C and C++ before writing their programs, or they may choose an easier programming language, such as BASIC.

Some novices take the time to learn difficult languages, such as C/C++, and then go off and write their program. Others take an easier approach and choose a simpler language such as Visual Basic so they can create (and market) their programs right away. Don't be afraid to tackle a heavy-duty language such as C/C++, but don't be afraid to use a simpler language such as Visual Basic either. The important goal is to finish your program so you can start using it and (possibly) start selling it to others.

Many programmers create their program by using a language such as Visual Basic and then later hire more experienced programmers to rewrite their programs in a more complex language such as C/C++, which can make the program faster and more efficient.

The Technical Details of Writing a Program

Few people create a program overnight. Instead, most programs evolve over time. Because the process of actually typing programming commands can prove so tedious, time-consuming, and error-prone, programmers try to avoid actually writing their programs until they're absolutely sure that they know what they're doing.

Prototyping

To make sure that they don't spend months (or years) writing a program that doesn't work right or that solves the wrong problem, programmers often prototype their programs first. Just as architects often build cardboard or plastic models of skyscrapers before a construction crew starts welding I-beams together, programmers create mock-ups (prototypes) of their programs first.

A prototype usually shows the user interface of the program, such as windows, pull-down menus, and dialog boxes. The prototype may look like an actual program, but clicking menus doesn't do anything. The whole idea of the prototype is to show what the program looks like and how it acts, without taking the time to write commands to make the program actually work.

After the programmer is happy with the way the prototype looks, she can proceed, using the prototype as a guideline toward completing the final program.

Many programmers use Visual Basic because it's easy for creating prototypes quickly. After you use Visual Basic to create a prototype that shows how your user interface works, you can start adding actual commands to later turn your prototype into an honest-to-goodness working program.

Choosing a programming language

After you refine your prototype until it shows you exactly how your program is to look and act, the next step is choosing a programming language to use.

You can write any program by using any programming language. The trick is that some languages make writing certain types of programs easier.

The choice of a programming language to use can pit people against one another in much the same way that religion and politics do. Although you can't find a single "perfect" programming language to use for all occasions, you may want to consider a variety of programming languages. Ultimately, no one cares what language you use as long as your program works.

Defining how the program should work

After choosing a specific programming language, don't start typing commands into your computer just yet. Just as programmers create mockups (prototypes) of their program's user interface, they often create mock-up instructions that describe exactly how a program works. These mock-up instructions are known as pseudocode.

If you need to write a program that guides a nuclear missile to another city to wipe out all signs of life within a 100-mile radius, your pseudocode may look as follows:

1. Get the target's coordinates.

2. Get the missile's current coordinates.

3. Calculate a trajectory so the missile hits the target.

4. Detonate the nuclear warhead.

By using pseudocode, you can detect flaws in your logic before you start writing your program - places where the logic behind your program gets buried beneath the complexity of a specific programming language's syntax.

In the preceding example, you can see that each pseudocode instruction needs further refining before you can start writing your program. You can't just tell a computer, "Get the target's coordinates" because the computer wants to know, "Exactly how do I get the target's coordinates?" So rewriting the preceding pseudocode may look as follows:

1. Get the target's coordinates.

a. Have a missile technician type the target coordinates.

b. Make sure that the target coordinates are valid.

c. Store the target coordinates in memory.

2. Get the missile's current coordinates.

3. Calculate a trajectory so the missile hits the target.

4. Detonate the nuclear warhead.

You can refine the instructions even further to specify how the computer works in more detail, as follows:

1. Get the target's coordinates.

a. Have a missile technician type the target coordinates.

b. Make sure that the target coordinates are valid.

1) Make sure that the target coordinates are complete.

2) Check to make sure that the target coordinates are within the missile's range.

3) Make sure that the target coordinates don't accidentally aim the missile at friendly territories.

c. Store the target coordinates in memory.

2. Get the missile's current coordinates.

3. Calculate a trajectory so the missile hits the target.

4. Detonate the nuclear warhead.

When programmers define the general tasks that a program needs to accomplish and then refine each step in greater detail, they say that they're doing a top-down design. In other words, they start at the top (with the general tasks that the program needs to do) and then work their way down, defining each task in greater detail until the pseudocode describes every possible step that the computer must go through.

Writing pseudocode can prove time-consuming. But the alternative is to start writing a program with no planning whatsoever, which is like hopping in your car and driving north and then wondering why you never seem to wind up in Florida.

Pseudocode is a tool that you can use to outline the structure of your program so that you can see all the possible data that the computer needs to accomplish a given task. The idea is to use English (or whatever language you understand best) to describe the computer's step-by-step actions so that you can use the pseudocode as a map for writing the actual program in whatever language (C/C++, FORTRAN, Pascal, Java, and so on) that you choose.

The Life Cycle of a Typical Program

Few programs are written, released, and left alone. Instead, programs tend to go through various cycles where they get updated continuously until they're no longer useful. (That's why many people buy a new word processor every few years even though the alphabet hasn't changed in centuries.)

Generally, a typical program goes through a development cycle (where you first create and release it), a maintenance cycle (where you eliminate any glaring bugs as quickly as possible), and an upgrade cycle (where you give the program new features to justify selling the same thing all over again).

The development cycle

Every program begins as a blank screen on somebody's computer. During the development cycle, you nurture a program from an idea to an actual working program. The following steps make up the development cycle:

1. Come up with an idea for a program.

2. Decide the probable identity of the typical user of the program.

3. Decide which computer the program is to run on.

4. Pick one or more computer languages to use.

5. Design the program by using pseudocode or any other tool to outline the structure of the program.

6. Write the program.

7. Test the program.

This step is known as alpha testing.

8. Fix any problems that you discover during alpha testing.

Repeat Steps 7 and 8 as often as necessary.

9. Give out copies of the program to other people to test.

This step is known as beta testing.

10. Fix any problems that people discover during beta testing.

Repeat Steps 9 and 10 as often as necessary.

11. Release the program to the unsuspecting public and pray that it works as advertised.

The maintenance cycle

Most programmers prefer to create new programs than maintain and modify existing ones, which can prove as unappealing as cleaning up somebody else's mess in an apartment. But the number of new programs that programmers create every year is far less than the number of existing programs, so at some point in your life, you're likely to maintain and update a program that either you or somebody else wrote.

The following list describes typical steps that you may need to follow to maintain an existing program:

1. Verify all reports of problems (or bugs) and determine what part of the program may be causing the bug to appear.

2. Fix the bug.

3. Test the program to make sure that the bug is really gone and that any changes you make to the program don't introduce any new bugs.

4. Fix any problems that may occur during testing.

5. Repeat Steps 1 through 4 for each bug that someone reports in the program.

Given the buggy nature of software, these steps may go on continuously for years.

6. Release a software patch, which users can add to an existing version of the program to incorporate corrections that you make to "patch up" the problems.

The upgrade cycle

Companies don't make money fixing software and making it more stable, reliable, and dependable. Instead, companies make money by selling new versions of their programs that offer additional features and options that most people probably don't use or need in the first place.

Continues...


Excerpted from Beginning Programming For Dummies by Wallace Wang Excerpted by permission.
All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.

Read More Show Less

Customer Reviews

Average Rating 3.5
( 22 )
Rating Distribution

5 Star

(8)

4 Star

(4)

3 Star

(2)

2 Star

(6)

1 Star

(2)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
See All Sort by: Showing 1 – 20 of 22 Customer Reviews
  • Anonymous

    Posted November 15, 2009

    Its a start.

    The book is great for someone who has never programmed before. But the direction on the actual programming is very unclear. But it is the best you could probibly do.

    2 out of 2 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Posted August 22, 2009

    more from this reviewer

    A great start but not much more than that

    I myself had already taken a week long course in programming before purchasing this book. I figured this would help me talk things the next step. All it really did was reiterate everything i already knew.

    2 out of 2 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted April 25, 2012

    Gxhdhfhfjvbfgdjxv

    Hshgudvdhdvgfywksbcgdusiebxgdjsyevckshfurbckdgdudgfjvdhdhfgdfyfbdgdggbfffgfjsbwvsgxbdhhdhdtbfhzksjevhegfggkgbgbhfjhducyxbwgdufixbfgeteudjxdhcyfhsydydhdfstsbrgrgsfqrwfsgsgfbdhxhcycbdgdgdbffdgdggggggggdycbcgfgdgdhxvdbdfhfheyfgfvvgfjhfhfgfvgcjbcbznxmxnfhfykkwefgugffbudidvfufvfifvfifvfvfkfvfvfkfxhdjddekdbdhsisieygvbigansvwbfndmdvdvtchfmftdythyhlgxgcjdtclgsnxfzgxhnxgctedhxhxkxhyctgzbsxuhcsjuhhtyggfbfbgxufvghfhtvghdjxhdvfjdjdjrvtgxjyfgghttxbgfhudjdjfcgkdjdjtcshevjdbujdbvdhdhbxjdyhckfujcncfirtgihykdcvdcclkbdhdggsfaragsgdhcjvkbihihugicctttctyychxgdxhhkuxihxiixgichxhxkckchcbhdxrcdytgdvhykchfhfyfgfhghghfncvvhfhfifghrbfhgutbfbfkfnchfkfgkbfnhfkfhfflfyfkfbchrhffbfhsaesegtohdodhdodiofbfhxudnsnshehehdhdhekeidxibkfdjxxdkiiwiqiopqweolllfhcjfhfhfhfhjchchcjchfhfffffhfmmmkjhdhhgftrtyyuiehfhchfhffjhfhfybgngfvxhxfyfhrhffhfbfhgnygkfghfjfyrjrhkfdkdhkdhfjdheteuehdbdkddfvkudddyduwetereetetetckaiaksjdgfhffgfyfjgyfyftghrthgghghgkfhfvrgyyefvfgfgdvdufhfhfjfbcjfjthfhfbfcvfxbgcbgvvjfbcbfhhhhdhggnjdhcujs

    1 out of 14 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted July 7, 2007

    :(

    Well I spent a couple hours reading it and once I got to the examples I couldn't understand any of it. I need to understand what it does and how it happens. Any good books like that?

    1 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted June 4, 2014

    Computerish to english


    Say= make your npc talk
    funnctionn: Follow player= npc will follow players

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted April 30, 2014

    I have a question

    Im just a kid who programs simple things in basic. I want to learn more. Can this help me at all?

    Was this review helpful? Yes  No   Report this review
  • Posted April 4, 2014

    Warning: This book is obsolete

    REALbasic, one of the computer languages used in the book, is no longer supported. It has been replaced by Xojo. I had bought the book at B&N online, and when I tried returning it to my local B&N, they refused to refund by money. As far as they were concernced, the book was not obsolete. As long as B&N headquarters said the book was current, they would abide by that. B&N telephone customer service at first had difficulty understanding my complaint, but finally told me to return the book. At that point, I had lost my confidence in B&N and donated the book to a nearby library. I'm now looking for alternatives to this book and to B&N.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted June 3, 2013

    Program

    The programming language is QBASIC

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted January 20, 2013

    What programming language is this book?

    What is the programming language in this book?
    Pls respond with language

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted April 15, 2011

    Good start

    Its very good, at explaining it in a an easy to understand and teaches you some concepts that are relevant, does not however go deeply into programming but hey after all its beginning programming, not intermediate or advanced.

    Was this review helpful? Yes  No   Report this review
  • Posted November 17, 2009

    Confusing

    The CD that comes with the book does not work with the code they have in the book. Maybe they have left instructions out, but if you try to follow along good luck.

    0 out of 2 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted November 23, 2007

    very informative and helpful!

    Gives people who want to learn programming a good understanding of what it is and how it works, although it may take a little re-reading once in a while. Very good in that it gives you basics and important information before or while you start programming and some example and guides you into which programming laguage you should use bases on what goal you're trying to accomplish. Don't just jump into it unless you already know your way around a computer 'stuff like file management and changing your operating sytems settings', if you don't I'd suggest picking up a simpler for Dummies book like one on Windows or computers in general I suppose.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted April 5, 2010

    No text was provided for this review.

  • Anonymous

    Posted August 18, 2009

    No text was provided for this review.

  • Anonymous

    Posted October 11, 2011

    No text was provided for this review.

  • Anonymous

    Posted September 29, 2011

    No text was provided for this review.

  • Anonymous

    Posted January 27, 2010

    No text was provided for this review.

  • Anonymous

    Posted September 12, 2009

    No text was provided for this review.

  • Anonymous

    Posted February 25, 2010

    No text was provided for this review.

  • Anonymous

    Posted December 30, 2009

    No text was provided for this review.

See All Sort by: Showing 1 – 20 of 22 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)