- •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 369
Niche-Market Programming
One problem with programming classes is that they teach you how to write programs, but they don’t teach you how to put your skills to practical use. Most companies use computers, so try to combine your knowledge of programming with another field.
Who’s better qualified to design and write medical software, for example, than a programmer with a medical background (or a medical professional with a programming background)? Sports fanatics combine programming skills with enthusiasm for sports to design horse race-handicapping software; health professionals design nutrition and diet software; and lawyers create special legal software.
Practically every field faces unique needs that general-purpose software (such as spreadsheets or databases) can’t solve. That’s why professionals hire programmers to develop custom software.
Best of all, niche markets are so small that you never need to worry about monolithic companies such as Microsoft competing against you and wiping out your business. In addition, only a handful of programmers can even possibly write programs for certain niche markets — how many programmers have experience in hotel management, for example? — which means that you face less competition and a market practically begging for your software.
If you ever wanted to take advantage of your previous job experience and combine it with your new programming skills, consider developing a program that solves a specific problem in a niche market. Who knows? With your programming skills, you can perhaps find new opportunities in a field that may have seemed a dead end.
Teaching Others about Computers
Become an expert in any field, and you can teach others your unique skills. In addition to the obvious teaching positions in schools, training others to use popular programs such as Microsoft Word, Lotus Notes, or C++ programming is a lucrative business.
Training professionals travel around the world, conducting classes for corporations who want to train their workers to use a variety of programs in hopes that they become more productive. As a trainer, you get to see the world, meet people, and see for yourself how many different ways Holiday Inns can design the inside of a hotel room.
370 Part VII: The Part of Tens
If you like dealing with people, enjoy traveling, and love sharing your knowledge of computers with others, this sort of job may prove the perfect position for you.
Selling Your Own Software
There’s no cheaper way to go into business for yourself than to develop and sell your own software. Unlike restaurants or bookstores, you don’t need a large amount of space or an extensive inventory. You simply write a program and sell it electronically across the Internet.
The most popular way to test-market a program is through shareware distribution: You give away copies of your software and ask that people send you money if they find it useful. To encourage more people to send money, your program must prove useful and work reliably.
Despite the seemingly bizarre business logic of giving away your product and trusting that people actually pay you for it, many shareware authors earn hundreds (and sometimes millions) of dollars for their programs over the years. (One of the most successful shareware programs is WinZip, which you can download at www.winzip.com.) Distributing programs as shareware can make you rich or earn you a little bit of extra spending money.
If you ever wanted to start your own business but didn’t want to take out a loan, starting a shareware business is the easiest and cheapest solution. All it takes is a good idea, some decent programming skills, and a little bit of marketing know-how to launch your business.
If your program doesn’t appeal to the average computer user, try selling it to a niche market instead. In addition to niche markets for stock brokers,
law-enforcement agencies, or restaurant owners, you can also find niche markets that target specific computers, such as the Palm or PocketPC handheld computers.
You can turn your programming skills into your own business with the right computer program. And if you like programming, what other job lets you stay home all day, play around with your computer, and still get paid for it in a business all your own?
Chapter 27
Ten Additional Programming
Resources
In This Chapter
Commercial compilers
Finding shareware and freeware compilers
Using proprietary languages
Buying from mail-order houses
Finding sources for source code
Joining a user group
Browsing Usenet newsgroups
Playing Core War
Building battling robots
Playing with Lego Mindstorms
If Liberty BASIC is your first foray into the wonderfully wacky world of computer programming, you may be curious about where to go from here.
Although you can continue practicing with Liberty BASIC and even use Liberty BASIC to create programs that you can sell to others, you may want to learn what other programming languages you can use as well.
If you’re serious about programming as a career, the next logical choice is to learn C/C++, C#, or Java. Of course, this step means learning the arcane syntax of C/C++, C#, or Java, so you may want to consider a simpler (but still powerful) alternative such as Visual Basic.
Then again, why limit yourself to C, C++, Java, or any version of BASIC if you can choose from literally hundreds of different programming languages with oddball names such as Modula-2, LISP, LOGO, Scheme, Prolog, ICON, APL, COBOL, FORTRAN, Ada, and Perl?
Because programming can often get frustrating and downright troublesome, this chapter also includes resources where you can find additional help from