0 Comments

Coming from the Visual Basic world, I used to find many examples throughout the web written in VB and VB.NET. Then I got hired by Traceworks which was a VB.NET company, but they decided to move to C# because they couldn’t find employees that wanted to code VB.NET. So, I made the switch and haven’t looked back since. I haven’t written one line of VB.NET code for 2½ years.

In the beginning when I searched Google for some CLR specific stuff, it was very often that the code examples were in VB.NET. I had no problem translating them to C# so I didn’t care. As the time passed, more and more I saw that C# code was taking over the VB.NET examples throughout the web. Today, they do almost not exist unless you deliberately go to specific VB.NET sites like VB.NET Heaven.

Also, when you look at the job sections they are all about C#. It seems that VB has been replaced in the enterprises since companies are only looking for C# developers. There could be some differences from country to country – I haven’t checked them all…

If we are to believe that VB.NET is leaving the enterprises, where does it exist then? I keep seeing Channel 9 shows about the next releases of VB.NET and read some Microsoft blogs about it, but there really is no big hype in the blogosphere. No one writes about it on the web except for the Microsoft folk.

Do you know what became of VB.NET?

0 Comments

I was just reading Daniel’s blog (in Danish) and saw that he had been taking a what-type-of-developer-are-you test. So I took the test and this is the result. It turns out that I’m a PHTC type.

PHTC

You're a Planner.
You may be slow, but you'll usually find the best solution. If something's worth doing, it's worth doing right.

You like coding at a High level.
The world is made up of objects and components, you should create your programs in the same way.

You work best in a Team.
A good group is better than the sum of it's parts. The only thing better than a genius programmer is a cohesive group of genius programmers.

You are a Conservative programmer.
The less code you write, the less chance there is of it containing a bug. You write short and to the point code that gets the job done efficiently.

Take the test here.

I really don't like that the C stands for conservative. Pragmatic would be a better fit.

Perspective

I’m not sure how scientific the test is, but it raises a good question about the people you hire to work for or with you. Often you go through some kind of personality test at the first job interview, but they don’t cover how you code. To have a dynamic team you need to have different kinds of developers. You need the thinkers, the coders, the architects, the managers etc.

This is the first test I’ve seen that tries to label the different types of developers. It would be great to see a real scientific one that covers it all. That would make a huge difference in the people you would hire in order to create the ultimate dynamic team.

0 Comments

Tonight is the first night without my TV. Yep, it’s gone. I gave my Philips 32” widescreen away for free yesterday and tonight reality kicks in. I start to wonder if it is possible to live without a TV while sitting here on my couch writing this. It’s sooooo quite.

Information overload

Everyday I read 10 RSS feeds, read 2 online newspapers, follow tech stuff on 5 websites and watch the news on TV in the morning and at night. That covers the basic information, but then there are all the work related websites I find on Google each and every day. They vary from 3 to 50 depending on what problem I’m trying to solve.

E-mail from various people – work related, BlogEngine.NET related or from friends and family. Then add the text messages and phone calls combined with Skype and instant messaging.

I’m getting stress just thinking about all that information I need to process every day.

Out with the TV

The TV was the least important information channel, so I just thought it was the easiest to get rid of. I can’t get rid of my phone, e-mail or instant messaging because I use those at work. The RSS takes no time and I need to follow the tech stuff to keep up with the business.

After taking the decision I borrowed and bought some books just to make sure I wouldn’t get too bored.

New toys

We geeks need our gadgets and without the TV, something needs to take its place. Otherwise I’m down a gadget and that’s just wrong. I’ve set my mind on a Windows Home Server for my home network, but I’m not sure it has been released yet. It probably will very soon. Also, I would need a digital wi-fi radio to play my MP3’s. That should be enough to keep my gadget-meter point the right direction – up, up, up!

It’s still strangely quite here on the couch or should I say nice and peaceful…

0 Comments
Some web applications need to impersonate a user account for one reason or another. This is done from web.config and could look like this:

<identity impersonate="true" />

Threading


The impersonation works fine, but if you create new threads manually you would lose the impersonation if you don’t move it along to the new thread. This gave me a severe headache before I figured out how to pass the impersonation to the newly created thread.  

What you need to do, is to pass the WindowsIdentity object to the new thread and from there impersonate again manually.  Here is an example of how to do it using the ThreadPool:

public void StartAsyncCall()
{
  System.Security.Principal.WindowsIdentity identity = System.Security.Principal.WindowsIdentity.GetCurrent();
  ThreadPool.QueueUserWorkItem(RunAsyncCall, identity);
}

private void RunAsyncCall(object stateInfo)
{
  System.Security.Principal.WindowsIdentity identity = (System.Security.Principal.WindowsIdentity)stateInfo;
  identity.Impersonate();

  DoSomething();
}

As you can see, it is pretty simple once you know how.

8 Comments

ASP.NET has an outgoing connection limit which is set to 2 connections by default. It means that the ASP.NET process does not create more than 2 concurrent connections simultaneously, but instead queues them up.

Consider the scenario where you call 4 web services asynchronously from the same method. What happens is that the first two starts to execute, while the next two waits for the first two to finish. The same thing happens for HttpRequests.

That is a waste of time in most cases, so you can raise the connection limit to allow more simultaneous reqests in the web.config.

<system.net>
  <connectionManagement>
     <add address="*" maxconnection="8"/>
  </connectionManagement>
</system.net>

Every asynchronous request is started in its own thread, so you have to be careful not to raise the limit too far. The more CPU’s or cores the web server have, the higher can you set the connection limit.

You can read more about asynchronous requests and the connection limit on MSDN.