Saturday, February 6, 2010

Microsoft Visual Studio, take two

After a difficult time with the CD install, I tried the web install. I had more success with this version.

My complaints with the CD install I think are with the WinRAR utility and not the Visual Studio package. So I will state here: I find the WinRAR package difficult to use. It's dialog with the user is technical and while accurate it is not understandable.

Installation of MS Visual Studio from the web works well. Its one flaw is the download time. The initial screens load quickly. Once loaded, I picked the options I needed and then the long download began. Microsoft does a fairly decent job of showing the status of the download, listing the different components and the status of each.

The download took roughly eight hours. I have a 80 KBps DSL connection, which isn't the fastest but also isn't the slowest. For a single PC, this solution is acceptable; I would not want to use this method on multiple PCs. (For multiple PCs, Microsoft would probably recommend the "download to CD and then install" method, which is how I got the (broken) install CDs.)

Part of the eight hours was a power-down from Windows 7. Windows 7, like Windows Vista, enhances the screen saver by powering off your PC after a period of inactivity. This occurred while I was downloading Visual Studio. (I had left for some lunch.) There is a way to adjust the power-down delays, and even turn them off. Windows 7 has a setting for it. I know, because I found it once! But I haven't seen it again.

Moving on to Visual Studio: Once installed, I loaded several VS2008 projects and converted them. I had about thirty projects, and found myself wanting a batch converter. (Is there one?) They all converted and loaded without difficulties.

I compiled my projects, first in the IDE one at a time. Visual Studio 2010 has a nice new skin for its controls but the core seems unchanged. The compiler has the same problem of generating precompiled header files that was in VS2008. (The message is different, though, and suggests that you re-compile. Re-compiling sometimes fixes the problem. Other times you must delete the old .PCH file.)

At this point, I cannot compare compiler performance, since I am using a different PC for VS2010. I need to do a little more work compiling projects, then adjust my batch files for running the compiler without the IDE (the batch file builds all of my projects and runs tests on them) and then I can dig into debugging and editing.

My current impression is that VS2010 is a re-warming of VS2008, with prettier dialogs and frames but not much more. But perhaps the improvements are in other areas, like connections to MS-Office applications or development of Silverlight applications. (Oh, yes, the Silverlight component installed but complained about running out of logfile space. I'm not sure if that is a problem or not.)


Friday, February 5, 2010

Visual Studio 2010 beta 2

With the impending snow, I'm working at home this morning. The folks in the office arranged for a test of Visual Studio 2010, and I can install it on my home Windows PC. (It runs Windows 7RC, not Windows XP, but the Visual Studio experience should be the same.)

I cannot comment on Visual Studio 2010, as I have been unable to complete the install. I'm a bit disappointed with it (the install program). The package is so large that it requires four CDs. That is not unusual with today's software. What I find disappointing is the user interface for the multi-CD unpacking operation.

Gone is the traditional SETUP.EXE program, or even the newer .MSI file. Instead the CDs contain .part1 and .rar files, and its not clear what I should do with them. Gone also is the "start on load" function; after inserting the first CD, Windows popped up a small dialog asking me what it should do with the new-found media and offering only the choice of opening Windows Explorer.

Double-clicking on the first CD's only file starts what appears to be a "combine and unpack" program. It asked me for a destination directory, but the messages are unclear as to the nature of this directory. Is it the permanent location of the program files, or is it a temporary holding place? I assume the latter and pick a convenient directory. (The program defaults to the CD-ROM drive, which seems a silly default.)

As the "combine and unpack" program needs another CD, it pops up a dialog and demands the CD. But the message is not the traditional "Please insert disk N"; it is a more cryptic "You need to have the following volume to continue" with the name of the file on CD 2, although you don't know that.

And there is no "Eject" button on the dialog. (A minor complaint, but a feature I have gotten used to on SuSE Linux install packages.)

Now, after two successful CDs, the install program complains about CD number 3. It reports that the wrong media has been installed. It gives me one choice: to close the program. There was a short time when Windows was "checking for a solution" but that process seems to have stopped with no results. A second attempt at the install yields identical results.

So far, my impression of the install program is that it has been hacked together with available utilities, not written as a professional program. I would expect this of a program for release within Microsoft, not to the public. (Not even for a beta 2 release, which should be pretty close to the "real deal".)

Friday, January 22, 2010

Solving problems -- with help

I solved the link problem of yesterday. To do it, I needed some help. Not from other people, but from tools and techniques. Here's what I used:

- Version control. I used version control to track changes as I investigated the problem.
- diff and visual diff. With one working project and one failing project, I could compare the two and identify the differences.
- Automated tests. Once I made changes (and got things working), I ran the tests to ensure that the programs were working as I expected.

I could have solved the problem without these. But I feel much better with these tools and techniques. I have a higher degree of confidence that I have solved the problem and not introduced other problems.

Automated testing was useful later in the day, as I worked on a different problem. This task was to extend one of a series of programs. They use some common libraries, and I had to make changes to the libraries. How to ensure that all programs work after the change? Run the tests! I finished my changes at the end of the work day (a little later, actually), and I ran the tests, looked at the results, and knew I was finished. I left the office with a good feeling.


Thursday, January 21, 2010

Back to tech

Frustration today.

I have two C++ projects in Visual Studio 2008. They both use a library to read and parse files. (The library is an in-house library, so we have source code and can modify it.)

One project compiles, links, and runs. (And works!)

The other project compiles... but does not link. Visual Studio complains about previously defined globals.

The one difference between the two projects is their source. One was originally built with Visual Studio 6 and converted to version 2008. The other was created in VS 2008. The one that works is the converted one.

I've looked at the project files (which VS 2008 conveniently keeps in XML) and can see no significant differences. I've tried various tricks to get the project to compile, to no avail.

Well, at least I know what I will be doing tomorrow!


Wednesday, January 20, 2010

Sometimes the job is more than programming

The team has been working long hours these past few weeks. The extra effort has been taking its toll. People are a little on edge, a little less patient.

I've been helping by listening. I am a neutral party, for a number of reasons. (I'm the "new guy", I'm a programmer and not an economist, and I'm a bit older than most folks.)

