Dead vs. Done

Back through 2009 and 2010, Damian Edwards and I worked on a project called Web Forms MVP.

It grew out of a consistent problem that we saw across multiple consulting engagements. We got tired of solving it multiple times, so we wrote it as a framework, released it open source, and then implemented it on client projects (with client understanding). Clients got free code. We got to use it in the wild, with real load and challenges. We got to re-use it. The community got to use it too.

It has been downloaded 20k+ times, which is pretty big considering it was around before NuGet was. (Although, we were one of the first 25 packages on the feed too.)

In the last 12 – 18 months, I’ve started seeing “Is Web Forms MVP dead?” being asked. This blog post both answers that question directly in the context of Web Forms MVP, but also discusses the idea of dead vs. done.

Here’s a specific question I was asked:

I am a little bit worried about the fact there is not code commit since sept 2011. Will you continue the project or will it fall in the forgotten ones?

And here was the answer I wrote:

I have a mixed answer for you here.

On the one hand, we cut seven CTP builds, then a v1.0, then a 1.1, 1.2, 1.3 and 1.4. That means we developed the library, tested hundreds of millions of production web requests through it, reached a feature point we wanted to call 1.0, then iterated on top of it. In the 15 months since cutting 1.0, there are only six issues on the Codeplex site: one is a question, one a misunderstanding, one a demo request, and one a feature request that I don’t really agree with anyway.

At this point, Web Forms MVP 1 is “done”, not “dead”. I’m just slack about closing off issues.

Now, that opens up some new questions:

If you find a bug with 1.4 that you can’t workaround, are you left out in the cold? No. First up, you have all the code and build scripts (yay for open source!) so there’s nothing we can do to prevent you from making a fix even if we wanted to (which we never would). Secondly, if you send a pull request via Codeplex we’ll be happy to accept your contribution and push it to the official package.

Will there be a Web Forms MVP 2? At this time, from my personal perspective, I’ll say ‘highly unlikely’. As a consultant, I haven’t been on a Web Forms engagement in over 2 years. That’s not to say there isn’t still a place for Web Forms and Web Forms MVP, but that I’m just not personally working in that area so I’m not well placed to innovate on the library. Damian has lots of great ideas of things to do, and since starting Web Forms MVP has actually become the Program Manager for ASP.NET Web Forms at Microsoft. That being said, his open source efforts of late are heavily focussed on SignalR.

Should there be a Web Forms MVP 2? Maybe. It’d be nice to bring it in line with ASP.NET 4.5, but I’m hard placed to know what is needed in this area considering I’m not on a Web Forms engagement. Without a clear need, I get rather confused by people calling for a new version of something just so they can feel comfortable that the version number incremented.

I hope that gives you some clarity and confidence around what is there today, what will stay, and where we’re going (or not going).

Some projects definitely die. They start out as a great idea, and never make it to a release. I find it a little sad that that’s the only categorisation that seems to be available though.

I hope I’m not just blindly defending my project, but I do genuinely believe that we hit ‘done’.

From here, Web Forms MVP might disappear into the background (it kind of has). The community might kick off a v2. A specific consumer might make their own fork with a bug fix they need. Those are all next steps, now that we’ve done a complete lifecycle.

In the meantime, people are asking if the project is dead, yet not raising any bugs or asking for any features. This just leaves me confused.

Released: ReliabilityPatterns – a circuit breaker implementation for .NET

How to get it

Library: Install-Package ReliabilityPatterns (if you’re not using NuGet already, start today)

Source code: hg.tath.am/reliability-patterns

What it solves

In our homes, we use circuit breakers to quickly isolate an electrical circuit when there’s a known fault.

Michael T. Nygard introduces this concept as a programming pattern in his book Release It!: Design and Deploy Production-Ready Software.

The essence of the pattern is that when one of your dependencies stops responding, you need to stop calling it for a little while. A file system that has exhausted its operation queue is not going to recover while you keep hammering it with new requests. A remote web service is not going to come back any faster if you keep opening new TCP connections and mindlessly waiting for the 30 second timeout. Worse yet, if your application normally expects that web service to respond in 100ms, suddenly starting to block for 30s is likely to deteriorate the performance of your own application and trigger a cascading failure.

Electrical circuit breakers ‘trip’ when a high current condition occurs. They then need to be manually ‘reset’ to close the circuit again.

