Code Central is here!

ctodx
10 July 2008

Over the past two or three months we've been implementing a new feature of our Support Center web site that we're calling Code Central. We've been dropping hints for a little time while we've been testing it internally, but it's come to the point that we really need to get it out in front of you, our customers.

I'm sure you know the feeling: there's a problem with your code, you stare at it, stare at it and you just can't see it, then someone comes along and points out the issue straight off. It's the same with Code Central in a way: we think it's great tool and we've covered all the bases and we've stared at it and stared at it, but it's time for new eyes to look at it and give us feedback.

So, what its it? At it's most basic it's a search engine for finding and using sample code. But that's doesn't even begin to explain why we're so buzzed about it and, indeed, if that was all it was, we'd have released it ages ago.

Code Central is both a web application and painstakingly indexed and updated data and code. It was designed to make it easier for you to locate sample code, knowledgebase code, code provided by us as part of solving a support incident, etc. Normally at this stage, once you've located the sample or demo code you want to look at, you have to download it, unzip it into some folder, update the assembly references using the ProjectConverter tool (because you can bet that you have a different version of DXperience than the code was written for), load it into Visual Studio, and then finally compile and run it.

Of course, you're always a little anxious as to whether the code will actually work with your version of DXperience anyway. Maybe it was written for an older version and no longer applies. There's nothing worse than downloading some sample code, going through that entire process, only to find it won't compile or run.

We looked at this scenario and recognized that it's not exactly conducive to efficient and helpful use of our sample code. In fact, the basic scenario is downright pathetic. So, we decided to do something about it as part of Code Central.

The first part was taking our sample and demo code and meticulously checking, tagging, and categorizing it. We worked out which versions of DXperience it was valid for. Sometimes we found that the sample code applied to various versions of DXperience but was different for the later ones, maybe due to a later breaking change, so we created different samples in those cases. We created, in essence, a large database of indexed and categorized sample code.

Next up, and note I still haven't reached the customer-facing parts of Code Central yet, we thought long and hard about how to maintain the validity of the data in the database. After all, it'd be bad to allow the data to "decay" having spent all that time verifying and classifying the sample code. We're releasing new versions of DXperience all the time (three major releases per year, and roughly one minor release every 3 or 4 weeks) and any release has the potential to "break" sample code.

Once phrased like that, the solution was obvious: the sample code database must become part of our internal automated testing suite. That was the next stage of the Code Central project. We now get bug reports if the code changes we make for DXperience breaks the sample code. Breakages can be as simple as the sample code no longer compiles, or more complex such as when the behavior of a sample changes. In either case the automatic bug report means that a developer looks at the issue and makes a decision: was the change buggy, in which case it should be fixed, or is this a valid change, what we call a breaking change, in which case the developer has to create a new sample to reflect the new code in DXperience. Either way, you, the users of Code Central, can rest assured that the sample you download will work.

Put another way, this merging of our sample code into our automated test system has the benefit of giving us a body of test code to help make sure we don't inadvertently introduce breaking changes where there shouldn't be any.

At this stage we had a body of verified, indexed, categorized sample code waiting for the next improvement in the customer scenario: the download, compile and run experience. A few discussions later, we had the answer: a simple program called Example Runner needed to be written. What this program does is to execute all that tedious workflow of unzipping the sample code into its own folder, running ProjectConverter on it, and loading the sample project into Visual Studio so that you can compile and run it.

DevExpress' Example Runner is simple to use. We've renamed our sample code zip files with a unique extension, dxsample, and Example Runner, on install, registers itself to open those kinds of files. It has two configuration options: the root folder in which to unpack the dxsample files and the version of Visual Studio to use to load the samples (after all, you may have two or more versions of Visual Studio on your development machine). Once that's all set up, Example Runner does its job: unpacking, updating references, loading the sample in Visual Studio. All you need to do is click on the sample download button on the website, answer the browser's "what should I do with this file?" security dialog, and after a moment or two you'll be presented with the sample project in Visual Studio ready for you to peruse the code, or compile and run it.

After all that, we were ready to write the actual Code Central web application, the one that lets you search our sample code database, sort or group or filter the results (yes, we're using ASPxGridView, of course), view a preview of the sample in the grid, or click on it to see the whole thing.

Rather than me describe it in utter detail, you should just go and use it. At the present time, we're publishing Code Central as a beta. We're anxious to get feedback on it, so that we can smooth out any rough edges we may have missed. Please use our usual support channels to report problems or to request enhancements.

Enjoy!

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.