1. Home
  2. Computing & Technology
  3. Visual Basic
Beyond the Book: Source Code Control
Managing your new solution ...

FilesStep 1 in Chapter 2 shows you how to create the User Interface in a new program. This is the view of the program that someone interacts with to use the program and consists of the form and associated buttons, textboxes, labels and so forth. But in my experience, new programmers have more difficulty managing the files associated with a project.

VB.NET creates a whole new directory structure each time you start a new program and most new programmers end up with a whole hard disk full of them before deciding that it's a good idea to organize their work a little more.

 Join the Discussion
Log into the About VB Forum Here!
 
 Elsewhere on the Web
• Advanced!
Microsoft MSDN on Visual SourceSafe

 


(By the way, it's also worth noting that on page 35, there are actually eight objects in the user interface, not seven as indicated in the table under "Programming Steps". The book doesn't include the Form object in the list! Forms are also very programmable objects in the User Interface and should included as one of the design elements of a project by you, the programmer/analyst/designer.)

Page 36, step 4 is the only instruction in the chapter about the important topic of how to manage your source code: "If you'd like, specify the Browse button to specify the project location." There's more about this in Chapter 3, but since we're creating our first program source code here, I think we should start out right.

Files

One way to do this would be to set up a new folder just for test files and save your program there. In this way, you will be assured that the example program that was copied to your hard drive when you set up the practice files from the CD will be safe. The text suggests naming your project MyLucky7 which will have a similar effect of putting the files in a separate folder (see, for example, the folder screenshot on page 48). This idea is developed a little more in Chapter 3.

Adding a "Test" folder to each project folder in the structure copied from the CD has the advantage of keeping all of your tests separate by program so you always know where something is (and, maybe more importantly, what it is).

Another method might be to establish just one "Test" folder somewhere else on you hard drive. This has the advantage of being a lot less work because you only have to add one folder and to "clean up", you only have to delete one. You can always name the individual folders that Visual Studio will add anyway to keep things straight.

Paying attention to where your source code is saved is a good habit to get into. "Real" programming projects have extensive source code control systems and if you're a programmer on a large project, you'll find that you have to "check out" source code when you work on it and check it in again when you're finished. Often, projects are organized in functional ways such as ...

  • Presentation Layer
  • Business Objects Layer
  • Data Access Layer

Just to illustrate that this problem is taken quite seriously by professional programs, consider that there are quite a number of library systems to help people solve this problem in a "real world" environment. Microsoft supplies a system called Visual SourceSafe in the Enterprise Developer and Enterprise Architect editions of Visual Studio. A popular third party solution is called CodeBox for .NET.

These solutions are wa-a-ay more advanced than we're going to need here, but it's good to look up at the road ahead every now and then just to get an idea of what's coming.

Next page >>>   Writing the Lucky Seven Code > Page 1, 2, 3
Explore Visual Basic
By Category
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic

©2009 About.com, a part of The New York Times Company.

All rights reserved.