A Phoenix Rising from the Ashes

DISCLAIMER: This is a rare “personal” / “rant” blog post.  I normally try to keep things focused on the technology.

In my last blog post, I mentioned that I’m back to blogging again and that I would explain a little bit about why I haven’t been.  I didn’t get into blogging by choice.  I did it because when I started as a Developer Evangelist at Microsoft, it was in the early days where evangelists were starting to blog.  I started http://blogs.msdn.com/publicsector on September 12, 2005.  In fact, in the early days, I was really the only blogger even though it was the team blog.  Truth be told, I couldn’t stand blogging in the early days.  I have always considered myself a fairly private person.  Even though I had a job that was semi-public, the whole “online persona” thing made me uncomfortable.  The reality is that in those days, and still to an extent today, the Developer Evangelists on my old team (which always focused on the government and people/organizations building software solutions for the Government) were what I always called “behind the firewall” evangelists.  What I mean by that is that unlike the regional Developer Evangelists who had almost “mini celebrity” status due to the fact that they engaged the developer community “at large” in their geographic area (user groups, code camps, etc.), we were behind the scenes evangelizing to developer communities within government organizations, Systems Integrators (SIs), partners, and Independent Software Vendors (ISVs) who focused on government work.  I remember arguing with my first manager about how I didn’t want to blog and wasn’t comfortable with creating an “online persona.”  I even went as far as not using my name on my blog and devkeydet as my pen name.  Somewhere along the way, I grew to really enjoy blogging.  I used it as a way to share tips/tricks with customers in a broad way.  I used to love when a customer asked me a question and I didn’t know the answer.  I’d go figure it out, build a sample, record a video walkthrough, and blog about it.  Oh, those were the days.  I had always said to myself that I had the greatest job a dev geek could ask for…having more fun than anything I had ever done in my career and getting paid for it.  I worked crazy hours, pulled way too many all-nighters perfecting demos/samples/blog posts, but I loved it.  I got to keep enough “real developer” chops through building POCs for customers. 

Although I have blogged a little here and there, about a year and a half ago I left the Developer Evangelist role where blogging was part of my job responsibilities.   I became a manager.  WTF?  If you know me well, you’ve probably heard me swear I would never be a manager at Microsoft.  I’ve left companies because my only option was to get out of a technically focused role if I wanted “career advancement.”  Microsoft is a company where you can have a very rewarding career without being pushed into management.  I felt good about my choice to get into management because it was on my own terms.  I thought I was ready, boy was I wrong.  I didn’t last long.  A little over 6 months.  By all accounts, I was doing a bang up job in my new role.  However, my heart just wasn’t in it.  I had lost the passion, that thing that made me wake up every morning and say “Damn I am lucky.  I love what I do.”  I realized pretty quickly that I wasn’t ready to give up the heavy technology focus and high customer interaction.  I missed it dearly.  So I began looking for an opportunity to get back into a technically focused, individual contributor role.  I thought I had found one, but after about 6 months in my next role, it just wasn’t the right fit for me.  For others?  Absolutely.  For me?  No.  The passion never returned.  There were blips here and there, but it was clear that this wasn’t my “next thing” at Microsoft.  At this point, I was strongly considering leaving and trying my luck outside the walls of the so called “evil empire.”  I also got to the point where I felt that the only way I would be happy would be to find a job in Redmond.  Well, something unpredictable happened along the way.  As part of my last role, I had the opportunity to get exposed to Dynamics CRM 2011.  I had heard about “dynamics as a development platform” in the days of the previous version, even participated in some training on it, but wasn’t interested.  As part of my involvement in this second look at Dynamics CRM 2011, I had to “get smart fast” on the developer story.  I spent a couple long days and late nights cramming using the Dynamics CRM 2011 Developer Training Kit.  As a result, I became a proponent of building the system using Dynamics CRM 2011 as the foundation.  As fate would have it, a role opened up on the US Public Sector Dynamics team and the rest is history.  I’ve been in my new role for almost a month now and I have loved every moment of it, including the late nights getting deeper into the bowels of the product and APIs as well as working with a great team of folks.  I’m an admitted perfectionist workaholic and I’ve always justified it by the fact that I’ve always loved what I do for a living.  I learned the hard way that when the passion is gone, work just feels like…well work.  Back to the point about blogging…

Between work and family, I didn’t have much time to blog since I left the Developer Evangelist role.  Despite my defiant start to blogging, it’s something that I have missed.  It’s something I am excited to start doing again. 