Our programmatic circuit breaker will trip after an operation has more consecutive failures than a predetermined threshold. While the circuit breaker is open, operations will fail immediately without even attempting to be executed. After a reset timeout has elapsed, the circuit breaker will enter a half-open state. In this state, only the next call will be allowed to execute. If it fails, the circuit breaker will go straight back to the open state and the reset timer will be restarted. Once the service has recovered, calls will start flowing normally again.

Writing all this extra management code would be painful. This library manages it for you instead.

How to use it

Taking advantage of the library is as simple as wrapping your outgoing service call with circuitBreaker.Execute:

// Note: you'll need to keep this instance around
var breaker = new CircuitBreaker();

var client = new SmtpClient();
var message = new MailMessage();
breaker.Execute(() => client.SendEmail(message));

The only caveat is that you need to manage the lifetime of the circuit breaker(s). You should create one instance for each distinct dependency, then keep this instance around for the life of your application. Do not create different instances for different operations that occur on the same system.

(Managing multiple circuit breakers via a container can be a bit tricky. I’ve published a separate example for how to do it with Autofac.)

It’s generally safe to add this pattern to existing code because it will only throw an exception in a scenario where your existing code would anyway.

You can also take advantage of built-in retry logic:

breaker.ExecuteWithRetries(() => client.SendEmail(message), 10, TimeSpan.FromSeconds(20));

Why is the package named ReliabilityPatterns instead of CircuitBreaker?

Because I hope to add more useful patterns in the future.

This blog post in picture form

Sequence diagram

Node.js on Windows

Thanks to Sharkie’s ongoing organisation efforts, SydJS is a thriving monthly JavaScript meeting here in Sydney. This evening they welcomed me along to talk about Node.js on Windows. Afraid of a mostly non-Microsoft crowd I rocked up with all the anti-Unix jokes I had but they turned out to be all quite friendly and it was a fun little talk.

Here’s what I ran through…

Update 18th July 2011: The latest official builds of node.js now come with a Windows executable. This is thanks to support from Microsoft.

Cygwin

Cygwin gives you a full POSIX environment on Windows. It’s great for running apps designed for Unix, but it’s pretty heavy and not very … Windows-ey. It’d be like creating a “My Documents” folder on Ubuntu.

All that being said, it’s the simplest and most reliable way of getting node running on Windows.

Works for 0.2.6 -> 0.3.1 and 0.4.0+. Anything between 0.3.1 and 0.4.0 won’t compile.

The steps (and common pitfalls) are well documented at https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)

Once you’ve got it running in Cygwin, if you jump out to a standard Windows command prompt and run c:\Cygwin\usr\local\bin\node.exe you’ll get a nice big error. More on this later.

MinGW

The next step up from Cygwin is to compile it under MinGW. MinGW (Minimal GNU for Windows) provides the bare minimum set of libraries required to make it possible to compile Unix-y apps on Windows, avoiding the full POSIX strangehold environment that Cygwin provides.

Works for 0.3.6+.

Again, there are well documented steps for this: https://github.com/joyent/node/wiki/Building-node.js-on-mingw

Once you’ve got it running in MinGW, jump out to a standard Windows command prompt again and run c:\wherever-you-put-your-git-clone\node.exe you’ll get a nice big error.

Standalone

Now that we’ve compiled it with MinGW (you did that in the last step, right?) we’re ready to run it on Windows natively.

From a native Windows command prompt:

  1. Create a new folder (mkdir node-standalone)
  2. Copy in the node.exe you compiled in MinGW (xcopy c:\wherever-you-put-your-git-clone\node.exe node-standalone)
  3. Copy in the MinGW helper libraries (xcopy c:\mingw\bin\lib*.dll node-standalone)
  4. Run node-standalone\node
  5. Voila! It works!

Running as a Service

Next up, I wanted to host node as a service, just like IIS. This way it’d start up with my machine, run in the background, restart automatically if it crashes and so forth.

This is where nssm, the non-sucking service manager, enters the picture. This tool lets you host a normal .exe as a Windows service.

Here are the commands I used to setup an instance of the SydJS website as a service:

nssm.exe install sydjs-node c:\where-i-put-node-standalone\node.exe c:\code\SydJS\server.js
net start sydjs-node

What We Achieved

We now have node.js, running natively on Windows, as a service. Enjoy!

(Just please don’t use this in production – it’s really not ready for that yet.)

Web Forms Model-View-Presenter on Hanselminutes

Over the last few months Damian Edwards and myself have been spending quite a bit of time building out a Model-View-Presenter framework for ASP.NET Web Forms.

Until now we’ve been pretty quiet about it all on our blogs because we were busy polishing off v1 and trying to get all the documentation in order. Nevertheless, the word has definitely started to spread as Scott Hanselman interviewed me about the library on this week’s Hanselminutes episode.

