Hold on sugar!

Mahed Chand blogged about why he thinks developers should choose C# over VB.Net here. I commented on his blog and am hereby repeating my response here.

I’ll cut to the chase. I strongly disagree. I have nothing against C# but VB is still the language of choice.

Here is what I think;

  1. If you are migrating from VB, then migrate to VB.Net. You’re still gonna have to learn a lot, but the syntax is still 70% the same. Unlike C# where the syntax is 90% different.
  2. The VB developer environment is at least twice as productive as that of C#. A bit more verbose, but still more productive.
  3. Compiled VB code is smaller than that of C# (even though by a very small margin).
  4. Where I live, VB developers average salary is MUCH higher than that of the C# counterpart.
  5. Both VB and C# can do 99% of what the other can do.
  6. In Orcas (the new Visual Studio from Microsoft, set to be released later this year) VB.Net supports a wider range of Lambda expressions.
  7. More people have downloaded the Express edition of VB than C# (Source: Microsoft at MVP Global Summit).
  8. Your sister site is VB .Net Heaven 🙂

Enjoy!

Links
http://www.c-sharpcorner.com/Blogs/BlogDetail.aspx?BlogId=151

My.Settings

Back in the VB6 days, when creating applications that required specific settings unique to a particular machine (such as screen sizes, fonts or even connection strings), I used to use either an INI file or the registry for storing these settings.

A few days ago, when writing an application on .Net v2, I needed to store similar settings and it had me thinking; should I use an INI file, the registry or even an XML file. The logical answer seemed to be to use an XML. So, I started searching the internet for possible solutions.