A group of us went out to lunch today. It was a "deli run": go out, get some sandwiches, and head back. The group was heading to the food court, but one person wasn't happy with that choice. I accompanied them to a local pizza place, letting the other folks head to the food court. It gave the one person an opportunity to vent. It was mild venting, but probably needed.

My job is to be part of the team, not simply a "hired gun" specialist. I think I achieved that today.


Sunday, January 17, 2010

Back and forth on typedefs

A post about technical issues today.

I've been working with C++ and STL. While C++ is an old friend (dating back to 1997), STL is new to me. Yet it's not that big of a challenge. (Perhaps my experience with Perl and Ruby help me understand the goals of STL.)

One technique that I have been using is typedefs for STL types. STL has a syntax that leads to long type descriptions. For example, a simple list of strings might be:

std::vector<std::string>

and a hashmap with string keys and string values would be:

std::map<std::string, std::string>

Those are readable. Things get messy when the value for a hashmap is another type, such as a list of strings. Then you have:

std::map<std::string, std::vector<std::string>>

By itself, that's not bad. But you use this type in a number of constructs. It requires a lot of typing (or copying and pasting) and the elegant programmer in me winces at hard-coding the type throughout the program.  I fear a change in the data structure will require a lot of hunting for the references to the type, replacing the old type with the new.

The answer, in C++, is typedef. The typedef keyword lets you create your own tag for a type. So with

typedef std::mapstd::string, std::vector<std::string>> Map_Name_Entries;

You can create a simple-to-type name for your new type. In this case, "Map_Name_Entries". In addition to a shorter name, you get a descriptive name, one that can convey meaning to the programmer. (Me, or anyone else working on the code.)

At first, I was typedef-happy, using typedefs for all of my STL types.

Then I found that there were two classes of STL types. One class was generic, such as a list of strings. The other class was specific, with complex structures. The generic types had generic names; the complex types had specific names. In some cases, multiple complex types had the same structure but different names, since I used them in different contexts and for different purposes.

I changed my code and removed the typedefs. At first, I removed all of them. I found that using the raw STL syntax for the generic types made the code easier to understand. I also found that the raw STL for complex types was hard to understand.

So at this point, I have re-introduced the typedefs for complex types. My rules to divide simple and complex are unpublished and unvoiced. The decision to use the raw syntax or to use a typedef is more art than science, more emotional than rational. Yet they work, at least for me.


Thursday, January 14, 2010

Always try something new

I attended the CALUG meeting last night. That is not new; I've been attending them (on and off) for about a year.

What was new is my route to them. Working in WAS and taking the train home means that I get home too late to drive to the meeting. (And I have to drive; they are outside of transit range.) Instead of coming all the way home and driving all the way there -- which involves some back-tracking -- I drove to a train station in the morning and then got off the home-bound train "early" and drive to the meeting.

This works because the meeting is located between BAL and WAS, and driving to a different train station positions me better in the evening. This trick does not work for the BaltoLUG meetings, which are north of BAL and not "on the way". I get no savings for those meetings.

The important thing here is to try something new. Step outside the box.

Or wait for the "Yellow line" to be extended to Columbia, which will let me attend CALUG meetings without driving. But that's several years away.