Public musings, often on software development RSS 2.0
# Tuesday, October 25, 2005

I recently received an email from a reader saying that while they liked my article, they really felt that I was off-track and that this blog entry was a better discussion of Partial Classes: http://www.theserverside.net/discussions/thread.tss?thread_id=34255

My article is from about a year ago and located here: http://www.windowsitpro.com/Windows/Article/ArticleID/43726/43726.html#feedbackAnchor

My article at least in my view makes pretty clear what Partial classes support.  First let me state my one concern with the new implementation of partial classes: 

The Partial keyword should be required in every source file of a partial class.

The reason for this has nothing to do with the compiler or pre-processing.  It has to do with developers and debugging.  When I open up a class I have no-way of knowing if it's a partial class, because out somewhere in the project another source file might exist which uses the partial keyword to extend that classes source code.  If the keyword were required I would immediately know that a second source file (which I could then find) existed.  Don't think this will happen... well here's an interesting scenario - if you convert a UI class from .NET 1.1 to .NET 2.0 it doesn't automatically move the generated sections of your source file into a separate source file to reflect the new paradigm.  So now you will have some classes where you will have one source file and others where you will have two source files - how will you know which are which since Visual Studio applies the partial keyword only in the generated and hidden source file?

Of course the question posed by the Server Side blog is would using generated virtual base class and virtual methods be better then just supporting the splitting of a class across multiple source files.  The answer here is an easy to see - No.  Why not?  Well lets start with the impact of the changes on the runtime environment and user.  Using a base class with virtual (overridable) methods means that you have impacted the runtime behavior of the application.  I'm not going to go into details but each overridable method and class in your hierarchy carries with it a minor performance cost.  Thus using a virtual class carries a runtime cost.

Aside from the disadvantages of the runtime cost of using an abstract class with virtual (overridable) methods what about at source time.  Well here again the answers favor using partial classes.  Using an abstract base class means that there will still be a second source file associated with the class.  Thus the Visual Studio behavior of separating/hiding the generated code would still work, unless you wanted to have a second set of generated code for your class.  Now you would be limited to either introducing another abstract base class into your hierarchy or leveraging one of the two physical files (either the generated abstract base class or your own custom class) to hold your other generated code.

Finally using partial classes in the source as opposed to having an abstract hierarchy allows developers the option of separating out complex logic which might need to co-exist within a single class into multiple smaller source files that can be manipulated independently.  This advantage isn't a reason for partial classes, but rather an interesting benefit of having them.

Tuesday, October 25, 2005 11:32:09 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
.NET | Technology
# Monday, October 24, 2005

I've been meaning to post an update and it's finally time to forece one out here.  Sunday October 2nd was the Tour de Poway and I mentioned in an earlier post I would be riding the full Century route.  The route was 105 miles and fortunately it was a cool day.  The picture below is me crossing the 101 mile mark. The route covered 105 miles total and with a 7AM start it took me till 2:30 to finish.  Nothing real impressive in that mark, but then my goal was simply to complete in under 8hrs, so I'm satisfied.  My only mechanical on the ride had to do with my handlebar tape that I messed up at the start of the ride. 

Monday, October 24, 2005 10:34:55 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
Cycling
# Wednesday, October 19, 2005

One of the advantages of using Static Code Analysis in Visual Studio 2005 vs the previous FxCop is the ease with which you can customize which rules are run.  For starters there is the fact that you can turn off Static Code Analysis.  This is good because it does increase your compile time.

Secondly however, it is very overwhelming if you're working on a large project and for the first time run Static Code Analysis.  You can wind up with literally hundreds of warnings.  How do you manage this?  The answer is you go back into your project properties and start deselecting categories of warnings.  For example cut off Globalization warnings if you don't want to see all the static strings you've left in your code, or cut off Mobility if your application will never run on a hand-held device... you get the idea.  Limiting your checks to a single category, say performance makes it possible to group them and address them in a manageable manner.

Wednesday, October 19, 2005 3:35:25 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
Team System

The release of Visual Studio Team System is going to impact developers more then they imagine.  One of the tools which has been becoming more and more popular with me as I use it is the Static Code Analysis tool.  I've never been a big fan of source code scanners but as they value of the feedback they provide increases so does my preference toward using them.  The Static Code Analysis module in Visual Studio 2005 fits this model.

I don't want to create a long post, I just want to highlight one particular check which ships with the RC1 version of Static Code Analysis.  This check is in the Performance category.   CA1820 looks at places in your code where you are doing string comparisons, in particular where you are comparing to Null/Nothing or the empty string ("").  When it sees these it triggers a warning to let you know about a new feature of the Framework's string class.

