Sunday, 03 August 2008

The Paradox of Simplicity


In agile development, it is common to hear people say "do the simplest thing that could possible work." This is a corollary to YAGNI or "you ain't gonna' need it." I don't hear many of my fellow developers outside of the agile movement arguing with those sentiments. It seems we can all agree that we should not exert effort beyond solving the specific problem at hand.

There is, however, contention about what the implementation of such pragmatic simplicity looks like. As a .NET practitioner of agile development, it is common for me to write tests before implementation code. I often write interfaces which have only one implementation. I may use an inversion of control container, an object-relational mapper and other infrastructure utilities which appear to add unnecessary complexity to developers with a different outlook.

One of the most glaring anti-patterns for simplicity in my view is the SQL data source. It seems very simple and pragmatic to some because it allows the developer to quickly create a forms over data application which will deliver value to the client. While I agree that there is tremendous immediate benefit in using the SQL data source for the initial delivery of value, there is also a tremendous cost down stream.

In my view, the SQL data source represents all that is flawed in RAD (rapid application development) tooling. It allows the developer to quickly get data into and out of a database into and from the user interface. It also tightly couples the data access implementation to the user interface making future changes very difficult to implement. Fundamentally, tools such as the SQL data source represent the software equivalent of a Rube Goldberg machine where each bit of functionality relies intimately on the implementation details of it's neighboring components.

The core problem in software from my experience is not the delivery of the initial version of any functionality. The core problem is that that I and the customer never know when or where the code will need to change, but we know for certain that it will change. Enabling change therefore becomes a top priority along with delivering value.

If I deliver value up front while discouraging later changes to the code, then I have not actually delivered value. I have in essence paid with a credit card. The cost of changing the code must be paid later with interest. This phenomena is commonly referred to as "technical debt."

In my agilist mindset, I view the avoidance of technical debt as an essential element of simplicity. High coupling and low cohesion are too high a price to pay for immediate gratification. Furthermore, I have found that once I become experienced with the tools and practices of agile development, there is little cost, if any, to building changeability into my implementation from the start.

Kind regards,


 Sunday, 01 June 2008

Agile Development Birds of a Feather at TechEd Developers


As part of the TechEd Developers conference this week in Orlando, Fl, I'll be facilitating a discussion of the pros and cons of eXtreme Programming and other agile development practices. We'll be discussing what has worked for us, and what hasn't.

BOF857 Agile Development, Tenets of XP: eXtreme Programming

Wednesday, June 4 6:30 PM - 7:30 PM, N330 D

Using various tenets of XP can provide the impetus to make your development process more agile. Agile is a discussion point: what do you do or want to try to do to add Agility to your development process? We throw around a few ideas regarding processes such as SCRUM, Continuous Integration, Pair Programming, regression testing/tracking metrics, code generation, Team System, and others. Everyone can share whatever has worked and what they are working on. This is a forum to exchange workable solutions to faster development with near perfect execution on fast development cycles.

Birds of a Feather (BOF) sessions are interactive discussions rather than presenter-focused lectures. This is perfect for me because I am not an agile development expert. I am an imperfect practitioner of agile practices. I'll be moderating the discussion, but I fully expect there to be smarter, more experienced people in the room to enlighten the rest of us.

If you'll be at TechEd Developers this week, please join me on Wednesday evening at 6:30 for what I hope will be a lively discussion.


 Thursday, 06 December 2007

VSX on Code To Live


Code To Live I recently did an interview and quick demo with Josh Holmes from the Code To Live podcast.  The topic was Visual Studio Extensibility. 

I liked having the opportunity to show some code as well as talk about the technology.  The demo was recorded in the speakers' lounge at the Memphis Day of .NET.

If I seem overly mellow in the interview, it is due to exhaustion.  It was recorded at the end of the first day of DevLink, after I had given two talks.  After I finished the interview (and my cigar) I headed back to the hotel to crash.

Code To Live: Alan Stevens talks on Visual Studio Extensibility



Entity Framework on the ASP.NET Podcast


I did an interview with Wally McClure recently about the Entity  Framework for his podcast.  It is now available for your listening pleasure.  I had some bandwidth issues that caused Skype to choke a few times, but it sounds like Wally did some crafty editing on those parts.

Our discussion was fairly general and introductory, so if you aren't already aware of the Entity Framework, this should be a decent introduction.

ASP.NET Podcast Show #105 - Alan Stevens and Entity Framework



 Tuesday, 06 November 2007

Tech Ed U.S. 2008 Split


This is fantastic news.  This will improve the signal to noise ratio for both developers and system engineers.  Thanks to Jason for the heads up.


 Saturday, 03 November 2007

Visual Studio as an Application Platform


Josh Holmes blogged about Microsoft as a platform company rather than an application company.  He referred to VSTO as making Office a platform for other companies to develop applications.  He further mentioned Facebook's recent success as a platform for others to extend.

I heartily agree with everything that Josh is saying.  I think I heard the same argument a few years back.  Jerry Pournelle has said for years that while OS/2 was the better OS technically, IBM wanted to sell the SDK, while Microsoft was slipping Windows SDK CDs in every Comdex attendee's bag.

I especially endorse Josh's argument that Firefox is a better platform than Internet Explorer.  It doesn't have to be that way, but it is, for now.  Firefox has some flaws in its add-in model.  I keep expecting Microsoft to release a managed API like VSTO or the MPF for IE.

Software development is constantly in flux.  Should we build web apps, Windows Forms apps, Click Once smart clients, WPF or Silverlight apps?  For my eight years as a software developer, I have built applications that leverage the power of the desktop computer.  I like desktop apps.  I use web apps, like gmail, and Google Reader, but I prefer a rich desktop application UX.

Perhaps I'm becoming a curmudgeon, but AJAX doesn't excite me.  It's still just JavaScript, and it's still slow.  I'm not foolish, I realize that the trend will continue to be leveraging the web as a platform, as more previously desktop only applications move into the browser, and I don't think this is a bad thing.

What I know is that no web app can completely duplicate the rich UX of a desktop application, no matter how many smart people argue otherwise.  I use OWA frequently, but it is not a replacement for Outlook.  In fact, I think Outlook is the best example of leveraging Office as an application platform.  The most recent release of VSTO made creating Outlook plugins significantly easier.

If I were still creating line of business applications as a consultant, I would be adding an Outlook dashboard to every client's system.  Check out TeamLook for an example of what I'm describing.  I keep expecting Microsoft to purchase Personify Design and make Juan independently wealthy.

As I examine my own computer usage I have identified one other desktop application that I believe will not be moved entirely to the web.  That application is Visual Studio.  I use it daily, and I cannot imagine an equivalent experience in a browser.  That is why I have been so stoked about VSX since I first heard about it.

I'm not sure the message has traveled throughout the developer community, but the new Visual Studio 2008 Shell turns Visual Studio into a platform for new application development.  It takes some explaining, but think of Visual Studio as a framework for building an application.  VS handles the main screen, and most of the plumbing, and you as the application developer focus on adding business value.

I'm not saying that the Visual Studio Isolated Shell is the right solution for every smart client application, but if the problem domain fits the Visual Studio tool and command metaphor, then it is worth your time to investigate.  I'll be speaking about exactly this topic on November 10 at the Memphis Day of .NET.  I'll also be blogging on Cave Markings about the progress I have made in exploiting the VSX tools for application development.  Stay tuned, the future is bright!


 Wednesday, 31 October 2007

Jeff Prosise Lights up Silverlight at ETNUG


Last night at our monthly meeting of ETNUG, Jeff Prosise walked us through the basics of Silverlight and demonstrated some of the potential of this new web platform.  I had read plenty of blog posts about Silverlight, but this was the first demo from scratch that I had seen.

Jeff is a Knoxville area resident, and a model airplane buff.  He showed a Silverlight streaming video of his new model jet that he's learning to fly.  Who knew you needed a license to fly a model airplane.  His initial demo was of a video website that he called "Foo Tube." ;-)

Jeff showed us his MyComix site and his implementation of the Game of Life, Silverlife.  He also walked us through starting a new Silverlight project in both Visual Studio 2005 and 2008.  Jeff is no fan of JavaScript, to put it mildly, and he was particularly excited to show the use of C# for code behind Silverlight events.

