Using
relaxed delegates allows you to omit arguments from event handlers. For example, the following
code statements are now valid in VB:
Sub OnClick(sender As Object, e As Object) Handles aButton.Click
Sub OnClick Handles aButton.Click
Option Infer
Using Option Infer lets you specify whether VB should enforce type declarations for your types.
While setting Option Infer On may allow for quicker development, it may lead to maintenance
challenges down the road.
Option Infer On is the default setting for new projects in VB 2008 and can be changed via
Project Properties ?¤ Compile.
Summary
In this chapter, we??™ve touched upon the high-level characteristics of programs written in
VB 2008. That is, all code is compiled into IL rather than the native instructions for a specific
platform. Additionally, the CLR implements a garbage collection system to manage raw memory
allocation and de-allocation, freeing you from having to worry about one of the most
common errors in software development: improper memory management.
Next, we explored the CTS with a couple of simple examples to compare value types to
reference types. Our first VB program gave us a simple class with a Main procedure, which
simply echoed ???Hello World!??? to the Command Prompt.
Pages:
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53