With .NET 2.0 the String class has been enhanced with a static method that checks for Null Or Empty, it's called IsNullOrEmpty.  The CA1820 check lets you know where in your code you should be referencing this new static method.  To use this method just type the following:

VB: If String.IsNullOrEmpty(stringText) Then

C#: if (String.IsNullOrEmpty(stringText))

So in this case the Static Code Analisys is actually identifing places in your code where you can leverage new language features to improve performance.  Of course there are already almost two dozen such performance checks and I'm sure more will be created over time.

Wednesday, October 19, 2005 3:05:15 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
Team System | Technology
# Saturday, October 01, 2005

Microsoft invites it's MVPs up to Redmond once a year for a technical summit.  This is a global event where the product teams come out to talk with the MVPs for their product.  This has been an excellent event which is wrapping up today, and unfortunately many of the details are covered by Non-Disclosure Agreement (NDA).  However, one thing that isn't covered by NDA are our overall impressions of Microsoft's and its plans.  Let me say that the briefing given to all 1500 MVP attendees from Steve Ballmer was great.  Steve accepted questions from the audiance and fielded some rather confrontational questions all without missing a beat.  Similarlly Jim Allchin came out and you could just see the excitement as he demo'd some of the latest and greatest features of Windows Vista.

After the keynotes on the first day we broke into slightly smaller groups where we got briefings on the overall direction of Office or the Visual Studio development suite, or the Windows Server System etc.  These were great overviews before we broke into still smaller groups to meet with out individual product teams on days 2 and 3.  As an MVP for Visual Basic, I joind about 50-100+ other MVPs in the VB track.  There were probably 20 or more members of the VB Team present in the room as well.  The VB Team came out strong, they made it clear that they are interested in convincing those of you who haven't seen the value of .NET to understand just what you are missing out on.  They also made it clear that they aren't in competition with the C# team for features - they are blowing them out of the water.

You see a hint of things to come when you look at the "My" namespace which was delivered with Whidbey.  This namespace is just the start, and no the features aren't a bunch of new namespaces, but a focus on productivity.  If you are a business application developer and you still haven't moved to Visual Basic... well you are starting to fall behind the curve.  The future of VB continues to be focused on developer productivity.  Making it easier then ever for developers to leverage the Microsoft plumbing without needing to write thousands of lines of code.  One of the questions was "If the focus of VB is developer prodcutivity what is the focus of C#?" - the short answer of course is that it's not productivity - at which the room of VB developers laughed.

The great thing about the MVP conference is that it gives those of us who are MVPs that opportunity to see the direction that Microsoft is going as they think about Orcas and the next generation of Visual Studio.  Note, I understand that Dan Appleman has produced an ebook talking about the choice between VB or C# updated for 2005.  I also understand that Dan gives VB a slight edge (details available via his blog at http://www.danappleman.com/index.php?p=27), but let me tell you from sitting in these sessions with the VB team - wow, these guys definitely have a plan for some really cool stuff in the future. (note C# could have almost the same things planned, I don't know as I was in the VB sessions...)

I was also able to arrange to get an opportunity to spend some time with the VSTS team and Noah Coad.  Noah allowed me to join the VSTS MVPs for a brief discussion with some of the program managers and developers for VSTS to talk about what's going on in the current version of VSTS and what they are looking at for the future.  I can assure you that Microsoft has already started working on some of the feedback that people have provided with regards to VSTS.  This is going to be a great suite of tools to make developers more productive moving forward.

Finally I'd like to say Thanks to Ed Hickey and the entire team that worked on setting up and coordinating this event.  Managing 1500 event attendees is never easy and having us spread across the Microsoft campus and several hotels just ups the overall challenge that they faced during this event. 

Saturday, October 01, 2005 11:04:12 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -

# Sunday, September 25, 2005

In case I haven't made it clear I'm a pretty big fan of being involved in the community.  I don't just mean sending in a check to the Red Cross or other charity, who would be happy to take your money and from which would you get zero feedback - and in a way that's the point.  In most cases just writing a check while valuable gives you the least return on your money.  I mean actually going out there, being involved in a fund-raiser as either a participant or volunteer, donate blood, work at a shelter (human or animal) there are plenty of opportunities to volunteer and instead of it being just a 'bill' you get feedback, feedback that is worth just as much to you as the time you spend is worth to those who benefit.  Even better is when you combine donating money with actual involvement and involvement may be as simple as being a voice to help get an important message out.

