This blog has been moved to Redwerb.com.

Thursday, June 28, 2007

Orcas Workshop: Day Four

Last day of the workshop went well. I'll be sad to leave the prepared lunches, snacks, ice cream, etc at Microsoft, but I won't be sad to leave those horrible chairs (my back is killing me).

Most of today was on Microsoft Office integration with a short bit at the end for Team System. I left a few minutes early hoping to avoid the traffic on my way home, unfortunately my plan didn't work out that well (2 hours!).

Office Integration

  • OBA (Office Business Applications) enable MS Office products to deliver business services in the form of add-ons. It is not a product, but a technical concept. OBA bridges the gap between unstructured processes (individuals making up their own process, such as storing notes in Word documents) and structured processes (line-of-business applications).
  • SharePoint is an important aspect of OBA.
  • VSTO (Visual Studio Office Integration) is the bridge between Visual Studio and Office. It will be shipped with Visual Studio 2008 Professional edition.
  • The visual designers that come with VSTO look great. If you are extending a Word document, you get a designer that looks like Microsoft Word. If you are extending just the ribbon control, you get a designer that looks like the ribbon. You can add controls and hook up event handlers the same way as with WinForms development. Very easy.
  • Debugging is easy too. Simply press F5 and the Office product that you are extending is started and your add-in is loaded and run. You can place breakpoints in your code in order to step through it just like any other VS project.
  • VSTO for Orcas has improved security and deployment. I'm not entirely sure what this means since I'm not a VSTO developer, but if you are, this might be interesting to you.
  • VSTA (Visual Studio Tools for Applications)  is the underlying infrastructure for VSTO. It is essentially managed code macros.
  • The code that you write for VSTO is separate from the document. The assembly must be installed on the client in order to be used. You are also able to deploy it on a remote server, but the client will need to be able to access that server in order to use the macro (it is configured using a manifest file).
  • The Office ribbon control is extensible through XML.