Before the few readers that I still have left run away, I will continue to blog about all sorts of developer related topics.  Just like the old days.  However, there will clearly be a heavier focus on Dynamics CRM from a developers perspective.  I’ve already have a list of topics queued up. I will also be cross posting to my old team blog.  So feel free to tune in there if you prefer.

I’ve read so much negative press about careers at Microsoft. I’d like to close with a positive comment about about mine.  My career at Microsoft has been fantastic. Did I “lose that loving feeling” for a short period?  Sure, but no other company I’ve worked for would have ever let me experiment with my career for almost two years.  No other company that I’ve worked for would have let me say “Nah, this isn’t for me” twice, keep me employed, and offer continued “career advancement” during said experiment.  The funny thing is that both Microsoft and I are better off for the experience.  Microsoft is a great company to work for.  It’s not with out flaws, politics, and bureaucracy.  What big company is?  I am very happy that I am still here and looking forward to this next chapter.

Ok, now that I got that off my chest, back to the normal geeky blogging…

-Marc (@devkeydet)

From BackgroundWorker, to TPL, to Async

I’m back to blogging again.  More on that later…

In any client UI code (WinForms/WPF/Silverilght/WinRT), it’s always a good practice to do as much in the background as possible so you aren’t blocking the UI thread.  “In the old days,” the BackgroundWorker was my best friend when I needed to executed some code in the background.  Along came the Task Parallel Library (TPL), and I moved to using it over Background worker.  Now we have the async enhancements coming soon.  Here’s a comparison of the approaches.

Consider this UI:

   1:  <Window x:Class="WpfApplicationComparingBackground_v_Task.MainWindow"
   2:    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   3:    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   4:    Title="MainWindow"
   5:    Height="350"
   6:    Width="525">
   7:    <StackPanel>
   8:      <TextBlock x:Name="Text1" />
   9:      <TextBlock x:Name="Text2" />
  10:      <TextBlock x:Name="Text3" />
  11:    </StackPanel>
  12:  </Window>

And this code behind:

   1:  using System;
   2:  using System.ComponentModel;
   3:  using System.Threading;
   4:  using System.Threading.Tasks;
   5:  using System.Windows;
   6:   
   7:  namespace WpfApplicationComparingBackground_v_Task
   8:  {
   9:      public partial class MainWindow : Window
  10:      {
  11:          public MainWindow()
  12:          {
  13:              InitializeComponent();
  14:   
  15:              Loaded += MainWindow_Loaded;
  16:          }
  17:   
  18:          void MainWindow_Loaded(object sender, RoutedEventArgs e)
  19:          {
  20:              BackgroundWorkerExample();
  21:              TaskContinueWithExample();
  22:              AsyncCtpExample();
  23:          }
  24:   
  25:          private void BackgroundWorkerExample()
  26:          {
  27:              var bWorker = new BackgroundWorker();
  28:   
  29:              bWorker.DoWork += (sender, args) =>
  30:              {
  31:                  // Mimic Some Long Running work
  32:                  Thread.Sleep(TimeSpan.FromSeconds(5));
  33:                  args.Result = "Using BackgroundWorker";
  34:              };
  35:   
  36:              bWorker.RunWorkerCompleted += (sender, args) =>
  37:              {
  38:                  Text1.Text = args.Result.ToString();
  39:              };
  40:   
  41:              bWorker.RunWorkerAsync();
  42:          }
  43:   
  44:          private void TaskContinueWithExample()
  45:          {
  46:              var uiThreadTaskScheduler = TaskScheduler.FromCurrentSynchronizationContext();
  47:   
  48:              Task<string>.Factory.StartNew(() =>
  49:              {
  50:                  // Mimic Some Long Running work
  51:                  Thread.Sleep(TimeSpan.FromSeconds(5));
  52:   
  53:                  return "Using TPL";
  54:              }).ContinueWith(task =>
  55:              {
  56:                  Text2.Text = task.Result;
  57:              }, uiThreadTaskScheduler);
  58:          }
  59:   
  60:          private async void AsyncCtpExample()
  61:          {
  62:              var response = await Task<string>.Factory.StartNew(() =>
  63:              {
  64:                  // Mimic Some Long Running work
  65:                  Thread.Sleep(TimeSpan.FromSeconds(5));
  66:   
  67:                  return "Using Async CTP";
  68:              });
  69:   
  70:              Text3.Text = response;
  71:          }
  72:      }
  73:  }