Listen to the podcast

Learn more about the library

Video: Building Fast, Public Websites

Following up from my last post about the ASP.NET MVC vs ASP.NET WebForms debate, we’ve had a second TechTalk posted, also from TechEd Australia. In this video, Michael Kordahi, Damian Edwards and I sat down to discuss building fast, public websites. It was a bit of a teaser for our breakout session at the conference, which will be available online as a screencast in the next week or two.

If you’re interested in learning more about building large public websites on ASP.NET, remember that the full video from our recent REMIX session is still available online too.

Building Fast, Public Websites

Watch Online or Download

Video: ASP.NET MVC vs ASP.NET WebForms – Will WebForms be replaced by MVC?

At the recent TechEd Australia conference, Paul Glavich, Damian Edwards and myself sat down to discuss what we thought about the current MVC vs WebForms debate. Our TechTalk has now been posted on the TechEd Online site, and available for anyone to watch.

Check it out, and feel free to continue the debate with any of us. 🙂

ASP.NET MVC vs ASP.NET WebForms – Will WebForms be replaced by MVC? 

Watch Online or Download

Tech.Ed AU 08: The Ugly, The Bad, The Good

Bugger it. Despite being ridiculously exhausted, I’m going to write this now because I can’t sleep. I’m also doing it in reverse order to finish up on a vaguely positive incline.

The Ugly

I got rightfully slammed in my presentation evals for ARC402. 44% of the audience were Very Dissatisfied. That placed me with the 6th worst scoring session at the conference.

The general trends were:

  • I represented a knowledge of the subject (42% very satisfied – a positive here!)
  • My presentation skills were satisfactory (47% satisfied – neutral)
  • The information presented was bad (42% dissatisfied with usefulness)
  • The presentation was ineffective (42% dissatisfied with effectiveness)

Armed with an array of comments to analyse, what did I do wrong? Thinking out loud, this is what I’ve come up with:

  • I was put off by the noise from the neighbouring room and the mobile smackdown. I shouldn’t have been affected by this as much as I was.
  • I rushed the content, when I was by no means under time pressure. I generally covered this content as a 20 minute segment at the end of a more holistic ASP.NET MVC presentation. While I had added additional content, and that is generally a rushed 20 minutes, I certainly shouldn’t have been rushing here.
  • I lost the structure. I didn’t introduce myself (which people highlighted in the comments) and somehow I even forgot to ask for Q+A at the end, even though there’s a whole slide that prompts me to do just that.
  • I focused my content too much on the blurb which came from Tech.Ed US instead of thinking myself about the wider architectural considerations. There’s a lot more too it than IoC and some attributes.
  • Despite being crowned the Australian Annual IT Demonstration Champion this same week, my demo crashed and burned. Massive fail here.
  • I’m still not good at dealing with non-developer audiences. This was something that also affected me at Web on the Piste, and is something I need to actively work on. As much as I am a fan of minimal slides + heaps of live code, if the people ask for high level content in an architecture track, it’s what you’ve got to give them.

Summarising:

I failed to identify the key differences between the demands of this session and those demands of previous talks I had done in this technology space. I was over confident in the content and thus failed to properly prepare and update my content for the latest release, the audience and the timing. I’d like to apologize to those who attended and expected more, the content owners who trusted me to be there and the community who supported me in getting there in the first place.

– Tatham Oddie, not-so-demo-champion

The Bad

I’m forever fighting with a balance between helping and helping too much. I was a key person on the Dev.Garten project this year, having done a significant amount of work pre-event including meeting with the client and developing infrastructure. Once the event actually started I began to realise the shear number of things I’d committed to doing throughout the week and that I was being stretched. While there were plenty of great people to keep the project moving, I could have done a better job of documenting the directions I had started and ensuring a smoother handover.

The Good

Despite this post starting on a decidedly (and deservedly) sour note, there were some amazing this that happened during the week.

My other session (TOT352) about Software+Services had a particularly small audience, however came out with 100% of the evals saying the demos were effective and 100% saying the technical content was just right. Ok, so the data is only working off 2 evaluations because there were only about 12 people in the room, but it’s better results than above either way.

I won the national final of the Demos Happen Here comp. Among other things, this means I’m off to Tech.Ed Los Angeles in 2009 and will shortly receive a shiny new Media Centre PC. When I made the original entry video it was an 8 minute demo, however by the national final I had it down to 4 mins 50 seconds which is a real testament to the quality of Windows Server 2008.

