To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
The function of good software is to make the complex appear to be simple.
– Grady Booch
Good software does just that. It's easy to use, “intuitive” is the buzzword used in the industry. It does what it should and people actually like using it. Developers must keep two things in mind: getting the program to do what it should and making it useable – the two go hand-in-hand. A cool interface means nothing if the software doesn't perform. And, no matter how solid the code is, a clunky program is nearly worthless. Always think of both form and function. On the one hand, a developer must write code that works. On the other, a developer must always consider the end user. Never forget, you can't have one without the other!
New Events
You're familiar with several events such as Click, Load, and Scroll, but there are more, many more. In fact, there are far too many to cover in anything short of the dreaded user's manual. Every event can trigger code and every user action raises an event, that is, every time the user does something, from a click of the mouse to a peck of a key, a program can respond. How it responds and what it does are key to good software.
KeyPress
When a key is pressed, it generates a KeyPress event and also several other key events.
[By the end of the 20th Century there will be a generation] to whom it will not be injurious to read a dozen quire of newspapers daily, to be constantly called to the telephone [and] to live half their time in a railway carriage or in a flying machine.
– Max Nordau in 1895
So far you have seen how a sequence of steps lets you build a program that will do your bidding. You've seen how decision structures give the computer the ability to make decisions. You've learned how to get the computer to repeat instructions, giving it the ability to do the same task over and over. And, you've taught it how to read and write. Well, it can't read and write, but it can access and store data in a file. All of these give the computer the ability to access and process data at remarkable speed. But, you've been limited to only a handful of names and numbers – only what you could hold in your hand and keep track of in your head. You've been forced to discard one thing in order to grab the next. It's as if the world was a full-screen movie and you're stuck looking at stills in the family photo album. Enter arrays. With an array you can grab an armful of data and process it as you wish. Instead of stills on Grandma's porch, you've got a DVD on HD and control of the remote.
It claims to be fully automatic, but actually you have to push this little button here.
–Gentleman John Killian
The more work you put into your programs, the less work they'll be for the user. A developer might not like that, but a good program might be used hundreds or thousands of times by millions of users. If you make it just a little easier for every one of them every time they use it – well, you get the idea. Your programs aren't quite there yet, but the basic principles are the same. Just develop an interface with the user in mind and spend a little more time getting the details right. The interface takes care of input and output and the developer worries about the details to handle the processing that comes in between. Good programs are fun and easy to use. They allow the user to concentrate on solving a problem rather than forcing them to figure out how to use the computer.
This chapter introduces new tools. Most of them make it easier for the user and more complicated for the developer. There are also a few other odds and ends to clean up your output.
RadioButtons
RadioButtons are used to select one option from a list of several options. Click on a RadioButton to select it. A black dot appears inside the circle to indicate it's selected. Click on another RadioButton to select it and deselect the original.
Who cares how it works, just as long as it gives the right answer?
–Jeff Scholnik
That's a rather cavalier approach for anyone to take, especially when computers are involved. Knowledge is power and the more you know, the greater your power. One book isn't enough to give you all-consuming power, especially over a tool as powerful as a computer. It is, however, enough to get you started. One book won't turn you into a nerd that looks at his own shoes when talking, lives on caffeine and stale snack cakes, and would rather hack on a computer than go out on a date. That's just a stereotype perpetuated by teen movies. While it does fit a few people, almost all of the ones I know are smart, articulate, funny, and just all-around bright and inquisitive people. Above all, they're curious. And the best are curious about nearly everything, not just computers. How does it work? What happens when I try this? What if…?
Programming is, above all else, about thinking and problem-solving. If for no other reason, it's useful because it makes you think about thinking and makes you describe how to solve a problem. For the computer to solve a problem, even simple tasks must be explained in great detail. For someone to explain the rules to a computer – in other words, to write a program – takes a great deal of thinking and understanding.
All programmers are optimists. Perhaps this modern sorcery especially attracts those who believe in happy endings and fairy godmothers. Perhaps the hundreds of nitty frustrations drive away all but those who habitually focus on the end goal.
Perhaps it is merely that computers are young, programmers are younger, and the young are always optimists. But however the selection process works, the result is indisputable: “This time it will surely run” or “I just found the last bug.”
–Fred Brooks
Programming is all about making the user happy. As a developer, your mission is to produce a product that fulfills a need for the user and makes them want to use your program. The easier you can make their computing experience, the better. That's a double-edged sword. Often, it's easier to make a program work than it is to keep the user happy. And, the more you try to please the ubiquitous end user, the harder it is for you as a developer. It's often said, “This whole software development thing would be a whole lot easier if it wasn't for all those end users.” While that may seem true, the computer industry wouldn't be where it is today without end users. They buy programs to make their work faster and easier and their fun more enjoyable. They're demanding, fussy, stubborn, and every year they spend billions on what works.
This chapter expands your knowledge of variables and their use. You'll get a taste of methods.
Think of a program as a play and you're the director. The actors are the controls and the code is your script. It's up to you to bring all of them together to make it work. Most actors can get the words right and learn to hit their marks, but there's far more to it than just memorizing lines and taking cues. As a developer you have to make your program – your play – flow and get all the parts to work together.
Most programs follow the same general path: declarations, input, processing, and output. That helps, but the hard part is getting a human to understand how the computer works. Usually, this understanding comes only from practice. To become a good programmer, you must write programs. To write good programs, you often must write lots of code. And the more code you write, the more mistakes you'll make. Mistakes are a good thing, though. Often, especially in programming, mistakes are a great way to learn. Just like a good director needs to rehearse lots of scenes and try them in many ways, a programmer has to learn what works and what doesn't. In programming, mistakes can be your ally. “OK, this worked, but what if I try this?” “What happens if…?”
I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone.
–Bjarne Stroustrup
Life is filled with repetition. And every once in a while it throws you for a loop. Every day and every week has a routine. For example, chores are a series of often mundane tasks that get repeated time and again. Make your bed, take out the garbage, walk the dog, do the dishes. That's why they're chores. You've probably reduced these tasks to a series of steps and then repeated them as needed. Business is much the same. The steps to calculate the weekly pay are pretty much the same for every employee. So is the process for calculating a bill or determining a student's grade. Once you know the proper steps for a process, it's easy to repeat them. However, if you can get the computer to do these tasks, it will be much faster and cheaper. And, it would free you to do more pleasant and important tasks.
Until now, the only way for the computer to repeat these tasks was by clicking on a Button over and over. That's slow and hard and boring. This chapter covers repetition structures – in programming parlance, loops. With them, a series of commands can be repeated. Some loops run a specified number of times.
The best thing about a Boolean is even if you are wrong, you are only off by a bit.
– Anonymous
What Are Decision Structures?
Decision structures give the computer a brain. Sort of. So far, every program has followed a sequence of commands. Every command has executed, in order, when needed. That's great if you're riding the kiddie cars at the carnival, but you want some real power and the ability to make your own decisions. Think open road, the wind in your face, and the power to take whatever road suits your fancy. That's where If and Case statements come in. Quite literally you'll be able to pick one path or the other with an If statement. With a Case statement, you'll be able to choose one path from many. Are you hungry? Do you need gas? Then stop. It's your decision. Without them, you're merely a passenger on the bus and someone else makes all the decisions. With them, you turn the computer from a calculator that can only solve one problem into a thinking machine that can make decisions for various outcomes based on the input provided and the directions given to it by the developer. In short, you're on your way to teaching the computer how to think.
If…Then…Else Structures
Decision structures give the computer multiple blocks of code and the ability to select the block of code to execute.
This book is written for the newbie. It's not for those who already know programming. If you know the basics of the computer, like word processing, spreadsheets, email, and surfing, then you're ready to go.
What's Included?
This book covers the basics, like variable and assignment statements. It explains programming sequence, selection, and repetition structures – fundamentals to the design of any good program. It explains controls and their uses, the basic tools for designing your interface. Procedures and functions are covered, which are the basic building blocks of larger programs. File input and output (I/O) is introduced. Good programs run on data and I/O is how data get into and out of the computer. From there, arrays are introduced and used to implement more complicated programming logic including control breaks, sorting, and searching. Events make things happen in a program and one chapter is dedicated to events, including drag and drop. Objects are introduced and an understanding of them is crucial for successful developers. For a little fun, there's a chapter on graphics and sound, but you'll need a good foundation in programming sequence, logic, and repetition to get the most from it. The world runs on databases and the last two chapters cover the basics of databases, including an introduction to LINQ to SQL and Crystal Reports. LINQ connects programs to databases. SQL (Structured Query Language) is designed to find, update, and report data, and Crystal Reports is designed for data presentation.
Man is still the most extraordinary computer of all.
– John F. Kennedy
The world runs on databases. Data of all kinds are tracked and stored, managed, massaged, manipulated, and, sometimes mangled. You got of taste of that in the last chapter. You even saw a little of it with control breaks back in Chapter 9. A report is the key tool for managing data. With a report, data become information, a list of numbers becomes a total or an average, and meaningless figures become a report, complete with a colored chart. Crystal Reports is a full-featured database reporting tool from Business Objects®. It crunches the numbers and produces printable reports. It's one of literally hundreds of third-party add-ons for Visual Studio. It handles data from almost any database and integrates it into reports.
VB Tip
Crystal Reports works with the Professional version of Visual Studio. It will not work with the Express Edition. A thirty-day free trial of Crystal Reports is available from SAP at http://www.sap.com/solutions/sapbusinessobjects/index.epx
Crystal Reports Tutorial
VB Tip
Place the database files in a folder on your hard drive called C:\CRFiles. That makes your reports easily portable.
Be sure to use the Professional version of Visual Studio and have either the trial version or the full version of Crystal Reports installed on your system. Make sure the TouristStops.mdb database is in the C:\CRFiles folder on your system. TouristStops is an Access database that contains information on vacation spots throughout the United States.
Various problems in computer science are 'hard', that is NP-complete, and so not realistically computable; thus in order to solve them they have to be approximated. This book is a survey of the basic techniques for approximating combinatorial problems using parallel algorithms. Its core is a collection of techniques that can be used to provide parallel approximations for a wide range of problems (for example, flows, coverings, matchings, travelling salesman problems, graphs), but in order to make the book reasonably self-contained, the authors provide an introductory chapter containing the basic definitions and results. A final chapter deals with problems that cannot be approximated, and the book is ended by an appendix that gives a convenient summary of the problems described in the book. This is an up-to-date reference for research workers in the area of algorithms, but it can also be used for graduate courses in the subject.
This book is a complete account of the predicate transformation calculus semantics of sequential programs, including repetitions, recursive procedures, computational induction and unbounded nondeterminacy. Predicate transformation semantics are the best specification method for the development of correct and well-structured computer programs. The author develops this theory to a greater depth than has been achieved before, and describes it in a way that makes it readily compatible with programming rules for partial and total correctness of repetitions and recursive procedures, supplies new rules for proving incorrectness, and a stronger rule for proving that two programs satisfy the same specifications. Finally, the semantics are extended so that non-terminating programs can be specified as well. This will be essential reading for all computer scientists working in specification and verification of programs.
Scott Ambler, award-winning author of Building Object Applications that Work, Process Patterns, and More Process Patterns, has revised his acclaimed first book, The Object Primer. Long prized in its original edition by both students and professionals as the best introduction to object-oriented technology, this book has all modeling notation rewritten in UML 2.0. All chapters have been revised to take advantage of Agile Modeling (AM), which is presented in the new chapter 2 along with other important modeling techniques. Review questions at the end of each chapter allow readers to test their newly acquired knowledge. In addition, the author takes time to reflect on the lessons learned over the past few years by discussing the proven benefits and drawbacks of the technology. This is the perfect book for any software development professional or student seeking an introduction to the concepts and terminology of object technology.
This book teaches model-based analysis and model-based testing, with important new ways to write and analyze software specifications and designs, generate test cases, and check the results of test runs. These methods increase the automation in each of these steps, making them more timely, more thorough, and more effective. Using a familiar programming language, testers and analysts will learn to write models that describe how a program is supposed to behave. The authors work through several realistic case studies in depth and detail, using a toolkit built on the C# language and the .NET framework. Readers can also apply the methods in analyzing and testing systems in many other languages and frameworks. Intended for professional software developers including testers, and for university students, this book is suitable for courses on software engineering, testing, specification, or applications of formal methods.
The fundamental ideas concerning computation and recursion naturally find their place at the interface between logic and theoretical computer science. The contributions in this book, by leaders in the field, provide a picture of current ideas and methods in the ongoing investigations into the pure mathematical foundations of computability theory. The topics range over computable functions, enumerable sets, degree structures, complexity, subrecursiveness, domains and inductive inference. A number of the articles contain introductory and background material which it is hoped will make this volume an invaluable resource.
Almost all of the problems studied in this book are motivated by an overriding foundational question: What are the appropriate axioms for mathematics? Through a series of case studies, these axioms are examined to prove particular theorems in core mathematical areas such as algebra, analysis, and topology, focusing on the language of second-order arithmetic, the weakest language rich enough to express and develop the bulk of mathematics. In many cases, if a mathematical theorem is proved from appropriately weak set existence axioms, then the axioms will be logically equivalent to the theorem. Furthermore, only a few specific set existence axioms arise repeatedly in this context, which in turn correspond to classical foundational programs. This is the theme of reverse mathematics, which dominates the first half of the book. The second part focuses on models of these and other subsystems of second-order arithmetic.
Linear logic, introduced in 1986 by J.-Y. Girard, is based upon a fine grain analysis of the main proof-theoretical notions of logic. The subject develops along the lines of denotational semantics, proof nets and the geometry of interaction. Its basic dynamical nature has attracted computer scientists, and various promising connections have been made in the areas of optimal program execution, interaction nets and knowledge representation. This book is the refereed proceedings of the first international meeting on linear logic held at Cornell University, in June 1993. Survey papers devoted to specific areas of linear logic, as well as an extensive general introduction to the subject by J.-Y. Girard, have been added, so as to make this book a valuable tool both for the beginner and for the advanced researcher.