While I was disappointed that he didn't get into the dynamic language runtime in detail, Jeff talked for a solid ninety content-packed minutes.  I always enjoy watching Jeff present on any topic, but he was particularly excited about the possibilities enabled by Silverlight.

Jeff's enthusiasm definitely rubbed off on me.  I can't wait to explore the next release of Silverlight 1.1 which Jeff said will be available "Real Soon Now."  I am especially interested in using the DLR with Linq in a Silverlight app.



 Thursday, 20 September 2007

Fox Forward Shows Some Love


Kevin posted the news today that Dave Bernard won best presenter at Fox Forward 2007.  I didn't make it in time for his opening session on Instrumenting Your VFP Application, unfortunately, but I did see the first and last halves (in reverse order) of his Does Your Application Understand You? session.  Dave is doing some very exciting things with technology, and he has an easy going style when presenting.  Well done!

My Red, Green, Refactor: Test-Driven Development with FoxUnit session won the best use of technology award.  I was shocked, given the innovative approaches I saw during the conference.  It is quite an honor to be recognized by my peers in this way.  Thank you to everyone who voted, and everyone who attended for making this year's Fox Forward the best yet.

On the first evening of the conference Stephen Bodnar asked me what the difference was between my Red, Green, Refactor session at Fox Forward and my Test-Driven Development pre-conference session at SouthWest Fox next month.  My flip answer to his question is:  about two hours.  :-)  The longer answer is that I will be able to help attendees in Phoenix overcome some of the more challenging hurdles to starting TDD. 

At Fox Forward, I mentioned an approach to test driving the UI, but I didn't have time to demonstrate it.  I talked about refactoring legacy code to support unit tests, but again, no time for a demo.  In Alpharetta, I didn't even touch on the subject of mock objects.  In short, there's lots more to unpack in TDD than I can address in a standard 75 minute session. 

In fact, my repeat presentation was the last session of the day on Saturday, and the entire room kept their seats for ten extra minutes while I gave an extended demo of TDD with FoxUnit.  Kevin came in to collect the projector and everyone was still listening to me talk!  If you are signed up for the pre-con in Phoenix, or if you are considering it, I promise to give you your money's worth.



 Thursday, 05 July 2007

When the Pattern Is Its Own Anti-Pattern


I'm totally digging Alex Miller's "Patterns I Hate" series.  So far he's taken down Singleton and Template Method.  I love to study patterns and "best practices" in general, but I realize they can do harm when slavishly copied in inappropriate contexts.

While on the topic of Patterns, I must give a shout out to my co-worker Geff Ivey.  I mentioned my liking of Design Patterns Explained as an alternative to the GoF, and Geff convinced me to finally take a look at Head First Design Patterns.  I'm sure this book isn't for everyone, but it was useful to me.  They finally helped me to wrap my head around Model View Controller.  They did it better than the Pragmatic Programmers, or Martin Fowler, although Fowler has more context on the evolution of the design.

Anyway, Alex appears to be a fan of dependency injection, which will soon be promoted by agile practitioners, as a cure for cancer, or at least cancerous code.  Alex has some excellent, thoughtful comments.  You should read them, highly recommended.



 Tuesday, 03 July 2007

VSX - First Impressions


You only get one chance to make a first impression.  I want to record mine regarding VSX before I get too familiar with it.

First, the documentation and comments in the project template are very thorough and helpful.  If the legacy systems I've supported in my career were half as well documented, I'd probably be less obsessed with TDD these days.

Speaking of TDD, there is a great set of sample projects in the SDK.  These are found in %VSSDK_InstallDir%\%Version_Number%\VisualStudioIntegration\Samples\IDE\CSharp\.  In that folder, there are some reference projects, each of which include a TDD\ folder with unit tests.  Sweet!

So, kudos to the VSX team for the good documentation and the unit tests, on to what was less than stellar.  There must be a way to abstract the CTC file.  It isn't poorly formatted for a config file, but It could be so much better.  XML anyone?  I know XML takes it's lumps when it is used for scripting, or as a data serialization format, but it is ideal for a config file.

At the very least, there needs to be a CTC Editor GUI tool to prevent me from fat fingering some comma separated value.  Here is an excerpt from the tutorial:

This line contains comma-delimited fields. The first field is the command that will receive the key binding. This field is in the form GUID:ID, where the first part is the GUID for the package, which is defined in Guids.h (also in the CtcComponents folder). The second half is the command identifier you typed in when you ran the wizard; this identifier is defined in CommandIds.h (which is also in the CtcComponents folder).

The second field is a GUID representing where this keyboard shortcut will be available. Different parts of Visual Studio can have different keyboard handlers. For example, when you are inside a text editor, the keyboard shortcut CTRL+I runs the Incremental Search command. But when the Solution Explorer is active, CTRL+I has no key binding. Thus, CTRL+I is only available to the text editor.

We want our keyboard shortcut to be available everywhere in Visual Studio; thus, it will be global. For global keyboard shortcuts, we use the GUID defined by guidVSStd97.

The third field is not presently used; for now, you use the same identifier from the second field, guidVSStd97.

The fourth and final field is the keyboard shortcut. This takes the format 'character':otherkeys, where the character for the shortcut goes in single-quotes. The otherkeys portion represents SHIFT, CTRL, and ALT with the letters S, C, and A, respectively. In this sample we're using CS, which means CTRL and SHIFT. The letter used in this example is M; thus, this keyboard shortcut is CTRL+SHIFT+M.

Couldn't I have an editor that allows me to select values from lists, rather than manually locating them in guids.h?  This is "hold your mouth right" programming.  How am I supposed to remember that the third field isn't used, and why do we put in a value if it isn't used?  How about creating an enum that I can access in code, rather than making me remember the constant guidVSStd97?  How long can I continue with these rhetorical questions?  Seriously, this aspect of VSX screams for better tooling.  Perhaps this is what VSSDK Assist does.

Finally, I have a real issue with the PLK.  It is a bottleneck to community development to request a new key for every dll.  Perhaps we could have one key for all community created packages, while commercial vendors are required to have unique keys.

If I sound negative, it's only because I know I will become accustomed to these annoyances in my quest to master VSX, and I want to record them to remind myself what it was like to be a noob. :-)



 Monday, 02 July 2007

VSX - Know Your Tool


If you've ever read The Pragmatic Programmer, and you should, it makes a mantra of DRY (don't repeat yourself).  The point is that you have enough to do developing good software.  Don't waste time on repetitive tasks.  I apply the same principle to DRY that I apply to OOP.  If I see the same scenario in code three times, I abstract it into a class.  So, if I have to perform some boring, or at least repetitive, task three times, I automate it.  Well, that's the plan anyway.

This is my motivation for getting into VSX.  I don't want to perform the grunt work involved in creating Model View Presenter designs.  I want to focus on the interesting job.  It is the what, not the how that is difficult to get right in software development.  I hope to build some tools that allow me, and my fellow developers, to focus on the interesting work.

I decided to begin my investigation with the Visual Studio Extensibility QuickStart Tutorials.  These six labs promise step-by-step introductions to the various forms of VS extensions.  Below are my notes, so you can follow along from home.

In order automate tasks at a fine grained level in VS, you'll want to use the Managed Package Framework (MPF).  This is a managed API introduced in Visual Studio 2005.  Classes in the MPF are found primarily in the Microsoft.VisualStudio.Package and Microsoft.VisualStudio.Shell namespaces.  In order to manipulate the MPF, you interact with numerous interfaces.  You will implement many of these IVs* interfaces in your classes, so that VS knows how to interact with your package.

The primary elements available for creation are tool windows, document windows and commands.  In the new VSPackage wizard, the options are listed as Menu Command, Tool Window and Custom Editor.  Commands display visually as buttons on menus and toolbars.  Commands are also available in the command window by category.  Type "build." in the command window, and intellisense lists the commands available in the build category.

It can be useful to bind a keystroke to your custom commands.  The comments in the template for VS commands warn:

Notice that Visual Studio has a lot of components and commands, so it can be difficult to find a key binding not used by somebody else; if the key bindings are conflicting only one will be used and one problem is that the shell will not inform the user that a conflict was found. The only  way to detect the problem is to start Visual Studio under debugger, try to execute any command and look if there is a message in the output window about a duplicated accelerator found.