Although the TaskContinueWithExample() isn’t much less code than the BackgroundWorkerExample(), it just feels better to me and reads top to bottom which I think is a bit easier to grok.  Of course, the AsyncCtp() example is the least amount of and most readable code.  These three methods accomplish the same goal, but isn’t it nice that the framework / language abstractions have evolved to the simplicity / beauty of AsyncCtpExample()?

ASP.NET Web Forms, MVC, WebMatrix … what’s the story?

The reality of choices ASP.NET developers have today can be daunting:

  • ASP.NET Web Forms
  • ASP.NET MVC
    • Web Forms view engine vs. Razor view engine
  • WebMatrix / Web Pages (.cshtml / razor)

With all the noise around ASP.NET MVC and WebMatrix lately, there’s been an unfortunate side effect that creates a perception that Web Forms is passé and not getting investment from the ASP.NET team.  I’m still very surprised when I talk to ASP.NET Web Forms developers who don’t know about what’s new in ASP.NET 4.0 for them.  I think it has to do with some of the overshadowing / attention from other two, newer, choices.  The podcast below is really worth listening to if you are still scratching your head about Web Forms as it relates to these newer options. 

http://www.misfitgeek.com/2011/07/podcast-damian-edwards-aspnet-webforms/

“Damain is a Program Manager Microsoft’s ASP.NET team and is responsible for WebForms and the WebForms Developer Experience

In this episode I talk with Damain about the future of WebForms and its evolution, the influence of DynamicData on WebForms, code generation for ASP.NET WebForms and more.”

In addition to talking about futures, they also spend some time in the beginning talking about ASP.NET 4.0 Web Forms  and some other interesting topics.  They really do a good job of addressing some of the FUD around Web Forms as well as the pros/cons of our various ASP.NET based choices.  Here are a couple of my favorite quotes in the beginning:

We are focusing on making more developers happy.  Not every developer wants the same thing out of a web development programming framework (paraphrase)

Each of the frameworks has its strengths and weaknesses.  Each has its own independent model for approach how to go about doing web development.  Some people like one model over the other. (paraphrase)

Yes, there are some cooler / newer things to Web Forms, but there are also some real advantages to working in a technology that has the benefit of a decade of evolution. (paraphrase)

There are all sorts of good, rational comments about Web Forms vs. MVC vs. WebMatrix.  Whether we like the choices or not, there are real reasons for having them.  Even if you disagree with some of the comments, I think they are worth listening to and reflecting upon.  It’s an hour long podcast, but worth listening to in the background as you are working on something else.  The podcast really does put Web Forms into perspective, reminds people that the majority of ASP.NET developers are still Web Forms developers, and then helps us understand what’s coming in the future.

Don’t get me wrong.  I am a HUGE ASP.NET MVC fan, but that doesn’t mean that it is always the right choice.

I made it on the MSDN Cloud home page :)

I recently recorded an overview video called Developing Cloud Applications with Windows Azure to replace the current one on the Cloud section of MSDN.  I just heard news that the video is live.  I am pretty excited because this is THE VIDEO you see when you go to http://msdn.com, then click the Cloud section. There’s nothing deep in the video, but the goal was to comprehensively answer the “What is the Windows Azure Platform” question at enough depth that developers new to the Windows Azure Platform wouldn’t feel like they were watching too much of a marketing video.

Follow devkeydet on Twitter

PubSec Dev Dinner on External Data and Services with SharePoint 2010

My old team is having a developer dinner tomorrow night titled Developing SharePoint 2010 Solutions Using External Data and Services.  See here for more details at http://bit.ly/kPUq5n.

“…

What you will learn

SharePoint 2010 allows developers to work with both internal and external data using Business Connectivity Services (BCS), Excel Services, Access Services and custom WCF services. During the presentation we will discuss and demonstrate several common usage scenarios.

  • Bringing SQL Server data to SharePoint using BCS
  • Sharing Excel Data using PowerPivot for SharePoint
  • Publishing Access Database applications to SharePoint
  • Sharing secure data using BCS and the secure store service
  • Creating Silverlight Using WCF RIA services for SharePoint

…”

Are you using Visual Studio PerfWatson?

You can do your part to make future releases of Visual Studio faster by installing this extension:

“Would you like your performance issues to be reported automatically? Well now you can, with PerfWatson extension! Install this extension and assist the Visual Studio team in providing a faster future IDE for you…”