Visual Studio Team System

  • There isn't much new stuff coming out in Orcas for Team System (it is considered a point release for VSTS).
  • Rosario is the next major version of VSTS. It will offer better project level management and test case management. I'm not sure what the release date for this is.
  • Rosario will support dependencies between work items.
  • The source control built-in to VSTS allows for cherry picking changes. This allows you to make a hot fix to production code within the development branch without having to include all of the changes since that was released (of course a person will need to determine if that is reasonable or not).
  • You can setup a proxy for remote offices that will cache source code so that when you request a version that is already cached, you get that instead. This is very useful when dealing with remote locations with slow connections.
  • If after setting up your VSTS project you need to add a field to your work items, Power Tools 1.2 provides the ability to do this graphically. (apparently there is a video that was posted somewhere recently that shows how to do this, I wasn't able to find it though)

PowerPoint Presentation

I downloaded the PowerPoint presentations from the workshop. If you would like me to email you one, just mention which one you want and leave your email address. I don't feel comfortable just putting them on the Internet, but I don't see why Microsoft would care if I shared them (they said it was ok to download them and there wasn't any NDA that I remember anyway). If you want one, please note that they were built with PowerPoint 2007. If you don't have PowerPoint 2007 you will need to download a 28MB Office Compatibility pack.

Well, this ends my Visual Studio 2008 and .Net Framework 3.5 Workshop journal. I hope you enjoyed it. I'm excited to see the final release of VS 2008.

Wednesday, June 27, 2007

Orcas Workshop: Day Three

Three days down, one to go. There was a great presentation on WCF (Windows Communication Foundation) today! I'm really impressed with some of the stuff they provide out of the box for free. They also talked about WF (WorkFlow) and mobile devices.

WCF

  • Microsoft says that WCF is the next generation platform for building distributed systems (and I haven't even gotten the chance to use the last generation platform).
  • WCF provides the infrastructure to hook up any number of different protocols to a published service. This can be SOAP, REST, or any number of different protocols (there are a lot of them that WCF understands).
  • End points are essentially the transport layer for calling a service. A single service can have multiple end points defined for it (so it can be called using SOAP, REST, etc). The developer does not have to write any code to hook up these end points, it's handled by WCF. The end points can be created in a post-deployment scenario using configuration files.
  • 3.5 offers a lot of new features such as better tooling support for building and debugging services. There is a service host similar to the ASP.Net debugging host that will run so that you can test your services without having to setup your own server. There is also a WCF client that will allow you to call any of your services, including setting parameters and viewing return values. This will allow you to set break points in  your code and debug into it. These should be available in the beta 2 (I don't believe they are in the beta 1).
  • 3.5 includes 1st class support for REST, syndication, JSON (JavaScript Object Notation), Oasis, and WF (I'm sure I'm missing a bunch!).
  • There is an SDK available for syndication that I believe will run using the 3.0 bits at http://labs.biztalk.net. The name of the SDK is BizTalk Services SDK. You should be able to just reference the assembly that exposes the syndication library in order to use it (sorry, I don't remember exactly which one it is).

WF

I didn't find this presentation as interesting because I already know something about it and it doesn't look like they are adding much for 3.5.

  • WF is the software implementation of the business process or business logic.
  • WF is a lightweight process (as compared to other workflow services available)
  • Provides the infrastructure for maintaining state over a long running process.
  • A workflow can be a flow chart, state diagram, or rules based.
  • WF can be built using either code or markup
  • 3rd party designers available for designing workflows and saving as XML
  • Context Exchange Protocol allows for long running workflows. This works on a similar concept as cookies so that the workflow instance can be re-constituted when new events arrive.
  • WF provides static role based authorization as well as dynamic (code based) authorization.

Mobile Apps

There seems to be a lot of cool new features for mobile devices within the Orcas time frame, especially for developers.

  • The designer surface in VS08 can be made to look like the mobile device that you are targeting.
  • The emulator starts quickly once you have saved the state (otherwise it has to load tons of stuff when you start it).
  • You can create unit tests the same way as you would any other project in VS08. The emulator contains the testing framework. When you run the unit tests, the emulator starts and the unit tests are loaded onto it and run.
  • The emulator can be easily configured using XML to test different deployment scenarios such as RAM, screen resolution, screen orientation, battery level, etc (I'm sure you get the picture).
  • There is a device configuration manager built into VS08 that allows you to change the security context of the device.
  • If you want to connect to devices from a desktop application, you can use the Microsoft.Smartdevice.Connectivity.dll. This will let you discover any devices connected to the computer and connect to them.

Compact Framework

  • In order to make the compact framework fit on the device, many features had to be removed. This includes many libraries that weren't that useful on the device (such as the ASP.Net assemblies) as well as removing many classes and class members from the ones that were left. The end result is around 6MB.
  • Version 3.5 of the compact framework will include WCF capabilities, however, in order to meet the size requirements, much of the WCF was stripped out. This makes it more difficult to use WCF on a mobile device, but at least it's still possible.
  • 3.5 will be supported by all devices that support 2.0. You will just need to deploy the 3.5 piece.
  • Due to the occasionally connected environment and the stripped down version of the WCF, the compact framework uses email to provide reliable transport of messages.
  • 3.5 will support LINQ, but not all implementation of it. LINQ for SQL and LINQ for entities will not be supported. Expression trees are also not supported (the compact framework doesn't support Reflection.Emit which is used by expression trees).
  • There will be a remote debugging tool made available that will make it easier to find memory leaks on a device.

Tuesday, June 26, 2007

Orcas Workshop: Day Two

Another busy day, at the Visual Studio "Orcas" and .NET Framework 3.5 Training Workshop. The first topic was a very high level roadmap of the different Microsoft technologies that are available or are coming available within the next year or so (ASP.Net 2.0, ASP.Net 3.5, Silverlight 1.0, Silverlight 1.1, WPF 3.0, WPF 3.5, etc). I'm not sure who the prime demographic was for this presentation, but I find it hard to believe it was too many people in the room. All the information was already well known to everybody in the room (either because they knew it coming into the conference or because it was discussed yesterday at the conference).

The presentation I found the most interesting today was the one on ASP.Net 3.5. I've listed some of the interesting things I learned today about it below.

New Features for ASP.Net 3.5

Even though I don't work with ASP.Net professionally (at least, not much), I do work with it personally (I've volunteered to maintain my communities website which I am switching to ASP.Net 2.0 tonight!). So I was pretty interested in this topic. It's also important to keep up with this stuff since the Internet is not going away, in fact, it's more likely that desktop development will go away that browser-based development (though I won't be holding my breath for that).

  • Support for multi-targeting. This allows you to use Visual Studio 2008 to build ASP.Net 2.0 websites.
  • Better support for AJAX.
  • Designer support for nested master pages.
  • Much improved CSS support in the designer. There is a Manage Styles window that allows you to view the styles that effect an element on a page.
  • Direct Style Application - This is a feature that allows you to have more control over how styles are applied to you HTML. There is the default automatic mode that will figure out how to set the style based on the context and there is the manual mode that provides more fine grained control over how the style is applied (you can set the target rule to determine what element gets the style set).
  • The designer has a split view so you can view the HTML at the same time as the designer. This allows you to make changes to either the HTML or the designer and see the changes reflected immediately in the other.
  • There is eye dropper support for selecting colors (hopefully the eye dropper works outside of Visual Studio, but if not, I still have Color Cop).
  • CSS Property Grid window shows the CSS styles that effect a particular item. Very cool. Select an element in the designer and the window shows the styles that are being used (this is different from the Manage Styles window however, I don't actually recall how :) ).
  • New ListView control - Provides more control over displaying lists of items. This can be hierarchical (a ListView can be put inside another ListView).
  • JavaScript Intellisense - Wow, this has been needed for awhile and they seem to have done a very good job with it. The Intellisense will show you what scripting elements (methods, properties, etc) that you have available, even in included JavaScript libraries. If you decorate your methods with XML comments, the Intellisense will even provide your comments including suggested data types (if a parameter should be a string, you can include that in the XML comments and it will display the data type in the Intellisense). If you include the data type of the return value, VS08 will give Intellisense on the returned value. Since variables can change types in JavaScript, Intellisense will provide the proper comments based on the context.
  • JavaScript debugging - You can now set breakpoints in JavaScript and debug into the script. While debugging, you have access to data visualizers similar (the same?) to what is available with VB.Net or C# code today (view as string, HTML, etc).

Silverlight

I'm not sure if I will be able to make use of this technology, but it's certainly interesting for it's own sake and who knows, this could become the future of browser based development.

  • Supported on IE, Firefox, and Safari browsers on Win XP, Vista, Windows 2003, Longhorn, and Mac (but I'm not sure what versions of the Mac).
  • Expression suite can be used to create Silverlight applications.
  • RTM for 1.0 by end of summer. The 1.1 beta will be released sometime by the end of 2007, but there is no release date for it yet.
  • 1.0 only allows JavaScript for programming for the client. 1.1 will support a subset of .Net.
  • The download size for 1.0 is around 1MB. The size of 1.1 will be around 4MB.
  • Silverlight provides an HTTP downloader for applications that includes progress, ZIP packaging, and asynchronous HTTP GET.
  • Expression Blend will be available in February 2008.
  • Expression Media Encoder will allow media to be converted to types supported by Silverlight. You can also adjust the quality of the media to improve download performance. You definitely have to check it out. Learn More (I don't think the website does a very good job of showing how cool this really is). I believe a beta version is available for free download on the site as well.
  • They showed a video of Scott Guthrie doing a demo of a Silverlight 1.1 application that showed the power of compiled .Net code vs JavaScript. It's a chess game between .Net and JavaScript. .Net wins every time! There is a better video of it out there, but I couldn't find it.

WPF

Blah blah blah. This is a technology that seems very important, but I just haven't been able to get excited about it yet. It's such a huge paradigm shift and there just isn't enough tool support, 3rd party controls, or compelling features available to make this feasible for a large scale, line-of-business application (which is what I write at work). As a developer I would love to dive into this technology, but as a professional, I've got to consider how this will effect the company I work for and the customers we serve. Unfortunately, this means I cannot commit to the time it will take to learn this.

What this means for you is that I tuned out for a large portion of this talk and so my notes are fairly sparse (I've been through it all before anyway at a previous conference that went into way more depth). But what I paid attention to I will share :).

  • xbap is a WPF application that can be deployed from a browser in partial trust mode.
  • Use Visual Studio for code: code editing, events, debugging, deployment, XAML editing (direct)
  • VS08 is still considered an early adopter tool. It doesn't contain all of the features that would be nice to have for building WPF applications, but it will get you there if needed.
  • VS08 beta 2 will provide designer support for automatically generating the default event handler when a control is double clicked (this is not available in beta 1). However, there will be no support for adding non-default events from the designer (such as the property grid in C#). However XAML will allow you to automatically create events using Intellisense (similar to C#).
  • Use Expression Blend for design: designing controls, templates, etc.
  • Expression Blend does not contain any source control integration.

Monday, June 25, 2007

Orcas Workshop: Day One

I have completed day one of the Visual Studio "Orcas" and .NET Framework 3.5 Training Workshop. Today included a great overview of many of the new language features coming in this release. Unfortunately there wasn't enough time to go over all of the new features, but the features that I saw, I like.

Perhaps the defining feature of .Net 3.5 is LINQ (I haven't figured out the "official" way of pronouncing this yet, but I heard it pronounced as link at the workshop today). LINQ stands for Language INtegrated Query and is basically just that. LINQ allows for a developer to query any IEnumerable data source using a strongly typed, compiler validated, and Intellisense enabled syntax. If you are familiar with T-SQL, you will probably be comfortable with LINQ. The biggest difference between T-SQL and LINQ is that a LINQ query starts with the From keyword. There are also numerous other differences, however, given the Intellisense, they are easily discoverable (IMHO, one of the most important aspects of any API). 

[UPDATE 06/26/2007]I forgot to mention a couple of things yesterday. According to one of the speakers, the primary performance goal of LINQ is to be as good as a for loop. However, there was a mention of a team working on a divide-and-conquer algorithm that will make it far faster on multi-proc/core machines. At this point it's just research. There is no date for release and there is a possibility that it won't get released. I should also have mentioned that there appear to be many different implementations of LINQ, there is LINQ for SQL (DLinq), LINQ for Entities (Entity Data Model), LINQ for XML (XLinq), and LINQ for Objects. There might be others as well. I'm not entirely sure of all of the terminology or how they are all used.[/UPDATE]

It appears that C# and VB.Net have widely differing capabilities in regards to LINQ. They both support a basic set of LINQ features, but VB.Net has a lot of keywords that are not available with C#. Many of these differences are based on the philosophy of each language team, but I imagine that developers will eventually demand (and hopefully get) features that one language supports that the other does not.

I thought the C++ section was going to be more interesting than it actually was (if you read my previous post about this conference you would know that I didn't think it was going to be that interesting :). I pretty much surfed the Internet the whole time and didn't get anything interesting out of it (sorry for anybody that is interested in the new improvements for C++).

However, I did pay rapt attention to the new language features for C# 3.0 and VB.Net 9.0. Most of the new features either directly support LINQ or are necessary to enable LINQ but can be used for other things as well. One of the cool things about the latter set of language enhancements is that they seem to be backwards compatible with .Net 2.0, so if you use Visual Studio 2008 to create .Net 2.0 applications using the built in ability to target different versions of the .Net framework, you can use some of the new language features!

Below I have included a list of some of the features that I found interesting. Unfortunately, given how quickly the speakers went over these features, I do not fully understand some of them, so if you find something interesting, you might want to look into it further just to make sure I'm not completely wrong about it ;).

New Language Features for C# 3.0

  • var keyword - Declares a variables that will be created as the type that it is set to. This is particularly useful for LINQ, but it can also be used in foreach...

foreach(var cus in customers) // cus is strongly typed as a Customer type.

  • Object initializers - Allows you to initialize an object by setting properties.

var cus = new Customer() { Name = "Boeing" };

  • Collection initializers - Similar to object initializers, but used to load a collection. Any Add method exposed by the the collection can be used to define the initializer. This allows you to add elements to lists as well as dictionaries or any custom Add method that you create.
  • Auto-implemented properties - Allows you to define a property without having to define the field or the get and/or set. The code is inferred by the property.

public string Name { get; set;}  // this is expanded by the compiler to be a standard property with corresponding field

  • Anonymous types - Allows LINQ to automatically create a type when transforming data. The type is not directly available from code, but you still get Intellisense to help you use the object.
  • Lambda expressions (=> operator) - This is basically a lightweight version of anonymous methods. A lambda expression can be passed as a parameter to another method, just define a delegate that matches the lambda expression.
  • Extension methods - Allows a type to "attach" methods to another type. To do this, add the this keyword in front of the first parameter in a static method.

public static string DoSomething(this string s) // This can be called like this - var something = "Hi".DoSomething()

  • Partial Methods - I didn't quite catch how this works, but it seems like it allows designer generated code to define a method that you can implement.

New Language Features for VB.Net 9.0

  • XML Literals - XML is now a first class feature within the language. You can can embed XML directly in the source code (without using quotes) and get Intellisense to boot (if you import your XML namespace). You can also embed ASP.Net-like code in the XML. This gets really interesting when combined with LINQ.

Dim myXml = <People><Person><%= person.FirstName %></Person></People> ' Example of using XML as a native feature in VB

  • New XML API - The new API is much easier to use than the DOM, especially when creating a new XML document. (if you are looking for keywords to find it on Google, try XElement and/or XAttribute). An XElement is automatically created when using a XML literal.
  • XML properties - .., .@, <> can be used like properties. This is a very cool way to get Intellisense support for XPath-like syntax.
  • XML namespaces - XML namespaces can be imported similar to regular .Net namespace imports.

Imports <xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">

  • Anonymous types - Similar to C# anonymous types above.
  • Into keyword - Calls LINQ aggregate methods, available when using the Group By (I do not believe this is available in Beta 1 of VS 2008)
  • Group Join keyword - Another VB.Net LINQ feature that allows hierarchical results.
  • Aggregate keyword - Alternative starting keyword to LINQ query that will return a scalar value instead of collection. The scalar value can be a complex type, but you will only get one of them. This is typically used with the aggregation methods such as Sum, Average, etc.

Saturday, June 23, 2007

Compiling Multiple Projects Without a Solution

I've posted a new article on Code Project. It is titled Compiling Multiple Projects Without a Solution. The article shows how to compile a multi-project application without using solution files (yes, it includes source code).

The code creates a MSBuild project file that will allow MSBuild to compile a list of VB.Net or C# projects in the correct order. The list can be loaded based on a root directory that contains .vbproj and/or .csproj files or a text file that can contain a combination of directories, project files, and/or other text files.

Visual Studio "Orcas" and .NET Framework 3.5 Training Workshop

I was invited to the Visual Studio "Orcas" and .NET Framework 3.5 Training Workshop at Microsoft next week (June 25th through June 28th). I'm pretty excited about going, it looks like a high level overview of all the major new features of VS 2008 and .Net 3.5.

I included the agenda for the workshop below (hopefully that's ok with MS, it doesn't say anywhere that I can't share it). I'm most looking forward to .NET Language Integrated Query (LINQ), What’s new in Visual Basic 9.0?, Introduction to Silverlight, Integrating Office & line of business systems using VSTO, and the Company Store Visit, though all the sessions look interesting other than maybe the one on C++ (I am beginning to think I will never program in that language again). 

Day

Start

End

Session

Monday, June 25

8:00

9:00

Registration & Breakfast

9:00

9:15

Welcome & Introductions

9:15

10:00

Lap around Visual Studio 2008 & .NET Framework 3.5

10:00

11:00

.NET Language Integrated Query (LINQ)

11:00

12:00

Using LINQ with relational data

12:00

1:00

Lunch

1:00

2:00

Hands-on lab: LINQ

2:15

3:15

What’s new in C# 3.0?

3:30

4:30

What’s new in Visual Basic 9.0?

4:45

5:45

What’s new in C++ 9.0?

Tuesday, June 26

8:30

9:00

Breakfast

9:00

9:30

Introduction to the Microsoft Client Continuum

9:45

11:00

Building Web Applications with Visual Studio 2008 and the .NET Framework 3.5

11:15

12:30

Introduction to Silverlight

12:30

1:30

Lunch

1:30

2:30

Essential Windows Presentation Foundation

2:45

4:00

Building Smart Client Applications with Visual Studio 2008 and the .NET Framework 3.5 using WPF and “Cider”

4:00

5:30

Hands-on lab

5:30

7:30

Evening Event: Barbeque at building 20

Wednesday,

June 27

8:30

9:00

Breakfast

9:00

10:15

Building WCF and WF Applications with the .NET Framework 3.5

10:30

12:00

Web Programming with WCF

12:00

1:00

Lunch

1:00

2:15

Workflow Services

2:15

3:30

Hands-on lab

  •  

3:30

5:00

Building Mobile Applications using Visual Studio 2008 and the .NET Compact Framework 3.5

5:00

6:00

Company Store Visit

Thursday, June 28

8:30

9:00

Breakfast

9:00

10:00

Overview of Office Business Applications and VSTO

10:15

11:30

Extending the Office Fluent UI using VSTO

11:30

12:00

Hands-on lab

12:00

1:00

Lunch

1:00

2:30

Integrating Office & line of business systems using VSTO

2:45

3:45

Hands-on lab

3:45

5:00

What’s new in Visual Studio Team System 2008?

Thursday, June 14, 2007

Making the Build

AutomatedBuild I am of the belief that an automated build process is perhaps the most essential element in producing a quality software application. The build process can be used to enforce good practices within the development team and also detect any issues within the application in a timely manner (the sooner you know about a problem, the less code you have to look at to determine what caused it). Even a small team with a simple application can benefit from an automated build process.

Recently I've gotten the opportunity to recreate the build process for the company I work for. The product is over 5 years old, is fairly large and complex (well over 200 separate .Net projects as well as database and legacy code), and has grown a fairly complicated build process using a combination of batch files and custom executables.

The main reason for recreating the build process is due to the difficulty of maintaining it. There were quite a few batch files and it wasn't easy to run. We averaged a build about once a week (builds should be run several times a day, nightly at most) and the unit tests weren't run very often and if they were, the results often times weren't published (it could be months before you find out a unit test no longer works and then who knows what changed that broke it).

I started building my own build software using Windows Workflow (see my April 28th post, Windows Workflow and Your Next Build System). Although it probably could work and is a great way to learn Windows Workflow, I soon remembered one of my life rules, always use the right tool for the job.

I decided to try FinalBuilder instead and boy am I glad I did. FinalBuilder (FB from here on) is a great build tool. They have dozens (maybe hundreds) of different actions (that's what they call activities or tasks) available to use, such as MSBuild, get from VSS, run SQL, update AssemblyInfo, NUnit, send email, etc. They also allow you to write script (either VBScript or JavaScript) that is run during the build. If that isn't enough for you, you can also create your own custom actions using .Net (or other supported languages).

I've looked at several of the build tools available out there today (especially the free ones :) such as MSBuild and NAnt and the thing that strikes me about these tools is that they seem to be designed for full time build engineers. I don't have time to figure out how to setup these tools let alone write a complete build process using them. Perhaps even more frustrating is that I actually did take the time to learn MSBuild at one point and had done some interesting things with it, however, I couldn't tell you the first thing about MSBuild anymore. I wouldn't use MSBuild to create an entire build process for the same reason I wouldn't use Perl to write an entire ERP system (write only code doesn't work well in a complex, constantly evolving product).

I am not sure if it would have taken longer to create the build process using another technology (such as MSBuild or batch files) or not, but the big benefit in using FB is in the ability to maintain it months later and, if I'm lucky, by somebody other than myself (I definitely don't want to be the "build" guy).

I'm sure there are other great build tools out there. If you know of one, feel free to leave a comment (I always love to find out about new tools :). I plan on writing another article within the next week or two that has more concrete tips for creating a build process (perhaps even some source code), so stay tuned.

Sunday, June 03, 2007

Dispatch - Visual Studio 2005 FTP Upload

I've been working on a website for my home owners association (HOA from here on) recently (converting it to ASP.Net). The website includes tons of documents (pdfs and such) and pages (it includes PHPBB). As you can probably imagine, whenever I make a change to the site, I need to upload it to the web host.

Now perhaps I didn't have it configured properly, but I found the FTP support in Visual Studio 2005 (VS from here on) to be woefully inadequate. Perhaps I didn't have it configured right, but it seems that VS wanted to upload the entire website every time I published it. Not only that, but VS completely froze while it did this (no feedback to the user on progress and couldn't do anything else while it was uploading). This might be ok if you only have 1 or 2 files, but when you have hundreds of files, some of them quite large, this is absurd.

The HOA site is currently hosted by Yahoo! Small Business hosting (no, this is not where the ASP.Net 2 hosting is going to be). Yahoo! provides a tool called Yahoo! Site Builder to help build your website. Overall I find the tool crap (though perhaps it is great for users without several years of web development experience), however, their publishing mechanism is great. It keeps track of the files that have been modified and only uploads those.

Well, obviously the VS FTP support was not going to work for me, so I went to Google and hunted down a tool that would provide better support. I found Dispatch. Dispatch is a simple plug-in to VS that keeps track of which files have been updated and allows you to upload those files to the server without causing VS to freeze while you do so and also provided nice feedback on the progress as well.

Dispatch also provides the ability to download remote items as well. Unfortunately it's not obvious how to do that. You first need to right-click on a folder and select "Show Remote View Overlay" and then you get download options. I can understand the need for that (it needs to establish the remote connection in order to do that), but it would be nice to have some sort of contextual help to let you know what is going on. For instance, provide the same context menu whether or not they have connected. If the user hasn't connected yet, prompt to see if they want to.

I don't think that Dispatch would work well in a team environment, but I doubt if a project being developed by a team would require FTP upload. At $15, Dispatch seems to be priced for hobbyists anyway. Overall, I think that Dispatch is a great plugin for VS. It's what Microsoft should have done. If you are working on a website and don't require the formality of a complex build process, Dispatch will make your life much simpler.

I should mention that I also use Beyond Compare for FTP access to the HOA site. It allows me to view what files are different between the local and remote copies and also allows me to view what those differences are. Very handy when you aren't sure what version is accurate or if you don't remember what you changed. Now if only Dispatch had a mechanism to hook up a file diff tool such as Beyond Compare, that would really be something!

Friday, June 01, 2007

Beautiful Code

I was reading a post on Jeff Atwood's blog (Coding Horror) titled The Best Code is No Code At All the other day and in the comments many people were discussing the "beauty" or aesthetics of code. I've heard that phrase used before, in fact, I've used it myself, but what does it mean? What makes code beautiful?

The answer that I've come up with over the years is that "beauty" is simply the combination of all the aspects that makes code good, approaching perfection. When code is simple, concise, easy to read, correct, flexible, and perhaps some other qualities that makes code good that we know when we see it, but can't quite define, it is considered beautiful.

Unfortunately this is very difficult to achieve in real-world applications. Often times features must be complex due to real-world situations (data entry errors, government regulations, odd business practices, external APIs that don't quite work the way you want, etc). However, every once in awhile, you write that perfect bit of code and you just sit and stare in awe at it. Perhaps you post it on your company bulletin board, or hide it away so nobody can mess with it. Perhaps you force everybody to "code review" your code, or maybe you just move on to the next feature realizing that few people have the training, experience, or skill to appreciate it the way you do.