In order to distribute your package, you must request a Package Load Key from the VSIP site.  This is an unnecessary hassle, it seems to me.  I've requested a PLK for the package I created following the tutorials.  I understand the need to track commercial packages which extend the VS shell, but it seems like overkill for personal extensions.

It's 11:30, and I've only finished the second tutorial.  I'll pick this up again tomorrow.



Going Deep with VSX


I'm taking some time off around the Independence Day holiday this week.  I have several projects queued up for attention.  One that has priority for me is an investigation of VSX.  I was introduced to the latest efforts by Don and Ken while I was at TechEd.  I don't have much to report yet, but I would like to share some resources that I'll be exploring:

That ought to keep me busy for a few days!  I've got some ideas that I would like to implement in the IDE, but I don't know how to get started as yet.  I'll report back when I've learned something.



 Wednesday, 13 June 2007

What's Your Programmer Personality Type?


I can't get enough of these dumb online personality tests:


You're a Doer.
You are very quick at getting tasks done. You believe the outcome is the most important part of a task and the faster you can reach that outcome the better. After all, time is money.
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.

Now it's your turn to take the Programmer Personality Test.



 Wednesday, 06 June 2007

Tech Ed 2007 Day 2


Tuesday started with a good conversation with a member of the SQL Server Replication Services team over breakfast.  I love sitting down at a table with someone in a blue Microsoft shirt and asking what they work on. 

I was too late to bother with the first session of the day, so I headed over to the Hands on Labs.  I started a session on the new Acropolis application framework.  This was a totally new technology to me, so I spent most my time reading the manual.  I saved my partial session for later resumption.

There were lots of great sessions to choose from, but I settled on Joel Semeniuk's "Best Practices for Team-Based Software Development."  Joel is an excellent speaker with lots of great insight to share on this topic.  The room was packed, and I sat on the floor, but it was worth it.  I'll be sharing the slides from this session as soon as I return to the office.

I grabbed my lunch in a take-out box, and headed to a Birds of a Feather sessions called "Exiting the Zone of Pain: Static Analysis with NDepend."  This was an interesting discussion on a topic I was familiar with, code profiling metrics, and a tool I was not familiar with. 

It was during this lunch session that I bumped into Cam Soper for, at least, the fourth time.  It's obvious that Cam has excellent taste in parties and sessions. :-)  This time, we finally exchanged business cards.

I tried to attend Joel's interactive discussion after lunch, but it was packed again.  My Acropolis session from the morning took too long to resume, so I took the opportunity to work on a Hands On Lab on WPF.  I completed a couple of exercises, and enjoyed getting more familiar with the new GUI coding model.  I'll do more later.

For my last session, I attended "Developing Data Driven Applications Using the New Dynamic Data Controls in ASP.NET", but I left just as it got started to deal with a weird technical difficulty.  I'll find out more about these new controls later.  They look very interesting.

Shortly after lunch, I ran into Ken Levy, who has changed teams once again.  He is now doing community development for Visual Studio extensibility.  I promised to stop by later in the week to show him some extensibility I've been doing to bring VS features into VFP, and get his feedback.

In thinking about doing this demo, I realized that I didn't have the Team Foundation Server client installed on my laptop.  While I was sitting in afternoon sessions, I downloaded the client from Codeplex, and grabbed an ISO extractor from a Google search.  I extracted the image and tried to install, but I kept running into missing files.  I downloaded the 180 trial of TFS and performed the same routine with similar results. 

After fighting the issue for half an hour, I realized that the people who wrote the installer were standing 50 feet away.  I went over and asked for help, and received lots of it.  In the end, it was Chris Menegay who determined that the ISO extractor I used, WinISO, was chocking on path lengths over a certain point, and couldn't even read the files to extract them. 

I felt humbled, but grateful to get back on track.  When I got back to my room, later that night, I downloaded WinRar, extracted and installed without problems.  Moral:  don't download unknown software you find on Google. 

Once Chris identified my problem, he and I headed off to meet up with the rest of the Central Region group for our party.  Drew Robbins put together a cool event at the Skyventure Orlando indoor skydiving attraction.  I had never done anything like this before, and it was a blast.  I couldn't stop grinning.


What will tomorrow bring?


 Tuesday, 05 June 2007

Tech Ed 2007 Day 1


Day 1 started well.  I realized I could drive to a nearby hotel to park, and then ride the bus to the Convention Center.  Once onsite, I ran into a fellow Knoxvillian and ETNUG member at breakfast.  I did my best to recruit him for the "Best of Tech Ed" session at our June meeting.

After checking email and blogging a bit, I attended a session called "A Lap Around Visual Studio Orcas."  Unfortunately, the presenter's VPC was locked when he tried to do his first demo.   I've seen the presenter before, and he is awesome, but I'm tired of watching people fight VPC on stage, so I left. 

I went down to the cabanas, or whatever they're calling them this year, to talk to some Microsoft people.  I stopped at the dynamic languages kiosk to find out about the future of tool support in VS for dynamic languages.  I explained to the two members of the team present, about the development style in VFP.  During the conversation, Mahesh Prakriya, the PM for dynamic languages, joined us. 

I asked Mahesh if he knew any members of the VFP team, and he happily reported that he was friends with Alan Griver from his time on the SQL Server team.  We went on to discuss the role that iterative execution plays in development with dynamic languages.  Mahesh used the example of Query Analyzer as a tool that supports dynamic execution.  While he couldn't make any promises, he said his confidence was high that Visual Studio would support a dynamic execution model in the VBx time frame.

I went on to chat with Chris Menegay about the challenges of convincing managers to adopt best practices when using Team Foundation Server.  While we were talking, I was introduce to Juan Perez.  Juan is a very friendly guy, and I thanked him for producing TeamLook, which allows users to access TFS from within Outlook.

Once the vendor area was open, I stopped by to see Eric Sink.  I just wanted to say "Hi", but I ended up discussing the DiffMerge tool that SourceGear produces.  I am very dissatisfied with the diff tool that ships with Team Explorer, so I asked how much SourceGear's tool costs.  It turns out that this tool is fee, and they've just released a new version.  Eric asked me to try it out and email him with my impressions.  Turns out, he blogged about it in detail yesterday.

I lingered too long at lunch, so I missed Don's session on extending VS.  Instead I wandered over to the Hands On Labs, to see what I've been missing the past two years.  I found the labs easy to use, but there were some technical difficulties.  I chose a lab on using LINQ.  I completed the first exercise successfully, but the second exercise required connecting to the Northwind database, and I couldn't find it.  The instructor verified that it was not installed, and sought assistance.  Apparently, that is a flaw in their VPC image, and I won't be able to perform that exercise.  While this was disappointing, I enjoyed the first exercise, so I'll probably try some other labs this week.

Next I attended a session titled "A Lap Around Windows Presentation Foundation."  I've seen a few WPF overviews, but it is still a foreign technology to me.  I was fairly bored until the presenter demonstrated this.  I work on logistics applications, and this animation was the first example I've seen where WPF could add dramatically to our applications.  I left the session early to IM my coworkers about this cool discovery.  I'll try some of the WPF Hands On Labs before I leave, so I can understand better how to produce such exciting data visualizations.

My final session of Day 1 was on the Entity Data Model.  I've read some about this, but I never understood where it fit with LINQ.  My understanding today, is that EDM is an ORM technology that will ship as part of ADO.NET.  This means that I can use stock ADO, and still manage my data without using datasets.  This is good news indeed!  Once the objects are in memory, LINQ can be used to query against the model.  This is good stuff, and I'll be exploring it further during the week.

During the EDM session I heard a quote that was new to me, but the message was familiar.  "Normalize 'til it hurts. Denormalize 'til it works."  Perhaps this could be restated that in practice, theory is only theoretical. :-)

The evening ended with a reception in the vendor area with free food and "beverages."  Here's Geff getting his fair share.


I filled my bag with swag, ate and drank my fill, then headed home to collapse and rest up for Day 2.



 Saturday, 02 June 2007

I'm Off To Tech Ed