http://bit.ly/vsperfwat

I have it installed and haven’t noticed it getting in the way.

SCREENCAST: Hybrid Solutions with Windows Azure Connect

I’ve had many conversations lately with people about using Windows Azure to build “Hybrid Solutions.”  The typical response I get is “what’s that?”  When I explain that it is the concept of running part of your application in Windows Azure and part of it in your own datacenter, the typical response I get is “I didn’t know that was possible.”  Not only is it possible, but it is relatively painless to setup.  Two of the common scenarios that this approach applies to are:

  • Enterprise app migrated to Windows Azure that requires access to on-premise SQL Server
  • Windows Azure app domain-joined to corporate Active Directory

A good example of the first scenario is the need to protect data “at rest” in order to comply with laws, regulations, and guidelines established in various industries.  SQL Azure does not currently offer the Transparent Data Encryption (TDE) feature like its on-premises sibling (SQL Server).  This is a perfect scenario for a hybrid solution using Windows Azure Connect.  In this scenario, you still get the opportunity to take advantage of many of the cloud computing benefits the Windows Azure Platform such as Compute (Web/Worker/Virtual Machine) Roles, Caching and more

So in an effort to do my part to help raise broader awareness, I recorded this screencast:

http://bit.ly/azureconnecthybrid

Help make Microsoft developer technologies better!

Follow devkeydet on Twitter

Ron Jacobs just blogged about how .NET developers can provide feature feedback and vote on WCF/WF features.

http://blogs.msdn.com/b/rjacobs/archive/2011/04/14/how-you-can-make-wf-wcf-better.aspx

Many Microsoft product teams are doing this nowadays. It still surprises me how many .NET developers don’t realize these feature voting sites exist. In addition to WF/WCF, I am aware of these:

http://wpdev.uservoice.com/forums/110705-app-platform

https://windowsphone7community.uservoice.com/forums/84435-feature-feedback

http://data.uservoice.com/forums/72027-wcf-data-services-feature-suggestions

http://data.uservoice.com/forums/72025-ado-net-entity-framework-ef-feature-suggestions

http://dotnet.uservoice.com/forums/40583-wpf-feature-suggestions

http://dotnet.uservoice.com/forums/4325-silverlight-feature-suggestions

http://dotnet.uservoice.com/forums/87171-visual-basic-content-requests

http://dotnet.uservoice.com/forums/57026-wcf-ria-services

http://www.mygreatwindowsazureidea.com/pages/34192-windows-azure-feature-voting

http://www.mygreatwindowsazureidea.com/forums/35889-microsoft-codename-dallas-feature-voting

http://www.mygreatwindowsazureidea.com/forums/44459-sql-azure-data-sync-feature-voting

http://www.mygreatwindowsazureidea.com/forums/34685-sql-azure-feature-voting

http://www.mygreatwindowsazureidea.com/forums/100417-sql-azure-reporting-feature-voting

http://www.mygreatwindowsazureidea.com/forums/40626-windows-azure-appfabric-feature-voting

http://www.mygreatwindowsazureidea.com/forums/103009-windows-azure-code-samples-voting

http://www.mygreatwindowsazureidea.com/forums/103403-windows-azure-content-voting

http://aspnet.uservoice.com/forums/41199-general

http://aspnet.uservoice.com/forums/41201-asp-net-mvc

http://aspnet.uservoice.com/forums/41202-asp-net-webforms

http://aspnet.uservoice.com/forums/50615-orchard

http://aspnet.uservoice.com/forums/100405-performance

http://aspnet.uservoice.com/forums/41233-visual-studio-performance-feedback

Let me know in the comments if I’ve missed any.  I’ll add them.

SCREENCAST: JavaScript Intellisense for SharePoint

Follow devkeydet on Twitter

In this screencast, you will learn how to get the most out of JavaScript programming with SharePoint 2010 projects in Visual Studio 2010. You will see how to get JavaScript Intellisense and debugging working for jQuery and the Client Object Model. You’ll also learn about the benefits of using the Microsoft Ajax Content Delivery Network (CDN).

If you don’t pause your video player at the right time, you might miss the location of the SharePoint JavaScript files. Here is a link to the MSDN How to article that talks about those files:

http://msdn.microsoft.com/en-us/library/ff798328.aspx

Direct link:

https://channel9.msdn.com/posts/JavaScript-Intellisense-for-SharePoint