For the better part of half-an-hour I went through a number of articles, knowledge bases, forums and blogs and then it struck me. A pure and simple answer on the Microsoft MSDN forums (http://forums.microsoft.com/msdn). Why not use My.Settings?

When using My.Settings, you are actually saving the settings in the app.config file in XML format. Simply double click on ‘My Project’, select the ‘Settings’ tab and enter the settings you require for your application. Remember these settings are unique for the local machine and shall NOT be available on any other machine.

Now, when adding new settings, you need to add a name for the setting, which cannot include spaces. You need to select the type, which is the data type. You also need to specify the scope. For this you have 2 settings, either ‘User’ which means that this setting is a ‘read-write’ setting, or ‘Application’ which simply means that this is a ‘read-only’ setting. You also need to specify a value.

Now, in code, whenever you need to read a particular setting then simply use My.Settings to access the setting value. You can also save a new value to pre-defined setting. Lost? Well, so was I at the beginning; so lets show an example. Lets assume we have 2 settings, named ‘Username’ and ‘Password’ (you would NOT usually save the username and password in a settings file; this is only for demonstrational purposes). Lets also assume that we have a textbox called ‘tbUsername’ and another called ‘tbPassword’.

In code, to read the settings into the textboxes you would simply write:

tbUsername.Text = My.Settings.Username
tbPassword.Text = My.Settings.Password

Now, assuming the user changes these and you’d like to store the new values, you’d write:

My.Settings.Username = tbUsername.Text
My.Settings.Password = tbPassword.Text

and then you’d type:

My.Settings.Save()

Read more here and here

Enjoy!

Links
http://msdn2.microsoft.com/en-us/library/saa62613(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/ms379611(vs.80).aspx

Farewell Seattle…

This summit has been tremendously successful and lots of fun. I got to meet some wonderful people, Billy Hollis (we had a lengthy but lovely chat over lunch, thank you Billy!!), Shaun Walker (the founder of DotNetNuke) and Sean O’Driscoll (the MVP boss of them all). I also got to establish a connection with the people responsible for VB at Redmond who promised that my voice will be heard; I like!

I’m sad to have to leave Seattle. It is a lovely city. Lost of rain, yeah you heard right, I love the rain. From where I come it rains approximately 5 days a year; while in Seattle it rains 300 days a year. It’s not just that, everything seems to be so easy in Seattle, or for that matter, the whole of the United States. And the American people (not the American industry) are so setback, easygoing and relaxed. At one point, I thought I could get away with almost anything. That’s a little different from the way it is back home; different culture I guess, but less forgiving, at least initially.

I’ll be back soon for more techie data.

Enjoy!

I saw Bill Gates!!!

Yep, its true, I saw the man himself. Wild experience to say the least.

Here are a coupla things I found out about Mr. Gates. He watches 24 (the TV series), his hair was not combed when he came in (I just came out of bed not combed), he doesn’t laugh out loud, he doesn’t grin either. He simply smiles. Kinda confirms the fact that he is mildly autistic and that he is definitely a geek!!

He has a good sense of humor; when asked if he had a favorite product, he started out as saying “you know, I love all my children”.

On other news; remember the two guys I told you about that were recording a session on the airplane, turns out they were both MVPs and one of them is called David McMohan. On Monday, as part of our MVP tour, Microsoft took us to the Museum of Flight and Dave, along with his friend Richard, took the opportunity to record a session with us (Loay, Moustafa, Hammad and I). Turns out Dave and Rich run a user group back in England, online at www.nxtgenug.net. You can the recorded podcast at http://www.nxtgenug.net/Podcasts.aspx?PodcastID=28. I start talking approximately 30 minutes in.

I know I sound awful, it’s my first podcast, but I hope to improve my skills as I create more and more of them. 🙂

Enjoy!

I’m in Seattle!!

Ok, lets see. I left Kuwait at 9am. 7 hours later I was in Heathrow. Left London at 6pm Kuwait time and more than 10 hours later… I’m in Seattle. After a total of over 18 hours of fly time!!! I’m here to attend the MVP Global Summit 2007.

I am exhausted to say the least. I flew British Airways all the way (supposed to be one of the best), and I have to say this, if this the best the aviation industry can provide, then we have a LOT of work to do. The plane itself was way overcrowded, mind you NOT in first or business class. But the stewardesses, or flight attendants or whatever they call them nowadays are downright rude! British! And I paid good money for that flight!

The exciting part was discovering the MVPs onboard as time went by. Some of them had MVP shirts, some had MVP bags, some had MVP emblems on their laptops and some looked like MVPs! 2 were actually recording an ‘Infrastructure Security’ (whatever that is) session at the back of the plane.

Seattle weather is wet and a bit on the cold side. The cab driver from the airport said it has been raining for the past coupla days.

I’ll keep you posted on the events of the summit as time goes by.

Enjoy!

MVP Global Summit 2007

I am very anxious to be going to the 2007 Global Summit. The Global Summit will take place March 12-15, 2007 in Seattle at the Washington State Convention Center and at Microsoft Corporation’s main campus in Redmond, Washington.

Bill Gates will deliver the keynote!! Yes, I’m gonna meet Bill Gates!!! Very very excited!

I’m gonna do a lot of shopping too. A lot of shopping!

Meanwhile, Virtual PC 2007 is available and it is absolutely free. “Virtual PC 2007 is a powerful software virtualization solution that allows you to run multiple PC-based operating systems simultaneously on one workstation, providing a safety net to maintain compatibility with legacy applications while you migrate to a new operating system.”

Check it out here http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx. Download it here.

Enjoy!

Geeks 2 – the Return of the Code

It seems the rumors of a major Microsoft event in the Gulf area at the end of March is becoming more and more fact. A speaker at the presumed event has disclosed to a fellow MVP that there is in fact an event on the way.

Here is what else we know about the event;

Title: Geeks 2, Return of the Code
Date: March 27th – 29th, 2007
Location: Dubai, UAE
Venue: Cinestar Complex

Enjoy!

InfoConnect 2007, Kuwait

InfoConnect is Kuwait’s version of Gitex (Dubai) or Cebit (Germany). For the better part its a whos-who of IT and telephony in Kuwait. InfoConnect is currently on until the 9th of February.

So, when Microsoft asked me to present Vista to the visitors of their booth, as an MVP, I was ecstatic.

I spent most of yesterday afternoon at the booth. I am AMAZED at the kind of hype Windows Vista has in the market. Everybody wants to know everything about everything about Windows.

Funny thing is, whenever I see the booth with only 2 people, I would simply demonstrate the 3D flipping on the 42-inch display screen and ‘viola’, people would come storming in!

Will give you more on this later.