Book contents
- Frontmatter
- Contents
- Preface
- 1 Fundamentals of Design and Programming – Starting from Scratch
- 2 Variables and Constants – A Place for Everything and Everything in Its Place
- 3 Writing Programs – First You Walk, Then You Run
- 4 Writing Programs II – More Controls and New Logic
- 5 Using If and Case – Decisions, Decisions, Decisions
- 6 Loops – Once Is Not Enough
- 7 Procedures and Functions – Divide and Conquer
- 8 Writing Programs III – Tying It All Together, So Far
- 9 File I/O – Files and Records and Fields, Oh My!
- 10 Arrays and Structures – Organizing Data
- 11 Events and More Controls – Tips and Tricks for Programming
- 12 Objects and Classes – Objects Are in a Class By Themselves
- 13 Graphics – The Visual (and Audio) Side of Visual Basic
- 14 LINQ to SQL – The World Runs on Databases
- 15 Crystal Reports – Tying Databases to Output
- Appendices
- Index
3 - Writing Programs – First You Walk, Then You Run
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- 1 Fundamentals of Design and Programming – Starting from Scratch
- 2 Variables and Constants – A Place for Everything and Everything in Its Place
- 3 Writing Programs – First You Walk, Then You Run
- 4 Writing Programs II – More Controls and New Logic
- 5 Using If and Case – Decisions, Decisions, Decisions
- 6 Loops – Once Is Not Enough
- 7 Procedures and Functions – Divide and Conquer
- 8 Writing Programs III – Tying It All Together, So Far
- 9 File I/O – Files and Records and Fields, Oh My!
- 10 Arrays and Structures – Organizing Data
- 11 Events and More Controls – Tips and Tricks for Programming
- 12 Objects and Classes – Objects Are in a Class By Themselves
- 13 Graphics – The Visual (and Audio) Side of Visual Basic
- 14 LINQ to SQL – The World Runs on Databases
- 15 Crystal Reports – Tying Databases to Output
- Appendices
- Index
Summary
VB Quip
I really hate this darn machine;
I wish that they would sell it.
It won't do what I want it to,
but only what I tell it.
– Programmer's LamentThink 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…?”
- Type
- Chapter
- Information
- Programming in Visual Basic 2010The Very Beginner's Guide, pp. 68 - 104Publisher: Cambridge University PressPrint publication year: 2010