I'm on an early flight to Orlando tomorrow.  This will be the first time I've stayed at "unofficial" lodging for Tech Ed.  This means I won't be able to take advantage of the free bus transport, which, in turn, means I will have to watch how many beers I consume at the evening events. :'(

On a brighter note, I will be co-moderating a Birds of a Feather session with Shawn Weisfeld from the Orlando .NET Users Group on Friday morning.  I love the BOF format because it allows many points of view to be shared.  Join us if you can.  Here are the details:

BOF26 - Binding GridView, DropDownList, etc. with CRUD

Friday, June 8 10:45 AM - 12:00 PM, S331 A 

Join in a discussion of binding with ASP.NET controls such as GridView, DropDownList and DetailView and others. Share in the discussion of techniques using automatic code generation, using the List<> generic to bind data in a form to data in a database, and using other techniques that have worked well and not so well. We Birds of a Feather can help each other by promoting discussions of how to bind into templates for highly customized views of the data with nearly zero code, providing for GUIs.

See you in sunny Florida,


 Thursday, 31 May 2007

Blog Redecorating


If you read this humble blog in the browser, rather than a feed reader, you will notice some updates.  I have replaced the three-years-out-of-date photo with one from May 2007, and provided a link to the source image.  If you've ever wondered why this humble author is smiling, you can now click the pic to see the answer.

I've added some flair.  I'll try to include any events I am attending whether I am speaking or not.  Please explore the links in the flair section, they are all valuable, to me anyway.

I have updated my blogroll, and it was a lot of work.  It now consists of all the  developer blogs I follow, ordered by the author's name.  Some are .NET, some VFP, and some are none of the above.  This list represents the single most valuable resource in my developer toolkit.  I am constantly caught up in an ongoing conversation with the great minds represented there.  The conversation has been largely one sided for quite a while, but I'm beginning to interact again. 

2005 and 2006 were filled with upheaval as I changed jobs, and watched my marriage and my children's home fall apart.  This year began with my marriage to the most amazing partner I could ever imagine.  We set up a new household with four (sometimes five) children, and began the task of finding a new groove.  I'm happy to report that we have achieved that groove, and I am now able to direct more energy outside my home life.

This is why I'm updating the blog, I've got a lot to share, and I have the energy to do so, once again.  I'll be at Tech Ed in Orlando, next week, so look for lots of updates on the goings on there.



 Tuesday, 20 March 2007

J# Is Put Out to Pasture, and No One Notices


After last week's announcement of the end of the line for Visual FoxPro, I found it entertaining to read that J# suffered a similar fate, two months ago!  J# is Microsoft's implementation of Java syntax on the Common Language Runtime.  It was never promoted as a primary .NET language.  It was intentionally a clone of Java so that Java developers could move painlessly onto the .NET runtime.



 Wednesday, 14 March 2007

The Fox is dead. Long live The Fox.


I suppose once Wally blogs about a topic, it has broad developer interest. I read the news on Visual FoxPro specific blogs earlier in the day, and I emailed the story to my coworkers.  Today, Microsoft announced the end of active development on Visual FoxPro.

Personally, this is not a surprise in any way.  Ever since the announcement that VFP would never move to 64bit, I've known this day was coming. Furthermore, I spent a day with the Microsoft PM for VFP in January, and he gave no indication that the future would be any different. With that said, I want to share my thoughts on what this announcement means for Visual FoxPro applications and developers.

On a DotNetRocks episode, Don Box was asked if COM is dead.  His response applies to Visual FoxPro as well.  Don replied, "COM isn't dead, COM is done."  That is the best summary I can think of regarding this announcement.  Visual FoxPro isn't dead, Visual FoxPro is done.  We can certainly unpack that in a number of ways, but I will mention two details to back up that statement.  Microsoft is releasing service pack 2 for Visual FoxPro 9 to make VFP fully Vista compliant.  Microsoft has developed a set of .NET managed extensions to VFP named Sedna, and released these extensions as shared source. 

So, we have a stable, Vista certified platform with a bunch of Microsoft developed hooks into the .NET framework.  They have provided VFP developers everything they need to maintain their existing apps on the most recent version of Windows, and they have provided the tools to extend those apps using .NET.  Now, I don't think anyone is suggesting green-field development with Visual FoxPro, but any existing investments are fully support until 2015, and extensible with development tools that are under active development.

Furthermore, Microsoft has provided a plethora of materials to help experienced VFP developers leverage their existing skills while moving to a new language and development environment.  Here are some of my favorites:

  • .NET Samples for Visual FoxPro Developers
    This is a nice collection of solutions introducing VFP developers to .NET basics using Visual Basic.  I recommend VFP developers download these samples along with Visual Basic Express.
  • Visual FoxPro Toolkit for .NET
    I love this toolkit, although I've never actually used it.  Let me explain, this toolkit provides a DLL which users can register to access VFP syntax within Visual Studio in either C# or VB.  I've never actually done that.  I use the help and the provided source code as a reference when I want to learn how to do something in .NET for which I already know the command in VFP.
  • Interop Forms Toolkit
    This is super cool.  This toolkit was developed for VB6, but works great in VFP, or any other COM enabled language.  It provides a set of COM wrappers around a Windows Forms component, so that you can launch a .NET form from within your VFP app.  This solution is rock solid and fully supported.
  • Interop UserControl
    This last tool is my very favorite.  It is not currently supported, but I've been in touch with the developers, and they are making progress on it.  They have even fixed a bug that I experienced when using this in VFP!  Quite simply, this is a project template which enables you to create a .NET user control, and register it as an ActiveX control, allowing you to display new .NET features within existing VFP forms! This is truly the secret sauce for extending existing VFP applications.

Let me explain the title to this post.  Truth be told, Visual FoxPro development will continue beyond Microsoft's current product timelines, but it will  not be called Visual FoxPro. Henceforth it will be known as LINQ, ADO.NET and SQL Server.  Members of the Visual FoxPro development team have been working on Visual Studio and SQL Server technologies for years.  Today's announcement means that they will be doing that full time. 

Alan Griver gave a presentation on LINQ at the East Tennessee .NET Users Group in January, and he made the best association I've heard for the connection between VFP and LINQ.  Alan said, "In Visual FoxPro, all data is converted to a common format called a cursor, and all data operations are made against the cursor, then updates are sent to their data source.  With LINQ, we replace the cursor with collections of objects."  That statement helped seal my enthusiasm for LINQ and the future of data access in Visual Studio and .NET languages.

I must emphasize that there is nothing to be afraid of.  There is no bad news today for VFP developers.  There is no conspiracy against Visual FoxPro.  This is a natural and logical business decision by Microsoft.  All the resources you need to continue developing data-driven software using RAD tools are available today, or coming in the next release of Visual Studio.  Let today's announcement be a reminder to you to download some code samples and read some articles so that you will be prepared for Orcas.

I want to close with a quote from Visual FoxPro MVP Craig Boyd, "If Microsoft is trying to kill VFP, then they're doing a piss-poor job of it." Amen, Craig.



 Thursday, 08 February 2007

Speaking at NashDotNet


I'll be speaking at the Nashvile .NET User Group tonight.  The topic is Windows Services, but I'm sure to get into my opinions of developer tools. :-)  If you are in the area, stop by.


 Saturday, 09 December 2006

Lambda, It's not a Fraternity


I did not study software engineering, or computer science in school.  When I began writing software for a living, I thought this was a liability.  I had a good long conversation over a bottle of Oban that changed my mind.  My good friend Wade has a BS in Computer Science and a MS in Industrial Engineering.  He also has plenty of bona fides in industry.

I expressed my concern about lack of formal training to Wade, then asked what he had learned in his CS studies.  His reply could not have pleased me more.  He told me that he came up with his own language and compiler implemented in Pascal.  I asked if this experience had directly contributed to his career, and he replied that it had not. 

While I believe credentials are important at the beginning of a career, I am more interested in what a job candidate has done than what they have studied.  I also knew then that despite having a MS in Education, I had learned the majority of what I found to be useful knowledge in that field through my own reading and experience.

That is why, dear reader, I was able to march boldly into a career in which I had no formal training and thrive.  I stopped seeing my lack of credentials as a liability.  I was already producing working software at my job, and I was studying like a fiend at home.  This continues to be my practice, and I have never regretted my lack of academic credentials, until now.

I like to follow the news at Reddit.  It seems there are a bunch of alpha-geeks who hang out there, and as a result there are an abundance of links relating to Lisp, Haskell and other "exotic" programming topics.  I read these articles out of curiosity, but I never found an application for the features that were promoted as world changing.

One of the topics that I have found particularly interesting is functional programming.  I don't fully understand it, but I have some idea of how it differs from the imperative programming that I do every day.  Recently some terminology from functional programming has popped up in my "normal" programming studies. 