I bring this up because with the recent events surrounding hurricane Katrina everyone has been looking at how they can help.    In the case of InterKnowlogy we were lucky enough to have someone in Emilie Hersh who was involved with pastor Bill Jenkins church group in Normal Heights that actually had a point of contact (POC) out in Mississippi.   Given that they had an actual POC (related churches) on the other end it became possible for them to put together a drive to send materials directly to those in need.  Let me pull a little from a recent article from the San Diegoe Union tribune available here: http://www.signonsandiego.com/uniontrib/20050922/news_lz1c22relief.html

"they formed Operation Baby Buggy to collect children's items to take to Hancock County, a rural area in southern Mississippi that got slammed by Hurricane Katrina. She found a truck and a driver. He tapped his contacts back home to clear the way for the delivery.

... The Operation Baby Buggy truck trailer, all 53 feet of it, pulled into a distribution center in Kiln, Ms., Sept. 14.

...Truck driver David Linture said that when he got to the distribution center at the VFW club, members of the Ohio National Guard immediately unloaded the goods. In another part of the center, a line of cars was coming in for care packages."

The nice thing here is that while we could have just written a check, the goods were in some ways more valuable because unless for example people wanted to start using wads of $1 bills to make diapers, the actual diapers were of more value then what they cost because there wasn't anywhere left to buy them.  That's the reason that not just InterKnowlogy but several companies teamed up with organizations that had contacts local to Mississippi and Louisianna to send aid directly where it was needed.

Sunday, September 25, 2005 1:10:02 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -

I haven't posted on my road riding of late.  I'm still trying to get out every Saturday (and in fact succeeded on the past two consecutive Saturdays) with the North County Cycle Club.  Including today's ride my current mileage is 5525 which puts me at just under 1,700 for the year and which means I'm only about 325 short of my goal for the year.  The current plan is to make my next ride the new Tour de Poway century ride.  Last year I did the metric century which was 63 miles, so this year they've introduced a new century route that I'm going to take.  Of course my longest rate thus far this year has been like 60 miles so going for a full 100 is a challenge.   On the good side the worst of the elevation is at the start of the ride, on the bad side my mapping software doesn't include one of the new road extensions nor the bike path so there is no way to tell how accurate the elevation profile between mile 80 and the 3rd stop are in the image below.

At any rate my bigger concern is distance since I haven't really got the miles, and I'll be out of town most of the coming week with my plane not landing till close to midnight the night before the ride.  But sometimes you just have to go for it... Of course if this goes well I think I may have to try for one more century before year end - probably a Tour de Cure ride up in Riverside but we'll see how this goes first.

Sunday, September 25, 2005 12:49:02 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
Cycling
# Friday, September 09, 2005

One of the more annoying trends in technology and business is the buzzword.  Often times ideas which are years old are wrapped with a new buzzword and the result is a 'new' technology.  Lets take the current a current example, the XMLHTTPRequest object in Java Script.  Originally introduced with like IE5 this control allows you to make a callback from within a page, retrieve updated content for a portion of your page and then redisplay that portion of your page in the browser.  This is to say the least technology that's been around for quite a while and importantly the market has spoken.  This object although originally used for things like the Outlook Web Access client is now supported across several browsers and is used by thousands of web sites.

In today's example of buzzwords gone wild we have the new term "AJAX" or "Asynchronous Javascript And XML" implemented with... the XMLHTTPRequest object.  That's it, AJAX  means you know how to use this Javascript object to update a portion of your page after the page loads.  Yeah that's a new technology - it's revolutionizing the web if you read the blogs.  It's also be added to toolkit after toolkit, in fact even Microsoftt is in on the act with the Atlas toolkit as blogged by Scott Gu.  This kit like the others goes beyond the 'basics' of using XMLHTTPRequest and allows you to better debug some of your logic since script is notoriously difficult to debug.  On the down side it makes it easier to carry out some 'tricks' as also illustrated by Scott Gu on this other link.

The nice thing about the XMLHTTPRequest object is that it does allow for a richer user experience heck, it's almost half as good as a Windows Form... The key is as you hear about AJAX just keep in mind its not a new technology its an understanding by the IT industry that a technology introduced by Microsoft, adopted by it's competitors, still not standardized by the W3C and already in use on hundreds of web sites can provide a richer web experience.  You'll want to diig up the latest XMLHTTPRequest pages, and if you are using ASP.NET look for the initial release of the Atlas toolkit.

