Turn On All of the Code Settings

The Code Settings on the Editor tab should all be turned on, especially because you are learning (see Figure 2.5). However, you could argue that Require Variable Declaration should be left off because it allows beginners to begin developing without an ounce of knowledge regarding how to use variables While this is true, if Require Variable Declaration is left off, subtle yet serious errors may be introduced that beginning developers are presumably not well equipped to correct or diagnose yet. Because it only takes one ounce of understanding to explicitly declare variables, I believe you are far better off using this feature, and therefore you are able to avoid the most common and frustrating errors that plague beginners who do not explicitly declare variables. You'll see an example of this problem in the next chapter.

Generally the only thing I ever turn off is the Auto Syntax Check option when I am working with a large block of text or code that I know needs editing and I do not want to be bothered with notifications of syntax errors. I'll cover what these functions actually do later in the chapter.

If you are working with other developers, you'll want to be sure that everyone is using the same tab width; otherwise you'll wind up with some terribly aligned code.

Regarding the Window Settings, the Drag-and-Drop Text Editing feature allows you to select segments of text and drag and drop it where you want it. You may find that this feature gets in your way occasionally, causing you to accidentally drag and drop stuff you didn't mean to move.

TIP Rather than Drag-and-Drop Text Editing, I would recommend that you use CTRL+C to copy (CTRL+X to cut) the text selection and CTRL+V to paste it where you want it. After awhile, this will seem like second nature to you and you'll be able to work much faster than you could using Drag-and-Drop Text Editing.

The Procedure Separator is applicable only if you use Default to Full Module View option. The Default to Full Module View option shows all of the procedures in a module, class module, user form, or Excel object in the same window. If you have Procedure Separator turned on, each procedure is separated by a thin line.

Figure 2.5

All of the Code Settings on the Editor tab will be helpful, especially when you are learning.

If you turn off the Default to Full Module View option, procedures in a given component are only displayed one at a time unless you use the split bar (discussed later in the chapter). If you change this option, it does not apply to any open code windows; it only applies to code windows opened after the setting is changed. You choose which procedure is displayed by selecting the procedure from a drop-down list.

I prefer to use the Default to Full Module View option. To me, it visually reinforces the concept that all of the procedures in a given component are related in some way. Also, I believe it is quicker in that you have another way to move to different procedures. You can scroll, select procedures from the drop-down list, or navigate using the keyboard. Additionally, because it is possible to view more than one procedure at a time this way, you won't find yourself flipping back and forth between the procedures as much (provided that the procedures you are looking at are physically close together in the module).

NOTE The General tab of the Options dialog box contains various miscellaneous settings. I'll discuss these settings when I cover the functionality related to each setting later in the book.

0 0

Post a comment