Life and Times of Anders Hejlsberg

I think THE person at the top of the technical heroes list has got to be Anders Hejlsberg.

That sentence might seem so obvious it’s not worth stating. True, he is the chief designer and architect of the C# language. But that’s not really why I place him at the top of the list. He is the ultimate software legend (even outshining members of Microsoft’s now defunct “software legends” program). But I suppose, if I had to capture what makes him so great, the word that would come to mind is “wisdom.”

I just ran across a fabulous hour-long retrospective interview of Anders on Channel 9: Life and Times of Anders Hejlsberg. The show, “Behind the Code,” included pointed questions (what about J++?), a walk down memory lane, and an autographed rendition of his favorite data structure. I was absolutely riveted and, like those in the audience, in a state of semi-adoration.

Continue reading

Posted in Technical | Leave a comment

Code Snippets Gone Wild

One of my favorite new features in Visual Studio 2005 is the code snippets technology. Let’s face it. One of the reasons some of us (the names will not be given in order to protect the guilty), used fields instead of properties in our classes because we just didn’t want to type those extra lines of code. I used to use a product called Code Rush with Visual Studio 2003, but it seemed like a lot to learn and sort of seem to get in the way at times.

Visual Studio 2005 comes with a neat feature called “code snippets,” which fills in a section of code for you and lets you modify certain fields by just tabbing through and typing. Take, for example, a foreach loop. When you type foreach in the code editor, you’ll notice a foreach item in the intellisense drop down.

 foreach 1

Continue reading

Posted in Technical | Leave a comment

What’s the Stack? What’s the Heap?

Those are great interview questions. Every developer should know how to answer them, because you can’t write code correctly without understanding the Stack and the Heap, what they do, and how they interrelate.

Am I going to explain it here? I could, but I found a terrific exposition on it. So I’ll just point you there.

C# Heap(ing) Vs Stack(ing) in .NET: Part 1
C# Heap(ing) Vs Stack(ing) in .NET: Part 2
C# Heap(ing) Vs Stack(ing) in .NET: Part 3
C# Heap(ing) Vs Stack(ing) in .NET: Part 4

Continue reading

Posted in Technical | Leave a comment

The Many Uses of "using"

As you probably already know, using directives can save you a lot of typing. Consider the following:

System.Collections.Specialized. NameValueCollection col = new System.Collections.Specialized.NameValueCollection();

By inserting this using directive,

using System.Collections.Specialized;

you can cut it down to this:

NameValueCollection col = new NameValueCollection();

Using “using” to Alias Namespaces

But that’s not all there is to using “using” (pun intended). With using, you can alias both namespaces and types, which is great for distinguishing between two classes with the same name in different namespaces. Say, for example, you have your own Console class, defined within your own namespace:

Continue reading

Posted in Technical | 2 Comments

To Close or Not to Close?

Whether tis better to close a sql connection in a finally block or let it automatically close with a using statement. That is the question.

I was once asked this question in an interview. Will a Sql Server connection automatically close if it is opened in a C# using statement? At the time, I was used to manually closing connections in the finally section of a try / finally block. This ensured that the connection would always be closed, and returned to the connection pool, even if an exception occurred after opening the connection. Here’s an example of that technique.

Continue reading

Posted in Technical | Leave a comment

Installing Components in the Visual Studio Toolbox

Toolbox ComponentsThere are two parts to this story. The first part is deals with how to interact with the Visual Studio development environment programmatically, in order to add a tab to the toolbox and place components on it. That can be accomplished within the confines of a simple Console application. However, in a real-world scenario, you’d want to install your custom components by means of a Setup project with an MSI file, which first installs the components into the Global Assembly Cache (GAC). That’s what the second part of the story is all about: creating a setup and deployment project that first installs the components into the GAC and then uses a custom action with an installer class to create the toolbox tab and place the components onto the tab.

Continue reading

Posted in Technical | 1 Comment

App Settings in Visual Studio 2005

Everyday I’m learning new things about Visual Studio 2005 and version 2.0 of the .Net Framework. Most of the time when I “google” something (I like it when a company name becomes a word in the English language), I can quickly find several examples of what I want to do, and I quickly go about my business. However, now and then, there’s a topic for which I’m not able to find any really good examples. The new application settings feature in Visual Studio is, I believe, a case in point.

In the old days of Visual Studio 2003, there was a nice way to store application settings in a configuration file, so that the application could retrieve those settings at runtime. Someone, usually an administrator, could change the setting in the config file without the developer needing to recompile the application because the settings were contained in a separate file where they were stored as xml. As nice a feature as this was, the implementation in version 1.x of the Framework was someone limited. Mainly lacking was an API for writing settings to the file programmatically, and the settings were valid only for EXE’s and web apps, but not for individual DLL’s.

Continue reading

Posted in Technical | 5 Comments

We’ve Moved!

Today we closed escrow on the sale of our town home in Santa Clarita (Saugus). Two years ago we bought a 3 bedroom, 2 ½ bath unit, in a complex at the corner of Seco Cyn and Copper Hill Rd, with a two-car garage and about 1300 square feet. In spite of the hassles of moving, we decided it was a good time to sell, because it looks like the housing market may finally be peaking. Of course, we thought it had almost peaked 2-3 years ago, but it just kept going higher. But prices have risen to such a level that we’ll soon reach a point – in fact we may already be there – where just a very small minority of households can afford to purchase a home in certain areas of Southern California.

Continue reading

Posted in Personal | 8 Comments

My First Technical Blog: Set Start Page

When I took my first stab at blogging about a year ago, I decided to start two blogs, one personal and the other technical. As a C# programmer I wanted a place where I could write about the technical things I learn on a day-to-day basis. But I could barely, if ever, find the time to maintain a single blog, much less two separate blogs.

Also, I noticed that a great many of the technical blogs I subscribed to contained personal information as well, and that I was sometimes more interested in reading the personal items than the technical ones! When I decided to resurrect my blog, I discovered that I could categorize my postings and place all my geeky musings in their own “Technical” category. So here’s my first technical blog posting.

Continue reading

Posted in Technical | 4 Comments

Tony’s Birthday in Ventura

Thanksgiving Weekend, Nov 26-27, 2005:  We decided to take our very first out-of-town trip as a family. As our destination we selected one of our favorite places: Ventura Beach. It’s only an hour’s drive from Santa Clarita, a straight shot north on highway 126, including a pit stop at one of the fruit stands along the way. It’s also a touristy kind of town with a funky feel and a somewhat genteel homeless population. Ten years ago it’s the place where I taught myself how to program in Microsoft Access, reclining in a comfortable chair in what used to be a wonderful coffee house at Ash Street and Main (it’s now a birthing center!). Check out our Ventura Beach Photos.

Continue reading

Posted in Personal | Leave a comment