For the future though I'd just like to appeal to the technology world to ease up on the unnecessary buzzwords.  I could post a dozen or more links to AJAX related sites and blogs most of which aren't clear on just what AJAX is. Can't we just say what we mean without trying to apply some marketing term to cloud the issue and hide the what's really going on.  After all don't even get me started on the Web 2.0, which apparently is a term created to justify a conference to web technologies other then HTML... http://en.wikipedia.org/wiki/Web_2.0

Friday, September 09, 2005 2:12:23 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
Musings | Technology
# Tuesday, August 02, 2005

So I was up in Big Bear again this past weekend, and it's 'Old Miner Days' right now.  Thus the town of Fawnskin was having a Doo Dah parade so when I went for my ride I headed out through town initially so I wouldn't be trying to return in the midst of the parade.  So after I headed up 3N14 to 3N12 I got a real treat there crossing the fire road was a beautiful coyote.  It was definitely an adult and looked healthy, he calmly finished crossing the road and when I got up to where he crossed I could see him over in the trees looking back at me.  He then headed off before it dawned on me to take his picture (sometimes I'm pretty clueless...).  That in and of itself meant I was having a good ride.

I then headed up 3N12 and down to 3N16, across 3N16 and ran into 3N10.   3N10 is a trail I haven't ridden before so I decided to head off on that trail.  It starts a a pretty straight forward ride for about the first mile or so.  A little uphill but nothing major.  Then it intersects 3N43, this is where there is a sign I've never seen before. 

As you can see the Jim Bull trail has a sign that indicates that it is triple black diamond.  Now to be honest I didn't even realize that the US Forrest Service rated trails.  But since I was out exploring I figured what the heck let's go for it.  Wow.  This is a challenging trail.  There are some areas that are quite passable, and there is alot of climbing (since the elevation peaks a little over 8,000 feet).  However, the real challenge are the rocks which in some places overcome the entire road.  Below is a camera phone picture of a jeep coming down one of these truly nasty sections.

On the plus side though you get some great views as you head up.  Note, when coming from 3N16 the best views are on the way up shortly after the flats, here is one shot out onto the high desert.

However, on this day my adventure wasn't quite done... As I crested this trail I found myself facing an afternoon thunderstorm.  The clouds in the picture below tell part of the story.  Yes for my trip back down the rains began.  I would like to point out that although it was a good 80 degrees fahrenheit when I set out on my ride, the rain was very cold.  It could easily have been hail, although I'm thankful it wasn't. 

So I headed downhill post haste eventually intersecting with 3N32 which took me back down to 3N07 using some trails that aren't on my map (as long as I was headed down I was headed the right way).  This of course brought me back to 3N16 which took me to Polique Canyon Road (2N09) that I could use to head back.  The good news was that by the time I got back to 3N16 the rain had stopped.  The Jim Bull trail is very difficult, and while th view is impressive I can get much the same view off 3N16 which runs up above Baldwin lake.  So I'll probably not be riding this trail again for now - I have other challenges, but if someone wants a challenge, I'm up for most any trail.

Tuesday, August 02, 2005 4:14:37 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
Cycling
# Friday, July 29, 2005

As you can tell I'm using this morning to really catch up on my blog posts.  I've been meaning to update them but things were busy and then I was sent on this assignment called 'vacation'.   Turns out I really enjoyed that assignment... I need to post a couple picks of my wonderful neice and nephew, but I'm all ready for a repeat. 

But for now I just wanted to send out a quick reference to a new technical book regarding Visual Studio Tools for Office(VSTO).  The book is being published in September, but I was fortunate enough to get an early look because InterKnowlogy has been doing alot of VSTO work lately and Tim Huckaby (our CEO) spoke at Tech Ed on this topic.  So after Tim took a look at the book so he could say what he thought of it he passed it to me and I put it to use.  The book covers not only VSTO but integration with Microsoft Office 2003 from .NET 2.0.  It talks about how to call office from your application and just as importantly how too build really powerfull VSTO apps.  More importantly it doesn't draw a line in the sand with Word and Excel, this book goes into customizing Outlook and Infopath.  This book covers stuff that some of our IK developers have had to learn the hard way.

The book will be released mid september but there is Addison-Wesley and a portion of Chapter 1 is posted here: http://www.awprofessional.com/title/0321334884

The version of Chapter One I previewed is noticably longer and the book comes with plenty of code samples.  Although it's written in C# instead of my preffered language of Visual Basic I definitely recommend it for anyone who is looking to leverage the power of Office 2003 in their custom application.  Converting samples from C# to VB just helps you really understand the code.

Friday, July 29, 2005 9:41:56 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
Technology | VSTO
Archive
<October 2005>
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Bill Sheldon
Sign In
All Content © 2012, Bill Sheldon