Class Designer news

Wed, May 18, 2005, 02:57 PM under Whidbey | VisualStudio
Due to numerous fundamental omissions, the Class Designer has a long way to go before it can fully compete with existing modelling tools (although it already beats them hands down in some areas). The only devs who don’t see that are quite frankly those that haven’t used on a regular basis UML tools before (either due to not having the chance to do so _or_ because they tried and quickly quit due to the high UML learning curve).

Today, two posts in the class designer forums renewed my faith in the tool big time.
1) Full signature support in RTM (look for contribution by Ramesh on 18 May)
2) A cool open project that seamlessly adds a whole bunch of features (including showing all fields as associations for selected types). Shame about the gotdotnet choice Dmitriy, but you can’t have it all I guess :-)

Good stuff, thanks guys!

NoWarn or VB compiler options

Tue, May 17, 2005, 12:44 PM under Whidbey | VisualStudio
With VS2005, if you open the project properties of a VB project and select the "Compile" tab, you'll see a bunch of options.

[digression]Why did the VB team call it the "Compile" tab, whereas the C# team call it the "Build" tab? Although it is a rhetorical question, I'll answer it: Because the two teams do things differently for the sake of it! Consistency between the two is not only not a requirement, but probably looks bad at review time, so they avoid consistency as much as possible. Anyway...[/digression]