I built a Surface application. Amnesia own the only two Surface devices currently outside of the US and were kind enough to let me spend a day and a half playing on it before they took one to the event. It was my first time ever compiling a line of WPF or seeing the Surface SDK but in that 1.5 days I managed to get an application working which would pull session data out of CommNet and display it in response to a conference pass being placed on the table. The Surface team should be really proud of the quality of SDK that they have achieved to make that possible and I look forward to when we finally get to see a widespread public release of the bits.

The table achieved quite a bit of interest throughout the week:

surface5

Photo: Ry Crozier

On Wednesday I had lunch with Amit Mital who is the GM of Windows Live Mesh. Six of us (him, 2x MS, 2x others, me) spent a good 90 minutes discussing some of the longer term visions for Mesh. The original plan was for us to ask questions and him to answer them, but it became more of a discussion between ourselves about scenarios we wanted to see / achieve and him (relatively) quietly taking notes. In the end this was a better approach because it allowed him to walk away with some real world scenarios and didn’t result in us constantly asking him questions he wasn’t allowed to answer yet. PDC sounds set to deliver some exciting changes as we see the release of the Mesh SDK.

Friday lunchtime I was invited to present with Lawrence Crumpton about open source at Microsoft. We were presenting to a lunch of open source alliance and higher education administrators trying to demonstrate that Microsoft aren’t actually evil. Lawrence’s full time job at Microsoft Australia lies around open source and it was amazing to hear some of the things he’s involved in. I jumped on stage after his talk to demonstrate PHP on IIS7 as a first class citizen and talked about leveraging the platform with functionality like NLB. (This may or may not sound very similar to my DHH demo.)

Tech.Ed week is also a big week for Readify because it’s the only time we get to have almost all of our people in the one place. It’s a strange feeling knowing a whole group of people but then meeting them for the “first” time. It was particularly good meeting our new WA gang (Hadley Willan, Jeremy Thake and Graeme Foster) as well as catching up with the out of towners and management teams again.

Friday night was the Readify Kick-off party followed by a company conference / meeting on Saturday.

Who’d have thought I’d get to see my Principal Consultant gyrating his hips on stage with Kylie? I’ve had a quick look around Flickr and Facebook but I haven’t found any photos of the night online yet. I look forward to our resident photographers catching up on their uploads early this week. Update: Links at end of post.

Rog42 came along as a guest speaker on Saturday and delivered a great presentation about some new approaches for community. In a demonstration of how a little information goes a long way, the pizza thing is now pretty superfluous having seen his presentation but I think we can keep the jokes going for a little bit yet. 😉 It was encouraging to see the level of Readify involvement in Tech.Ed.

Overall it was a great week and another well executed Tech.Ed on Microsoft’s behalf. I was privileged to be invited to participate in lots of different ways, albeit with different qualities of outcome. It’s been an eye opening week which has highlighted needed work on my behalf, but also being rewarding for work I’ve already done. I look forward to the next event, and all of the other things that will need to be tackled between now and then.

Update 7-Sep-08: Photos from Thursday night courtesy of Catherine Eibner:

Update 8-Sep-08:

Tearing down the tents (and moving them closer together)

Being fairly focused on Microsoft technologies myself, I see a lot of the “us vs. them” mentality where you either use Microsoft technologies, or you’re part of “the other group”. Seeing Lachlan Hardy at Microsoft Remix was awesome – he was a Java dude talking about web standards at a Microsoft event. The more we can focus on the ideas rather than which camp you’re from, the more we’ll develop the inter-camp relationships and eventually destroy this segmentation. Sure, we’ll still group up and debate the superfluous crap like which language is better (we’re nerds – we’ll always do that) but at least these will be debates between the sub-camps of one big happy web family. (It’s not as cheesy as it sounds – I hope.)

What’s the first step in making this happen? Meet people from “the other group”!

The boys and girls at Gruden and Straker Interactive have put together Web on the Piste for the second year running. It’s a vendor neutral conference about rich internet technologies – so you’ll see presentations about Adobe Flex and Microsoft Silverlight at the same event (among lots of other cool technologies of course). These types of events are a perfect way to meet some really interesting people and cross pollinate some sweet ideas.

It’s coming up at the end of August, and I understand that both conference tickets and accommodation are getting tight so I’d encourage you to get in soon if you’re interested (Queenstown is crazy at this time of year).

And of course, yours truly will be there evangelising the delights of Windows Live as well as ASP.NET AJAX to our Flash using, “fush and chups” eating friends. 🙂

Will you be there?