- •About the Author
- •Dedication
- •Author’s Acknowledgments
- •Contents at a Glance
- •Table of Contents
- •Introduction
- •Who Should Buy This Book
- •How This Book Is Organized
- •Part I: Programming a Computer
- •Part II: Learning Programming with Liberty BASIC
- •Part III: Advanced Programming with Liberty BASIC
- •Part VI: Internet Programming
- •Part VII: The Part of Tens
- •How to Use This Book
- •Foolish assumptions
- •Icons used in this book
- •Why Learn Computer Programming?
- •How Does a Computer Program Work?
- •What Do I Need to Know to Program a Computer?
- •The joy of assembly language
- •C: The portable assembler
- •High-level programming languages
- •Database programming languages
- •Scripting programming languages
- •The program’s users
- •The target computer
- •Prototyping
- •Choosing a programming language
- •Defining how the program should work
- •The Life Cycle of a Typical Program
- •The development cycle
- •The maintenance cycle
- •The upgrade cycle
- •Writing Programs in an Editor
- •Using a Compiler or an Interpreter
- •Compilers
- •Interpreters
- •P-code: A combination compiler and interpreter
- •So what do I use?
- •Squashing Bugs with a Debugger
- •Writing a Help File
- •Creating an Installation Program
- •Why Learn Liberty BASIC?
- •Liberty BASIC is easy
- •Liberty BASIC runs on Windows
- •You can start using Liberty BASIC today
- •Installing Liberty BASIC
- •Loading Liberty BASIC
- •Your First Liberty BASIC Program
- •Running a Liberty BASIC program
- •Saving a Liberty BASIC program
- •Getting Help Using Liberty BASIC
- •Exiting Liberty BASIC
- •Getting input
- •Displaying output
- •Sending Data to the Printer
- •Storing Data in Variables
- •Creating a variable
- •Assigning a value to a variable
- •Declaring your variables
- •Using Constants
- •Commenting Your Code
- •Using variables
- •Working with precedence
- •Using parentheses
- •Manipulating Strings
- •Declaring variables as strings
- •Smashing strings together
- •Counting the length of a string
- •Playing with UPPERCASE and lowercase
- •Trimming the front and back of a string
- •Inserting spaces
- •Yanking characters out of a string
- •Looking for a string inside another string
- •Using Boolean Expressions
- •Using variables in Boolean expressions
- •Using Boolean operators
- •Exploring IF THEN Statements
- •IF THEN ELSE statements
- •Working with SELECT CASE Statements
- •Checking a range of values
- •Checking a relational operator
- •Boolean expression inside the loop
- •Looping a Fixed Number of Times
- •Counting with different numbers
- •Counting in increments
- •Anatomy of a Computer Bug
- •Syntax Errors
- •Fun with Logic Errors
- •Stepping line by line
- •Tracing through your program
- •Designing a Window
- •Creating a new window
- •Defining the size and location of a window
- •Adding color to a window
- •Putting Controls in a Window
- •Creating a command button
- •Displaying text
- •Creating a check box
- •Creating a radio button
- •Creating text boxes
- •Creating list boxes
- •Creating combo boxes
- •Creating group boxes
- •Storing Stuff in Text Files
- •Creating a new text file
- •Putting stuff in a text file
- •Adding new stuff to an existing text file
- •Retrieving data from a text file
- •Creating a new binary file
- •Saving stuff in a binary file
- •Changing stuff in a binary file
- •Retrieving stuff from a binary file
- •Creating a Graphics Control
- •Using Turtle Graphics
- •Defining line thickness
- •Defining line colors
- •Drawing Circles
- •Drawing Boxes
- •Displaying Text
- •Making Sounds
- •Making a beeping noise
- •Playing WAV files
- •Passing Data by Value or by Reference
- •Using Functions
- •Defining a function
- •Passing data to a function
- •Calling a function
- •Exiting prematurely from a function
- •Using Subroutines
- •Defining a subroutine
- •Passing data to a subroutine
- •Calling a subroutine
- •Exiting prematurely from a subroutine
- •Writing Modular Programs
- •Introducing Structured Programming
- •Sequential instructions
- •Branching instructions
- •Looping instructions
- •Putting structured programming into practice
- •The Problem with Software
- •Ways to Make Programming Easier
- •Breaking Programs into Objects
- •How to use objects
- •How to create an object
- •Creating an object
- •Starting with a Pointer
- •Defining the parts of a linked list
- •Creating a linked list
- •Managing a linked list
- •Making Data Structures with Linked Lists
- •Stacks
- •Queues
- •Trees
- •Graphs
- •Creating a Record
- •Manipulating Data in Records
- •Storing data in a record
- •Retrieving data from a record
- •Using Records with Arrays
- •Making an Array
- •Making a Multidimensional Array
- •Creating Dynamic Arrays
- •Insertion Sort
- •Bubble Sort
- •Shell Sort
- •Quicksort
- •Sorting Algorithms
- •Searching Sequentially
- •Performing a Binary Search
- •Hashing
- •Searching by using a hash function
- •Dealing with collisions
- •Picking a Searching Algorithm
- •Choosing the Right Data Structure
- •Choosing the Right Algorithm
- •Put the condition most likely to be false first
- •Put the condition most likely to be true first
- •Clean out your loops
- •Use the correct data types
- •Using a Faster Language
- •Optimizing Your Compiler
- •Programming Computer Games
- •Creating Computer Animation
- •Making (And Breaking) Encryption
- •Internet Programming
- •Fighting Computer Viruses and Worms
- •Hacking for Hire
- •Participating in an Open-Source Project
- •Niche-Market Programming
- •Teaching Others about Computers
- •Selling Your Own Software
- •Trying Commercial Compilers
- •Windows programming
- •Macintosh and Palm OS programming
- •Linux programming
- •Testing the Shareware and
- •BASIC compilers
- •C/C++ and Java compilers
- •Pascal compilers
- •Using a Proprietary Language
- •HyperCard
- •Revolution
- •PowerBuilder
- •Shopping by Mail Order
- •Getting Your Hands on Source Code
- •Joining a Local User Group
- •Frequenting Usenet Newsgroups
- •Playing Core War
- •Programming a Battling Robot
- •Toying with Lego Mindstorms
- •Index
- •End-User License Agreement
Chapter 26
Ten Cool Programming Careers
In This Chapter
Programming computer games
Animating with computers
Encrypting data
Programming for the Internet
Fighting computer viruses
Hacking for hire
Working on an open-source project
Programming for a specialized market
Sharing your skills with others
Selling your own software
Ask most high school or college guidance counselors what you can do with your programming skills, and they’re likely to steer you in the
direction of sterile job titles such as programmer analyst or data-entry operator. To help stimulate your imagination so that you can get a really cool job playing around with computers all day, this chapter lists some unusual programming jobs that you may want to consider so that you can actually have fun with your life and your job at the same time.
Programming Computer Games for Fun and Profit
Of all the programming topics in the world, none is more popular than game programming. Besides the obvious job of designing computer games (and getting paid to do it), game programming offers a wide variety of related jobs that can prove just as much fun as game designing but don’t get as much publicity.
362 Part VII: The Part of Tens
Most computer games are team designs. One team may design the game rules; another team does the actual programming; another creates the graphic backgrounds and animation; and still another gets paid to play the latest games to look for bugs and offer suggestions for making the games more exciting (and, hence, more profitable for the publisher).
If you want to write computer games, you need to learn C/C++ and a little bit of assembly language because games need to be as small and as fast as possible. Metrowerks (at www.metrowerks.com) sells special versions of its CodeWarrior compiler for writing computer games in C/C++ for Sony PlayStation and Nintendo game consoles.
If you’d rather exercise your graphic skills, you need to learn animation, which means studying a lot of math (which you use to calculate the best ways to make objects move around the screen).
To start writing your own games, consider using a game engine — a special program that provides instructions to tell the computer how to move animated objects around on-screen. You then spend your time designing your game, not worrying about the details of controlling animated characters on-screen.
For a free game engine that runs on Windows, Linux, and the Macintosh, download the Crystal Space game engine from the official Crystal Space Web site (at http://crystal.sourceforge.net/drupal). Using Crystal Space (and other game engines), you can create 3D triangle mesh sprites with frame animation or transparent and semitransparent textures for creating seethrough water surfaces and windows.
If none of this stuff makes any sense to you, imagine trying to create a game and, at the same time, needing to learn all these technical terms and how to program them yourself. That’s why many people use game engines to help them make new games. Without a game engine, making a game can prove as complicated as making your own word processor just so that you can write a letter.
To find out more about game programming, visit one of the following Web sites (and start on your new career as a professional game programmer today!):
International Game Developer’s Association (at www.igda.org) is the granddaddy of computer-gaming organizations that promotes and protects the computer-gaming industry as well as provides conferences to bring computer gaming professionals together.
Game Developer (at www.gdmag.com) is a special online magazine devoted exclusively to covering the latest game-programming techniques and game-programming industry news.
Chapter 26: Ten Cool Programming Careers 363
Game Programmer (at gameprogrammer.com) is a Web site that provides information and links to the multitude of game programming resources all across the Internet.
DigiPen (at www.digipen.edu) is the site of one of the first schools (with close ties to Nintendo) devoted to training game-programming professionals and awarding them with real college degrees.
GameJobs (at www.gamejobs.com) is a site that provides information, tips, and contacts to help you find a job in the computer-gaming industry.
Creating Computer Animation
Computer animation isn’t just for creating animated characters to shoot or blow up in video games. Programmers also use computer animation in virtual reality, training simulators, and Hollywood special effects (because blowing up a computer-animated building is easier than building a mock-up of an existing building to blow up).
Computer animation can range from creating lifelike images for TV and movies to creating multimedia presentations for business, to making cartoons and animated films. If you like to draw but want to become more than just an artist, combine your knowledge of graphics with programming and help design new graphics-animation programs, create virtual-reality simulators, or work on the next Hollywood blockbuster’s special effects.
To learn more about the wonderfully weird world of computer animation, browse through these Web sites and see what sparks your imagination:
Pixar Animation Studios (at www.pixar.com) is a leading Hollywood animation studio responsible for animating movies such as Toy Story,
Finding Nemo, and A Bug’s Life.
MIT Computer Graphics Society (at www.mit.edu/activities/cgs/ mitcgs.html) is an MIT club dedicated to studying computer graphics as an artistic medium.
International Animated Film Society (at www.asifa-hollywood.org) grants awards (similar to the Academy Awards) for the best computeranimation short films.
Animation Magazine (at www.animationmagazine.net) provides news and information for the entire animation industry.
National Centre for Computer Animation (at ncca.bournemouth. ac.uk) is the United Kingdom’s leading research and training institution for computer animation and digital media.
364 Part VII: The Part of Tens
Computer Graphics World Online (at http://cgw.pennnet.com/ home/home.cfm) is a magazine covering all the tools, news, and conferences that professional computer graphics artists may need to know about.
Making (And Breaking) Encryption
Ever since nations decided to play the game of war and send their people into battle for their own political reasons, armies have used secret codes to communicate with their commanders without revealing information to their enemies.
Because war isn’t likely to disappear anytime soon, every country in the world continues to develop encryption techniques for creating codes and breaking the codes of others. If the world of James Bond, espionage, and cloak-and-dagger spies appeals to your sense of adventure, consider a career in encryption.
Encryption is the art of converting plain-text information into unreadable garbage (which often resembles tax forms or legal documents) so that no one but your intended recipient can read it. Then, by using a secret password or code phrase, the recipient of your encrypted message can unscramble and read it.
The art of encrypting data involves plenty of math (usually focusing on prime numbers). If you plan to pursue a career in encryption, earn some graduate degrees in advanced mathematics and practice your C/C++ programming skills. Then get a job working for the military, a defense contractor, a software encryption publisher, or a security agency such as the National Security Agency (at www.nsa.gov).
The National Security Agency (open to U.S. citizens only) is the premier codemaking and code-breaking agency in the world, housing the most supercomputers in one location. If you know programming, advanced math, or any foreign language, you can use your abilities to read intercepted messages, track enemy submarine acoustic signatures in the Atlantic Ocean, or search through databases to spot the movements and operations of international terrorists.
If you find encryption fascinating but you’d rather not help your country prepare for war, consider putting your encryption skills to use in the international banking and financial world, where encryption protects electronic transactions worth billions of dollars every day.