SUMMARY

Subroutines and functions let you break an application into manageable, reusable pieces. A subroutine performs a series of commands. A function performs a series of commands and returns a value.

Property procedures use paired functions and subroutines to provide the appearance of a simple property.

These form the fundamental building blocks of the procedural part of an application. Chapters 22 through 26 explain the other half of an application’s structure: the objects that encapsulate the application’s behavior. Together, the program’s objects and its procedural subroutines and functions define the application.

This chapter explained how to break an otherwise unwieldy expanse of code into subroutines and functions of manageable size. It also explained techniques related to subroutines and functions, such as extension methods and relaxed delegates, that let you use existing classes and events in new ways.

This chapter also explained three ways you can execute pieces of code simultaneously on different threads of execution. If your computer has multiple cores or CPUs, that may allow you to greatly improve performance.

The chapters so far have not explained how to write anything other than straight-line code that executes one statement after another with no deviation. Most programs need to follow more complex paths of execution, performing some statements only under certain conditions and repeating others many times. Chapter 17, “Program Control Statements,” describes the ...

Get Visual Basic 2012 Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.