Thursday, December 06, 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

Enjoy,

++Alan

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

Cheers,

++Alan

 Tuesday, November 06, 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.

++Alan

 Saturday, November 03, 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, del.icio.us 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!

++Alan

 Wednesday, October 31, 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.

Cheers,

++Alan

 Thursday, September 20, 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.

Cheers,

++Alan

 Thursday, July 05, 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.

Enjoy,

++Alan

 Tuesday, July 03, 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. :-)

Cheers,

++Alan

 Monday, July 02, 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.

Cheers,

++Alan

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.

Cheers,

++Alan

 Wednesday, June 13, 2007

What's Your Programmer Personality Type?



# 

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

DHTC

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.

Cheers,

++Alan

 Wednesday, June 06, 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?

++Alan

 Tuesday, June 05, 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.

Cheers,

++Alan

 Saturday, June 02, 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,

++Alan

 Thursday, May 31, 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.

Cheers,

++Alan

 Tuesday, March 20, 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.

Cheers,

++Alan

 Wednesday, March 14, 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.

Cheers,

++Alan

 Thursday, February 08, 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.

++Alan

 Saturday, December 09, 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.

++Alan

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.

DO CASE

  CASE NOT DoThis()

  CASE NOT DoThat()

  CASE NOT DoTheOther()

  OTHERWISE

    returnVal = .T.

ENDCASE

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.

++Alan

 Wednesday, December 06, 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.

Cheers,

++Alan

 Tuesday, November 07, 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.

++Alan

 Wednesday, September 20, 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.

++Alan

 Thursday, September 14, 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. :-)

++Alan

 Monday, July 03, 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 orient