So you are on the "Compile" tab and you can choose between the None|Warning|Error notifications for each of the following 9 conditions (we'll see in a moment what the 5-digit numbers are after each one):
1. Implicit Conversion - 41999, 42016
2. Late binding call could fail at run time - 42017,42018,42019,42032,42036
3. Implicit type; call could fail at run time - 42020,42021,42022
4. Use of variable prior to assignment - 42030,42104,42108,42109
5. Function/Operator without return value - 42105,42106,42107
6. Unused local variable - 42024
7. Instance variable accesses shared member - 42025
8. Recursive operator or property access - 41998,42004,42026
9. Duplicate or overlapping catch blocks - 42029,42031

I will not explain each one here, because I hope they are self-explanatory. When you turn On Option Explicit and Strict you'll see that the top 3 are automatically set to Error.

So that leaves the remainder 6. I advise you to set the last 5 to Error; I cannot think of a reason why you would not want to correct issues caught by the compiler - if you have come across a reason, please debate it with me.

So we are now left with Use of variable prior to assignment: Set this to None. The feature is not complete and I have left comments here and submitted the bug here, to no effect. I guess you could turn it on and see if it has caught anything useful and, after wading through a sea of false positives, turn it off again. But this is literally a waste of time.

Finally, let's see what the 5-digit numbers are about. The VB compiler has more than 9 settings; in fact it has at least 24 (represented by the 5 digit numbers). When you make changes to the project properties' tab as discussed above, if you open the vbproj in notepad you'll find a NoWarn tag. Within that tag the series of numbers represents your choices. By enabling one warning at a time, saving and then examining the file, you'll come up with the mapping I have above, e.g.:
<WarningsAsErrors>41998,41999,42004,42016,42017,42018,42019,42020,42021,42022,42024,42025,42026,42029,42031,42032,42036,42105,42106,42107</WarningsAsErrors>
<NoWarn>42030,42104,42108,42109</NoWarn>
The second line instructs the compiler not to bother warning us about possible null reference exceptions. The first line tells it to set all other warnings to errors (this is separate to the "TreatWarningsAsErrors" tag that acts independently on a more generic level).

One question still remains. Why, in some cases, there is more than one number corresponding to a setting? The answer must be because there is finer grained control available that the VB project properties dialog is not offering (in fact, in the C# project properties you can freely enter the corresponding set of C# compiler numbers). Yet another tradeoff between simplicity (i.e. nice UI) and flexibility (i.e. full control).

Compact Framework Unit Testing

Mon, May 16, 2005, 12:49 PM under MobileAndEmbedded
Question:
Do Smart Device Projects (i.e. Compact Framework projects) support unit testing as offered by Visual Studio 2005?

Investigation:
1. In a CF project write the following method:
public Int32 GetBuildVersionPart(){
return System.Environment.Version.Build;
}
2. Right click on the method and choose "Create Tests...", choose C# and OK, choose default name and OK

3. Set the newly created project as startup project (via context menu)

4. Go to the test method and change the following line:
int expected = 0;
to
int expected = 50215;

5. Comment out the Assert.Inconclusive line

6. Run the project

7. Observe: The PPC emulator starts, which is promising, but unfortunately the unit test passes :-(
It would not pass if it was running against the CF, as the build number is 5056 (the full framework build number for Beta 2 is 50215).

Conclusion:
Unit testing is not supported by CF projects and instead the tests get retargeted to the full framework (much like Deploy to My Computer).

Link:
For an open source project that supports unit tests running on the device, see CFNUnitBridge from Trey

Blog link of the week 19

Sun, May 15, 2005, 03:23 PM under Links
Q: How long should a tech book be? A: 450 pages. Do you disagree?

Application Blocks for the Compact Framework

Quote of the week: Attributes are like tattoos - static and permanent

I hope the C# team follow the link from there and implement the only item I miss when coding in C#: Background Compiler

Popular tool re-implemented in unmanaged code for perf reasons! (via this)

Last day in Vegas

Fri, May 13, 2005, 08:51 AM under Random
MEDC came to its conclusion yesterday and today is my last day in Vegas.

Yesterday was a good day: Alex_F gave his all inclusive COM interop talk; David_K/Mark_I held their debugging session and Roman_B on NETCF performance were simply great. Also, Chris_T announced our latest SDF release.

Reflecting on the conference now that it has ended, there were a few things here and there that were new to me but, due to our close links with MSFT and the numerous Whidbey drops I've played with over the past year, I must say that most content was familiar. How about some level 500 sessions next year?

However, that is not the main takeaway as the most important benefit was meeting tens of MSFT people and it was great to put a face to a name and equally beneficial meeting new MSFT names/faces. In the same vain, I got a chance to meet most of the MVP community and quite frankly that is what it is all about. Apart from a handful of MVPs that couldn't make it there and a few MSFT people that I (unluckily) just didn't run into, from a networking perspective this conference met my expectations 101% :-D

Soooo... I am catching a flight to San Francisco later on and after a brief stop there it is back to Blighty... I was going to go into how much I "deposited" at the casino but I think this is a good point to stop the diary-style blogging and go back to the technical focus starting from the next blog entry.

Daniel_M

Wednesday, conclusion to the day

Wed, May 11, 2005, 11:13 PM under Random
After the first slot it was pretty much downhill... A very bad presentation from what was very obviously a marketeer using somebody else's slides and code... A session where the title had nothing to do with the content... A one hour marathon where there was a single message and not much more content...

It's not all doom and gloom though... I had an hour supporting the NETCF booth in the exhibition area and another at the MVP cabana (which meant I only caught 30 minutes of what was a cool introduction to MSMQ by Andy Wigley) and had some interesting conversations there...

After a private do where we met with the interesting MapPoint team, came the highlight of the day: "Blue Man Group"! Words cannot describe the show... at the end I got a photo with one of them (and here is Paul with another)...

Wednesday start and a photo

Wed, May 11, 2005, 09:49 AM under Random
First session today was Ginny's... very good show and here is a photo after the event

(Alex Y, Alex F, Ginny C, Daniel M, Peter F)


Very long first MEDC day

Wed, May 11, 2005, 12:10 AM under Random
Keynote by William Gates was *packed*! Windows Mobile 5.0 codename Magneto finally released. Search for links as the news should be all over the place by now...

Following that, an interesting panel discussion on building mobile applications went well...

One of the highlights of the day was lunch with members of the NETCF and VSD teams... I must have spent an hour complaining about bugs and missing features... I forgot to tell them how much I love the platform and the great work they do but I am sure they know that ;-)

For the next two timeslots I was not attending a session as I supported the self-paced hands on labs (part of the price you pay for getting admitted free as an MVP... small price if you ask me :-)

After that I attended an interesting session in an area I have no experience and, if I am honest, no immediate interest: "Game Development Using Managed Direct3D Mobile with the .NET Compact Framework"

Finally, one of the highlights of the day was "Memory Architecture in the .NET Compact Framework". I was looking forward to this session and I certainly was not disappointed. Fantastic info!

Then I hung around at the "Ask the Experts" session while consuming food and alcohol... at the same time the Exhibition opened so it was time to collect all the freebies...

The day ended with a screening of the code room... very funny :-D

Of course, the most beneficial aspect is the impromptu conversations held with various MSFT and MVP guys (and girls)... There are some real smart people here!

Due to some weird alcohol spillage that I will not go into, I cannot get photos from my camera onto this laptop and it is too late here so I'll be looking into it tomorrow... there will be photos tomorrow I promise!

mscorlib.dll

Tue, May 10, 2005, 12:08 AM under dotNET
Can you think about the amount of information that is part of your knowledge and account for it in terms of where you found out and how you consider it as common knowledge? Well, it turns out there is some stuff in my head that I thought everyone knew but it is not true. So I might as well capture it here on my blog.

What does mscorlib stand for? Stop reading! Don’t look for the answer, just try and work out the answer. What does the main dll of .the NET Framework stand for? What was the codename or first candidate name if you like, for C#? Well here are my answers (this is just my understanding which I cannot track back to a reference!):

C# and the design of this new .NET language ws COOL! More importantly, mscorlib has 3 parts to its name: ms cor lib.
ms: Magnificent Software (ok, it is Microsoft :-)
lib: as you expect this means library
cor: Before .NET was chosen as the name, this new platform was a successor to COM so it was codenamed COM 3.0 and then the name chosen was… Common Object Runtime (cor) and that is where mscorlib derives its name from (and that stuck regardless of the fact that .NET was the final name)!

So, now you know ;-) And if you knew already now you have something to point to!

MEDC registration

Mon, May 9, 2005, 03:32 PM under Events
Although I have had two nights here in Vegas, today (Monday) is almost the first day of MEDC. There are the two pre-conference tutorials (which I am not attending), communications network (which I don't neeed so far as I have wireless internet access here at the hotel ;-) and registration.

Check out the photos of a couple of signs I followed through the vast Mandalay Bay to find registration. I then received my badge and bag.

Contents of the bag include guide, conference evaluation form, the May edition of PocketPC magasine, A4 notepad, travel mug, half a dozen 3rd party flyers and the following disc packs: Mobile Application Development Toolkit, Windows Embedded Introductory Kit, and evaluation versions of Windows XP Embedded SP2 & Windows CE 5.0.

Since the bag's "convenient side entry computer compartment" is not large enough for my Dell Precision M60, I'll be going round with my bright yellow TechEd 2001 bag. If that is not enough to make me stand out, I am also carrying a limp after straining my right ankle yesterday :-(

More later...