Microsoft is currently cooking up an extension of it's ADO.NET data access technologies called LINQ.  This is a very interesting development, and I have been following along without actually trying the technologies yet.  One concept that shows up in functional programing and LINQ is that of Lambda Expressions.

This is where my lack of formal training shows up.  I never studied Lambda Calculus, and Joel Spolsky had me convinced that it was a useless pursuit anyway.  Now I have a keen interest in the application of Lambdas in my work.  I will attempt to share what I have gathered on the topic, as it pertains to practical software.  Any correction or clarification of this discussion is welcome and encouraged.

My current take is that Lambdas are a way of expressing value without actually storing the value in memory.  This preserves all meta-data about how the value was derived and how the values used to calculate our current value were derived.

At any point then, we can evaluate the whole thing and output a value, but we don't store the value explicitly.  The first thing I can relate this to is function pointers in C.  A pointer can point to the address of a value in memory, or the address of a function.  That's a rough association, but I need to start somewhere.

Another parallel I see is to dynamic evaluation at runtime.  I program daily in Visual FoxPro, and when I work in C# or VB I pine for the dynamic evaluation available in VFP.  While most loosely typed, or duck typed, languages can perform dynamic, runtime evaluation, VFP has true macros, and I miss them when they are gone.  Could it be that LINQ will allow me to interpret, compile and evaluate expressions (code) on the fly in .NET?

It is not only my study of LINQ that has piqued my interest in lambdas.  I have lately been pondering a problem in my free time.  I do this even though no one has assigned me a task.  When I find an interesting problem, I wonder how I would solve it.  I suspect most software developers do the same. The problem is this: How would I implement a long running (hours or days) process so that changing inputs and/or constraints do not require that I re-run the entire process to get the new results? 

My first reaction is to store all interim calculations in a data cube, so that I can recover as much of the previous work as possible before I have to recalculate.  This is a reasonable approach to a point, but I cannot calculate all possible outputs in my original run, so I will only be able to go back to the point that outputs begin to change, and re-run the process from there, and in some cases this would mean running it from the beginning.

It seems that in this scenario the business rules, or constraints, matter as much as the explicit inputs. In fact, the business rules are inputs to the expression building engine, while the data inputs are passed to the built expressions.

I conceive of this like a query execution path in a SQL engine.  Once the system has determined how best to evaluate the query, much of the work is done.  You can then change the inputs to the query and the server will evaluate it the same way it did before.  My hypothetical, long running, complex process benefits from a similar approach.  Determining how best to evaluate the inputs is half the work, and this is defined by the constraints in the same manner as the table schemas and indexes determine how a SQL engine will evaluate a query.

It now appears imperative when executing a long running process with high CPU requirements that we record how we solved the problem as well as what the solution was.  In this way we could run the process from the start with new inputs and simply re-evaluate the pre-built expressions.  We could also change our constraints and only rebuild the expressions affected by the changes. 

This approach also allows us to solve the problem iteratively.  By setting thresholds on how detailed we want our expressions to be, we could form estimates, and then run the process again building ever more detailed expression trees, asymptotically approaching a precise answer.

This appears to be what functional programming is built on.  This lack of "side effects" also has other practical advantages such as thread safety and high parallelizability.  At least one functional programming advocate is willing to argue that these advantages qualify functional programming as a silver bullet.

 In this context, a silver bullet means that the technology provides an order of magnitude improvement in productivity and or performance.  This is a bold claim, but some of the arguments are persuasive, if not for a full order of magnitude, then for significant improvements. My favorite argument from the above linked essay applies directly to my hypothetical long running process:

The order in which statements are executed, and hence the execution trace of the program, is completely irrelevant. Thus execution order is revealed as a major source of accidental complexity which Brooks mistook for essential complexity, but which is eliminated in pure functional programs.

 If execution order is truly inconsequential, then we can modify our constraints and inputs constantly in order to arrive at the optimal result.  It remains to be seen if I can design a solution of this type in .NET with the new LINQ extensions, or whether I'll need to dive into Lisp, Scheme, Haskell, Erlang et. al.  One thing that is certain, is that I'll find out, and I'll share my understanding here.  Now, if you'll excuse me, I have some reading to do.


Everybody's Got One


I like to write code.  It isn't the best way to solve every problem, but when it is the correct solution, I love to lose myself in code.  Unfortunately, I seldom start from a clean slate.  Most tasks involve correcting, extending or interacting with "other people's code."

This is why the post My Personal Pet Peeves I See in Other People’s Code by Ramon Leon was so much fun to read.  I know where he's coming from, and I enjoyed his ho holds barred ranting.  Sometimes you just gotta' let it out.

Still, I found myself arguing with Ramon in my head, "Hey, that's the way I write code.  There ain't nothin' wrong with that!"  Except, maybe, just maybe, there is, unless there isn't.  My point is that while we all have opinions, it is a slippery slope to create too may concrete rules regarding style.  Like the pirate's code, "they're more like guidelines."

So, what follows is my rant about Ramon's rant.  If I don't argue with one of his points, then the reader should assume that I share it.  Let's get started:

Ignorant Prefixing:  I agree, except in cases where there is already a large code base using this style of naming.  Then the rule for consistent style takes precedence.

Single Exit Points:  I largely disagree.  If a method is small enough to fit on a single screen, it is simple enough to have a single exit point.  My one exception is to put something like the following at the top of a method:

If (noChanceInHell) return false

1000 Line Methods:  I like the rule of not having to scroll when reading a method, although in practice, I break the rule as often as I comply.  I wholly agree that the method name should be the only documentation needed about the purpose of a properly atomic method.  In fact, more developers need to read chapter seven of Steve McConnell's excellent Code Complete to learn how to properly name routines.

Declaring Variables at the Top of a Method:  I agree with the dictum to declare variables at the minimum scope, but when the minimum scope is the method,  as opposed to a loop, then I like to see them declared, and initialized, if reasonable, at the top.

Error Code and Switch Statements:  I like to return a bool from my methods.  Many routines are just initializing some environment for the Main Event®.  In such cases I will use the following structure:

LOCAL returnVal as Boolean

returnVal = .F.


  CASE NOT DoThis()

  CASE NOT DoThat()

  CASE NOT DoTheOther()


    returnVal = .T.


RETURN m.returnVal

The reason I can do this, is that I program primarily in Visual FoxPro.  You just can't do this in VB and C# switch statements.  I am bitterly reminded of this every time I work in either of those languages.

I admit to ignorance of the Samurai Principle, and I can definitely see it's application, but there are many cases where I would rather check for a boolean result than do yet another try catch (YATC).

Overall, Mr. Leon's rant is well informed, entertaining, and educational.  Highly recommended.


 Wednesday, 06 December 2006

UML Sucks (Really!)


I recently received a comment on my blog about a comment I made on another blog.  Ain't the Internet great?

Here's the response I sent:

Hello Nick,

Thanks for alerting me to the need for a contact link on my blog. :-)

While I don't use UML, and neither do any of my coworkers, I have mixed feelings about the need for it.  It seems perfectly reasonable that we should agree as an industry on a common set of symbols to represent OOP concepts, but UML has a typical "design by committee" feel. 

In his comments to the "5 Books" post, Jonathan Allen brought up something that I was aware of,  but never expressed precisely.  He said that the object model is the most malleable part of the design.  This is absolutely true.  This is actually the conceptual basis for iterative, agile practices.  The most critical aspect of the initial design, in my experience, is the interface between the UI and the object model.

While changing the UI is frustrating for users, it is not a technical challenge.  Refactoring the middle tier requires discipline to avoid introducing errors, but should not affect other parts of the system.  It is a well designed interface contract that makes for an extensible system.  This is why SOA with its service contracts is appealing.

Unfortunately, UML doesn't address interfaces (or at least poorly addresses them).  It seems obsessed with minutiae in a parody of academic distraction.  The only time I see UML in my daily development is in technical books and articles, and even then a Visio diagram would usually work better.

With regards to your objective of developing "ways to improve UML interaction to be more practical," I encourage you to ignore UML initially and define your problem clearly.  It seems to me that the problem does not involve UML, but the need for communication between developers, sometimes from different cultures, and on separate continents.  You are most likely interested in the visual display of information as it pertains to object oriented analysis.

If I am correct in my assumptions, then I do have some resources to recommend.  As I mentioned in the blog comment that you referenced, Peopleware is essential reading for understanding the human interactions surrounding software development.  For understanding objects, and by understanding I mean grok in fullness, I have found nothing better than The Object Primer.  Finally, when it comes to the visual representation of information, there is only one person you need to study, and that person is Edward Tufte.  Tufte makes mincemeat of systems such as UML.

If you are looking for a software solution to capture design ideas, then you should be familiar with mindmapping applications such as Mindjet or FreeMind.  I also have begun using Microsoft OneNote and have found it useful.



 Tuesday, 07 November 2006

Please Don't Name a File Setup.exe


After doing all the downloading from my previous post I have one big request from the software development community.  Please don't name your install file Setup.exe.  Try instead Setup<Application Name><Version Number>.exe or some varient of that.

I just downloaded the Windows SDK and the file was named setup.exe.  I download all files to the same directory, and decide what to do with them from there.  I don't want to have to rename your file in order to prevent it from overwriting another file with the same name.

While I'm on this little rant, I'm tired of iTunes always downloading with the name iTunesSetup.exe with no version number.  It seems rude to me for Apple to assume users want to overwrite the previous version they downloaded, and thus lose the ability to roll back to a previous version if they don't like the upgraded "features."

Thanks, and have a nice day.


 Wednesday, 20 September 2006

FoxForward Conclusion


I skipped morning sessions on Saturday so that I could prepare some changes for my demo that my coworkers recommended.  I did make it to lunch, however.  <S>

In the afternoon, I saw David Stevenson's sessions on the CursorAdaptor and XMLAdaptor respectively.  David showed some interesting functionality he had implemented in his CursorAdaptor subclasses.  I'll need to wade through the code to fully absorb what he showed.

David's session on the XMLAdapter started as I would have expected, comparing XMLAdapter functionality with CursorToXML() and XMLToCursor().  Things got more interesting when he began working with the XMLTables and XMLFields collections directly.  By the end, he was loading schema-less XML with embedded elements and showing us how to use Xpath statements to map this format to related cursors.  This tip alone is worth the price of admission to this conference for any developer who has spent his time trying to solve the conundrum of emended elements without foreign keys.

Saturday evening at the Ale House I tried a delicious local brew called a Sweetwater420.  I also had a great time talking with other attendees.  I especially enjoyed meeting Ed Leafe.  Ed is the author of the Business Object base class in CodeBook.  I have spent many hours studying that code and learning from it.  It is satisfying to have the opportunity to thank someone in person for helping me along my way.

While we were talking at dinner, I was reminded that Ed is the source of one of my standard practices.  It was in Ed's code that I first saw the GarbageCollect() method which NULLs out any properties with values of VarType = "O".  These days I use Bindevent() to bind destroy to my CollectGarbage() (renamed to fit the coding standard :-) ) method in my base classes.  orphaned object references are one of the most frustrating problems to debug in FoxPro, and this simple fix removes them forever.

Next I moved to Craig Boyd's booth, because I hadn't had the opportunity to do more than introduce myself to him.  Craig is a passionate guy, and we got into a discussion of the FUD (fear uncertainty and doubt) being spread by some parties regarding Visual FoxPro and .NET.  I love these type of discussion.

Sunday morning was showtime for me.  I spent the morning testing my demos one more time.  Saturday night, I discovered a bug involving spaces in a file path, so I felt it was prudent to test everything one more time.  Although my session was sparsely attended, the audience seemed truly interested, and actively engaged.  I enjoyed this session, even though I was the presenter.

After my session was lunch, where I won a VFP hat!  I spent some time on the back patio listening to Ed Leafe and John Koziol swap stories about conferences past, and ask each other "where are they now" about members of the VFP developer community.  This was a nice bonus.

The last two sessions, for me at least, where Craig Boyd's discussion of cryptography, and Bo Durban's discussion of the new GDI+ classes from the VFPx project.  These were both awesome sessions.  I already use Craig's vfpencryption.fll in my work, and he showed me many new uses for it.

I've been working with GDI+ lately using both the flat API, and the VFP foundation class.  Bo's session showed me that I need to stop wasting my time and focus on the VFPx class library.  There is more in there than I can possibly relay.  Bo had a nice interface to launch samples and then show the code.  When I got home, I downloaded that library and found that the form Bo used is included in the .zip file.  In fact, there is a .APP file you can run and see most of what I saw without driving to Atlanta.

The biggest surprise to me was that the library included a class for accessing resources in uxtheme.dll.  I have seen several attempts by VFP developers to produce custom controls that reproduce the visual style of Windows XP.  The problem with every implementation I had seen before, was that they mimicked the default blue theme.  If the user ran a different theme, the Visual FoxPro control would not display the new visual style.

By documenting the API to uxtheme.dll for VFP developers, the VFPx developers have made this issue a thing of the past.  I have already begun implementing a Theme Explorer UI in the style of the VB app that pointed the way for the VFPx team.

Speaking of VFPx, an audience member offered to help work on one of my proposed Team Foundation Server tools after my session.  I told him I would speak to Craig about putting it in VFPx.  Craig told me where to find the application form.  I've since submitted my application, and I hope to be contributing to VFPx soon.

In summary, I think Kevin Culley did an outstanding job of putting this conference together.  I predict that in the coming years there will only be two VFP conferences worth attending.  Southwest Fox in the West, and Fox Forward in the East.  I know I'll be back next year.


 Thursday, 14 September 2006

Cool new TFS Extension


Bernardo Heynemann has put together the beginnings of what I'm  sure will turn into a popular extension to Team Foundation Server.

Project BHAL merges Windows Workflow Foundation with TFS work item tracking to allow an organization to define a custom workflow tuned to their particular environment.

I have had requests for similar functionality, and I have written custom webservices to fire on certain WIT events.  This approach is very attractive, because it allows for much more flexible configuration.

In a recent DotNetRocks episode, Joel Semeniuk was bemoaning the lack of exactly this sort of feature in the current version of TFS. 

Good on ya', Bernardo!  I hope I can contribute once I get my production process template deployed, and all the users happy. :-)


 Monday, 03 July 2006

ORM and the Fox (Part 1)


I have been moving quickly between tasks since my return from Boston.  I'm finally taking some time off for the Independence Day holiday.  Floating in the pool, I keep finding the subject of Ted Neward's essay coming to mind.  It appears I still have something I want to say about ORM.  In this series of  posts, I hope to explain why Visual FoxPro has more mojo for resolving Object Relational Mapping issues than any other technology, of which I am aware.

At the speaker's dinner for the Atlanta Code Camp, I discussed LINQ with Charlie Arehart, and Wally.  I brought up the doomed Object Spaces project, and quoted Ted Neward's pithy line that "Object relational mapping is the Vietnam of computer science."  It is a good line.  It is also true, as much as a pithy metaphor can be true.

Now that Ted has expanded his metaphor, we can see the limitations of metaphor in general.  I recommend Jeff Atwood's analysis of Ted's essay.  I agree with everything Jeff has written there.  Primarily, I agree that Ted tried too hard to stretch his Vietnam analogy which distracted from his primary, quite sound, thesis that "there is no good solution to the object/relational mapping problem."  Full stop.

Despite any over-reaching in support of his Vietnam analogy,  I must state clearly that Ted Neward is possibly the most qualified person in the industry to make the criticisms he does of ORM.  Here's a short bio with his credentials.  Suffice it to say that he is not arguing from a position of ignorance.  Ted works with many technologies, and has seen the limitations of ORM manifested in different languages and platforms.

To continue with my love letter to Ted, he acknowledged something that few people in the industry are even aware of.  Visual FoxPro eases the dissonance between objects and relational data better than any other technology on the planet.  I first came to this realization upon reading this post by Joel Spolsky in 2004.  Joel identified the impedance mismatch between objects and relational data as a shortcoming in all modern programming languages.  Joel didn't bother listing VFP among "modern high-level programming languages."

I'm not going to bitch and moan about the low profile of VFP.  I know what it can do, and it's been earning me a decent living for years.  I just can't believe other languages have not done a better job of "borrowing" the best of what VFP does.  I'm damn tired of all the LISP articles on Reddit telling me how I'm missing out because my language of choice doesn't have feature foo which LISP has had since the '60's.  I also take issue with Paul Graham's essay about the RAD nature of LISP for startup companies.  Any experienced VFP developer could easily make the same arguments in favor of the Fox.

When I first saw Ted's mojo comment, I felt vindicated.  I made a quick post, and forwarded the link to "the Craigs".  I secretly hoped they would write this argument for me.  Fortunately, I have to sort this one out for myself.  I am currently developing an object interface to encapsulate a VFP cursor.  This is totally unnecessary in Visual FoxPro, but I need to leverage my object model from .NET, so I must encapsulate all the tasty VFP goodness behind a COM interface.  This is the ultimate test of VFP's ORM mojo in my experience to date. 

It is my contention that the "secret sauce" to VFP's ORM mojo is the cursor.  A VFP cursor is a data structure like no other.  Most non-VFP developers associate VFP with the DBF storage format.  People seem to assume that it is "just" a database.  Visual FoxPro does have a very powerful in-process data engine which includes a wickedly fast ISAM storage format, but it can use data from any source as a cursor with that same data engine.  This is where we find the secret sauce. 

Other languages need to map data from relational sources to primitive types such as arrays or dictionaries (collections).  The ADO recordset is actually an object oriented implementation of VFP's cursor engine.  The ADO.NET dataset takes this further to include relations in the definition.  Strongly typed datasets are a particularly easy way to handle data in managed code.  The advantage that VFP has is that it handles data in cursors natively.  That is what it is made to do.  Handling data in a columnar format, and setting relations between these table-like data structures is the core of the VFP mission.

VFP developers use SQL commands as first class citizens of the language.  They are handled by the runtime in the same manner as conditional and looping statements such as IF and FOR.  There is no conceptual difference to a VFP developer between addressing a local variable, a property on an object, or a field in a cursor. 

Let's pause for a moment and refine our terms.  Here is what Whil Hentzen has to say about VFP cursors in his excellent (though out of print) introduction to VFP development Fundamentals: Building Visual Studio Applications on a Visual FoxPro 6.0 Foundation:

We’ve been using the term "result set" to refer to the collection of records created by the execution of a SELECT command. While Visual FoxPro is "record oriented" in that we can move from record to record as we desire, other languages that use SQL do not have this capability and can only address a block of records as a single entity. As a result, all SQL operations are oriented toward manipulating this "set of records." They refer to this block of records as a "cursor," which stands for CURrent Set Of Records. A cursor is a table-like structure held in memory; it overflows to disk as memory is used up. In some cases, such as queries that essentially just filter an existing table (in other words, no calculations or joins), Visual FoxPro opens a second copy of the table in another work area and then applies the filtering condition to present a different view of the table as the query requests it.

Cursors have two advantages. First, they are fast to set up, partly because of the possible filtering of an existing table, and also because of their initial creation in RAM. Second, maintenance is greatly reduced, because when a cursor is closed, any files on disk created due to RAM overflow are automatically deleted.

I hope it is clear from the above that any data that can be understood conceptually as a row/column data source can be handled very elegantly by VFP.  The key point to recognize is that the data runtime and the language runtime are one.  They even share a common garbage collection mechanism, which you can read about here.  VFP developers are able to enumerate, search, sort or perform set based operations against one or more cursors without making a context shift from the surrounding procedural code.

Cursors are not perfect.  They are not objects, and can therefore not be passed around by reference.  There are two workarounds for this conundrum: ADO recordsets, and XML.  I use XML exclusively.  I no longer consider ADO recordsets to be a maintainable solution.  While the shortcomings of XML are well documented, the flexibility is irresistible.  Furthermore, the VFP XmlAdapter class makes it a snap to translate between cursors and XML, and even take and apply diffgrams.  Therefore, I use XML whenever I am passing data across object/process boundaries, and I convert the XML to VFP cursors within my object interfaces. 

In the next installment on this subject, I will address the object component of Object Relational Mapping.  For now, I hope that I have clarified that Visual FoxPro is not "just" a database.  From my perspective, it is primarily a runtime library for the Visual FoxPro language which seamlessly blends typical imperative programming constructs with relational data handling.


 Wednesday, 28 June 2006

Visual FoxPro Mojo

I have been trying to formulate a response for the OR/M issue brought up by Ted Neward, but he has done it for me:

“And, although I will likely gather some serious heat for saying this, Visual FoxPro may have some of the most interesting "best of both worlds" mojo in the entire language space on this subject.”

 Saturday, 17 June 2006

Tech Ed 06 Day 5

The last day of Tech Ed is different from all the others.  Many people have left already, and all the big announcments have been made.  They do schedule some excellent presentations for Friday, so it is worth hanging around for.

I did manage to attend another session Thursday afternoon.  Steve Lasker gave a presentation about occasionally connected systems.  This talk covered the current and future technologies available from Microsoft to deal with moving data offline, then syncronizing with the server when after returning online.  Good session on a very relevant topic.

Thursday night's party was great fun.  I skipped the ball park food, and went to the upper levels where they had a buffet, and beer options beyond Budweiser products.  I met up with my buddy Jim Topp, and we took in the concert, as well as a significant number of Samual Adams Boston Lagers, together.

The opening act was fine, but not inspiring.  Train was excellent.  They are definately a party band.  Along with all their own songs, they did two Zepplin covers, and closed with Aerosmith's "Dream On".  I would definately pay to see them again.

By Friday morning, I had answered, or at least addressed all of my TFS issues.  Before leaving for the party on Thursday, I brought Randy Miller a printout of CMMi KPAs not fullfilled by the MSF Guidance that my CMMi manager put together.  Randy's response was, "You rock!"  I'm looking forward to working with Randy, and Kevin Kelly as we move forward.  One member of the team with whom I didn't get to talk to enough was Noah Coad.  Noah was at the BOF sessions on Tuesday, but we only spoke briefly Wednesday morning. 

My first session on Friday was Architecting Your Own Enterprise Framework with Brian Button.  Brian shared the lessons he learned working on the Enterprise framework in the Patterns and Practices group.  I plan to download the slides when I return to my office, so I can review the wisdom contained therein.  Brian shared what worked for his team, and what didn't.  The most prominent idea that I left with was the "Rule of 3".  If you see a solution implemented three times, then it should go into a framework, but not before.  According to Brian, frameworks are not developed in the heads of designers, but should be extracted from working code.  This guidance basically follows the YAGNI principle.

During a half-hour break, I caught up with /\/\o\/\/ again to ask him about PowerShell resources for developers.  He pointed me to  Windows PowerShell Programmer's Guide  Unfortunately, it is not currently available in a printable format, but this is an exciting find. 

My next session was Rapid Development of Data End-to-End Solutions and How They Work in an N-Tier Model given by Jay Schmelzer. This was the most code-intensive session I saw all week.  Jay dispensed with slides, and built a data access compenent and windows form to connect with Northwind.  Next he migrated his DAL to a webservice, and showed the changes required to maintain full functionality in the application.  Jay is very energetic, and this was a fantastic session.

My final session after lunch was Architecting Applications for a Service-Oriented World.  Beat Schwegler did an admirable job making SOA appear to be a real technology/architecture.  In contrast to the previous session, Beat used slides exclusively to walk us through a conceptual scenario focusing on maintaining existing IT systems investments, while adding additional value by connecting legacy systems through service contracts.  This is the first time someone has convinced me that SOA is more than just a marketing term from Microsoft.

Throughout the conference, the continuous themes were quality and value.  Microsoft is providing tools to insure quality in the software I produce, while it is up to me to insure that I am producing the right software.  If I build a quality product that doesn't meet the needs of the user, then I have not added any value.

 Tuesday, 13 June 2006

Tech Ed 06 Day 2


The first session I tried to attend was full!  I can usually walk into a session late and sit on the front row.   Apparantly, LINQ is a popular topic.  I'll catch the replay on the DVD.

I did attend a session on "Evolving to Patterns" which was actually refactoring to patterns.  I discovered that something I've been doing for years is called Dependency Injection.  It's nice to be assured I'm on the right track. 

The speaker recommended Working Effectively with Legacy Code, which looks like a useful text for my current job.  He also liked Refactoring to Patterns.  I plan to check them both out.


[Update] I met Josh Holmes at breakfast this morning.  I also got the skinny from Steve about a cool cigar bar here in Boston. ;-)  Steve is actually blogging again, so check it out.

I had a good, long talk with two members of the SQL Everywhere team this morning.  They were very interested in my concerns about FoxPro interoperability.  I had to take some time to explain the VFP development model, but they listened carefully.  The biggest roadblock I see at this point, is the lack of ODBC connections in SQL Everywhere.  They do support OLEDB connections, but the native SQLCONNNECT() function uses ODBC.  I will download the CTP and play with it when I get home.  I promised to post my feedback to the forum for their benefit.

The BCEC is enourmous and attractive, but it is difficult to navigate.  It is sometimes impossible to get from A to B.  Furthermore, the bathrooms are totally inadequate.  This is a modern building, and I expect an abundance of facilities!

[Update2] I got some time in with Ken Levy, and I was blown away.  It turns out that Live is another case of lousy branding by Microsoft.  Live is actually a collection of Web APIs that the team is attempting to normalize.  They will all eventually have common programming models.  In addition, they are implementing javascript libraries with similar programming models, so that a developer can program against a client side javascript object and allow that to converse with the web services.  I was very excited by this demo.

During lunch, I attended a session on managing requirements with Team Foundation Server and MindManager.  Michael Scherotter put together a tool that provides bi-directional interaction with TFS work item tracking.  This is very exciting for visualizing requirement/task dependencies at various levels in the task hierarchy.

[Update3] I just spoke with Steve Lasker about SQL Everywhere and Visual FoxPro.  He is a former VFP developer, and understood my concerns.  He mentioned that he is in regular contact with Calvin Hsia, which put my mind at ease.  Steve also pointed me to this recent blog entry where Calvin demonstrates working with SQL Everywhere.

[Update4] I just finished the first Birds of a Feather session this evening.  Joel Semeniuk led an informative discussion about project management with Team Foundation Server.  I picked up some tricks about configuring MS Project to work properly with TFS.  I'll share the details once I have tried them out.  More BOF sessions to come.

 Tuesday, 02 May 2006

I'm Speaking at DevLink 2006

devLink Technical Conference 2006This is going to be lots of fun. 

Already they have Eric Sink and Kevin McNeish on the schedule.  I'll be busy trying to act cool.  You know, I hang out with these guys all the time.  They're not my heroes or anything.  No really, I'm cool.


 Wednesday, 26 April 2006

Windows PowerShell


According to this, PowerShell nee MSH nee Monad is on the verge of release.

This is exciting news for me because I spent this week learning the tool. I have had requests to make bulk updates to work items in Team Foundation Server. I decided to investigate MSH as a platform for creating custom scripts to fulfill this request.

Now that it is on the verge of release, I won't have to overcome resistance to deploying pre-release tools. Life is good.


[UPDATE] Keith Hill suggests some new acronyms for the Windows PowerShell.  I vote for POSH.

"Oh the posh posh traveling life, the traveling life for me..."

PoSh | Programming | Tools | VSTS    Comments [0]
 Wednesday, 22 March 2006

Speaking at FoxForward

I just got my confirmation that my presentation on integrating Visual Studio Team System and Visual FoxPro was accepted for the FoxForward conference in Atlanta.  I love sharing my enthusiasm about these tools.  This is going to be lots of fun!

Mark your calendars now:

Fox Forward 2006 - Alpharetta, GA USA - September 15th-17th

 Tuesday, 13 December 2005

iTunes and Windows Media Player Play Nice

I've been playing with Home Theater PC software for a couple years.  I settled on Windows Media Center Edition as my platform a few months back. 

It isn't the best, but it is the easiest.  It works out of the box, and has a great remote preconfigured.  I got tired of fiddling, and wanted an appliance that just worked.  MCE discourages fiddling, because it isn't as configurable as other packages.

The one drawback for me in using MCE is that all my personal CDs are ripped as iTunes AAC files.  Actually, every HTPC front end I tried had this drawback, so it wasn't unique to MCE.  Fortunately, MCE uses the media library from Windows Media Player.  Getting WMP to play AAC files is a snap using the 3ivx codec.

The trouble begins when you want to see tag info.  You won't see any artist, album or track info after you add the files to WMP's library.  In fact, you may find your AAC files in the "Other Media" ghetto... er, I mean node.

So here's the fix I worked out:  Remove all AAC (.m4a) files from your WMP library.  Apply the m4a.reg registry patch linked below.  Add the AAC files into your WMP library.  At this point you should be ready to run my little import app, but there's a caveat. 

If your music is on a network drive, you need to be sure that it is added to iTunes using the UNC path. (e.g. \\computer\share)  WMP will add the files mapped this way even if you have the share mapped to a local drive.  Since I use the fully qualified file name as my means of relating the tracks in both libraries, this gave me some trouble.

The program (iTunes2WMP.exe) included in the .zip file below doesn't actually enable WMP to read the tags in AAC files.  It reads the relevant information (artist, album, etc.) about a file out of the iTunes library, and then writes it into the WMP library.  The result is the same as if WMP had read the tags directly.

I didn't set out to write a program to do this.  I tried two utilities that I downloaded (from a forum that shall remain unnamed), and they both sucked.  Not only did they not work for me, but the code was embarrassing to read.  When I don't know what I'm doing, I try to copy someone who does.  I can only assume that these people don't realize that they don't know what they are doing.

I wrote this utility in C# 2.0 because I wanted to try out some of the features of the new release.  I can report that code snippets are a terrific productivity boost in Visual Studio 2005, but the real super-duper feature for 2.0 is generics.  I created a strongly typed dictionary with one line of code, and I assure you that I did not know what I was doing when I started.  It's just that easy.  .NET generics are THE BOMB!  "Stone guaranteed to blow your mind" as James Taylor would say.

If you use this utility, I'd like to hear your comments.  I don't promise to make any improvements.  That's why you have the source.  I would just like to know if others find it useful.


PS: The following files are provided without warranty, or assurance of fitness for any purpose.  They could melt your synapses, give you bird flu or worse, crash your system.  If they do, I'm not responsible.  Got it? (68.03 KB) m4a.reg.txt (.66 KB)
 Sunday, 27 November 2005

Sleepless Nights


It appears that I am causing others to loose sleep. :-)

 Thursday, 10 November 2005

Lazy Programmers


I've long said that all programmers are lazy.  There are two kinds of lazy, though.  Good lazy is when a programmer has to do something twice, she stops to automate the process, so she won't be bothered by this rote task again.  Bad lazy is when a programmer uses "clipboard inheritance", mindlessly copy and pasting code, and not stepping back long enough to find a better solution, much less the "best" solution.

This was brought to mind again by a post by Phillip Lensen (via Foxpro.catalyst):
Why Good Programmers Are Lazy and Dumb
I hadn't considered the dumb part, but I do look for a drive to constantly investigate and learn when evaluating a job candidate.  Phillip makes some interesting points.

 Wednesday, 09 November 2005

Oh, Great


NPR says:

Software Industry Sees Robust Growth in China

At least I work for a military contractor.  I don't expect my job to go to China (or India) any time soon.


 Tuesday, 08 November 2005

Free Visual Studio 2005 Training from Microsoft


For 90 days, you can sign up for free classes on MS's latest developer products here:

I've used some of their e-learning materials before, and found them helpful.  YMMV


Macdesktop in a Windows Application


I love Visual FoxPro.  I love .NET too, but the platform hasn't had time to develop really interesting historical quirks.  VFP is increadibly backwards compatable.  I was reminded of this again today while reading the WIKI.  I saw this little command that moves the project manager outside of the VFP IDE and onto the taskbar.  Not terribly exciting until you consider the syntax, which comes from a time when FoxPro ran on DOS, UNIX, Mac and Windows.



 Monday, 07 November 2005

Retries Considered Harmful


I take what Raymond Chen says about coding as gospel.  Therefore when he says not to retry a failure, I won't.


The Place I'd Most Like to Work

I'm a huge fan of Joel Spolsky's writing on  He makes his shop sound like THE place to work as a software developer.  That's why I'm jazzed about the new DVD about the most recent project from Fog Creek Software.  It's a documentary about the experiences of their summer interns.  Check out the preview here:


My (former) Dilbertesque Life


This is in no way a comment on my current employer.  In fact, they continue to impress me with their rational approach to software development.  My previous employer, however, is represented in many ways by this story: