Bill Blogs in C#

Bill Wagner discusses C#, LINQ, and other items of interest

May 2007 - Posts

ftponline: Building adapters for reuse

My May column for Visual Studio Magazine is live.

Here's the intro:

You can save space and even time by compressing your persistent data store. The interesting trick is to provide this functionality by adapting your current algorithms, rather than completely replacing them.

This article shows you how to build algorithms that make use of anonymous delegates to build libraries that clients can customize by passing code as parameters. Anonymous delegates provide a smple way to pass code to the methods in your library. It's a useful arrow to have in your quiver.



Posted by wwagner | with no comments
Filed under:
Peter Ritchie posted an alternative strategy

Peter Ritchie wrote a post here on chaining constructors.

His recommendation is:

Polymorphic constructors should be called from most specific to least specific.

He makes some good points about that, but I do disagree. I agree with the idea of using accumulative construction, or, as I called it, constructor chaining. That's the subject of Item 14 in Effective C#. All my examples in that item took the opposite approach to Peter: I chained the constructors from the least specific to the most specific. 

After looking at both versions, I think it's a matter of style. The only advantage of chaining from least specific to most specific is that it puts all the initialization logic in one place: the most specific constructor. I believe that will make it more maintainable over time, but I can't point to any particular reason for it.



Posted by wwagner | with no comments
Filed under:
I'll be presenting on the next version of Visual Studio this Friday
OK, the subject says most everything. DevCares is in Southfield, MI this Friday afternoon. I'll be speaking on the enhancements in Visual Studio Orcas, due out toward the end of this year.  It's going to cover LINQ, IDE enhancements, other library enhancements, and other new features available for developers when Orcas ships.

Posted by wwagner | with no comments
Do you have what it takes?

We (SRT Solutions) have three open long-term (6 month) consulting positions.

They are open, in part, because we are very particular about the caliber of people we have representing us with customers.  We want, or even need, the best technology people in Michigan. Period. That's because our consultants need the following skills:

1. They need to be able to create software that changes the game. We haven't built our business by doing the easy things faster and cheaper than other companies. We built our businesss by solving problems that stump our competitors.

2. They need to be able to explain what they've built to our customers.  One of our major functions is to facilitate the growth of our customers' development staff. We need to show the customer's team members what we built, why it was built that way, and how they can use the same techniques in the future.

3. They need to be willing and able to stay at the forefront of technology.  Right now, we're looking for C# and ASP.NET skills.  Soon, it may be Ajax and Silverlight. LINQ is just around the corner.  Our consultants need to know those tools before our customers ask about them. Does constantly learning new skills excite you?  Then we're a good fit. Does it scare you? Then we're not the right company for you.

Do you have what it takes?  We're looking for top talent, with at least a B.S. in Computer Science, or similar discipline. And, you must have 3- 5 years .NET experience, and 4-7 years industry experience.

If you are interested in this challenge, and have the requisite experience, send me a resume:  resumes@srtsolutions.com



Posted by wwagner | with no comments
Filed under:
it's living outside of a VPC, and generally happy

Unless you've been living under a rock, you know that the Orcas Beta 1 was released a couple weeks ago.  I installed it on a VPC immediately, just because that was safe.

It worked fine, especially thanks to some work from Charlie Calvert to update the LINQ samples for each public release. 

But, I had carrying around an extra hard drive. I hate the performance penalty of using a VPC. I find that exiting VPC before I put my laptop in standby another annoyance.

Don't get me wrong: I'm addicted to VPC, and how it gives me more freedom to work with bleeding edge software, without worrying that I'm buying a future task of repaving my production machine and reinstalling every piece of software I use.

But I also look forward to the day when I can take a shiny new beta release and put it on real live hardware, not in a virtual sandbox.

For me, that day came last week for Orcas Beta 1. I installed it on real live hardware last week   It's on my laptop, side-by-side with Visual Studio 2005.

By and large the experience has been great: There have been no side effects on (most of) my VS 2005 applications. I also converted a number of C# 2.0 applications and they ran fine.

I can also run VS 2005 without issue, so that's good too. And, just to ensure it worked, I uninstalled Orcas, repaired VS.NET 2005, and went on with no ill effects. That's critical for me, and it worked quite well.

Of course, if it was perfect, it would be a release and not a beta, so there are a few warts you need to know about.

First, side-by-side installation has issues with IIS and Vista, at least for me. All websites started using .NET 3.5, despite running AppCmd to point them at ASP.NET 2.0. In many cases, this is good, because I know my web apps run under 3.5. They still use the C# 2.0 compiler, unless you change provideroption setting in your web.config as follows:

<providerOption name="CompilerVersion" value="v3.5"/>

At any rate, what this means is that any 2.x web application you are running will fail if they using any BCL functionality affected by a breaking change in ASP.NET V.Orcas. (No, I don't have an exhaustive list of those. It's too early, and it will probably change anyway).

Second, there are still some problems running SQL Server on Vista, expecially with user instance databases when you are not running with elevated privileges. (I do have UAC turned on, so that may be part of the factor).

But, as I said at the top, it's a beta. I didn't expect to write that it's perfect, but I'm happy to say that it works well, and doesn't interfere with my production environment (at least not too much).

So, should you take this plunge?  Well, it depends on your interest and your risk tolerance. I do have one machine that is 'orcas free', for production testing. But, I spend quite a bit of time in Orcas doing research and forward looking work. so it's worth it to me to have a real live hardware based Orcas release to work with.



Posted by wwagner | with no comments
Filed under: ,
I am writing for Visual Studio Magazine again

The first installment of my C# Corner column is live on the Visual Studio Magazine site:

Generics: Move Beyond Collections

Generics can solve many more problems than collections. Use generics to write code once and reuse it more easily.

It's available both online and in print.



Article: Generics: Move Beyond Collections
Generics can solve many more problems than collections. Use generics to write code once and reuse it more easily.
Posted by wwagner | with no comments
Filed under: