Why I’m dodging the HTML/JS bandwagon

February 9th, 2012 5 comments

After nearly two years working for ILM Professional Services we’ve parted ways in the the closest thing to a mutual breakup possible in business. Now that I’m no longer associated with ILM I feel like I can give an unbiased assessment of the company. In short, I think ILM is the best source for quality .Net developers in the Twin Cities. Their interview process is easily the most comprehensive I’ve gone through and it gives them an accurate portrait of your skills across a broad spectrum of disciplines and, even more importantly, they don’t try to place you in a position that doesn’t match your skill set. The other developers that work there are some of the best and brightest I’ve met anywhere, every single one capable of excelling in a team lead or architect role at any company in the Twin Cities.

They are also a great company to work for as a developer. They sent me to Mix 10 and 11, supported and guided me in my desire to speak at conferences and user groups, and set me up with a mentor to help me convert from life at small businesses to life as a consultant. If you’re a .Net developer with solid chops I would highly recommend considering ILM the next time you’re looking for a change.

But as much as I like and respect ILM we needed to part ways for one major reason: The openings they’re seeing are almost entirely for ASP.Net MVC apps and I have no interest in developing with HTML or JS.

Why would you avoid HTML & JS?

Every time I tell someone I’m not interested in HTML/CSS/JS I get looked at like I’m crazy. The biggest reason I don’t plan to start doing HTML/JS development is that the problems I love to solve, the reasons I got into programming in the first place, shouldn’t be solved in JavaScript. I like to do things like write the aerodynamic models that make simulated airplanes fly, write my own programming languages and DSLs, and write web services used by hundreds of developers on every platform under the sun that support more transactions per second than Twitter can handle without throwing a fail whale. JS raytracers notwithstanding, these are not problems that can or should be solved with JavaScript.

Up until I found and fell in love with XAML I didn’t really like making UIs either. I’d tried just about everything from HTML/JS/CSS (most recently in 2007) with PHP5, Swing with Java, WinForms with C#, MFC with C++, and a host of other technologies all because I wanted to be able to show the world the results of all of this cool stuff I was doing. All of them were difficult to use to the point of pain, didn’t work well across platforms/browsers/resolutions without coding for each one individually, and making even small changes required a ridiculous amount of effort. To make a long story short I had given up on ever making UIs and resigned myself to leaving it to someone else.

Then I got a job working on an application that happened to use WPF as its front-end technology and my jaw dropped. Here was a technology I could use to easily create user interfaces that reacted easily to changes in both the data on the screen as well as changes in resolution and could even work cross platform with some care via Silverlight. Back in 2010 the future of XAML looked bright.

Now Silverlight is dead, WPF is still a great option for making applications to run on any Windows machine from XP to Windows 7, and XAML is a first class citizen when building applications for WinRT. This has left XAML developers floating in the breeze for the last six months or so. It looks like XAML will be a major player moving forward on the desktops, laptops, tablets, and phones that use Microsoft operating systems but we’ve completely lost our cross-platform capabilities. The bright XAML future of 2010 has been tarnished and developers, correctly, are loath to trust it. But my moving from XAML to HTML/CSS/JS would be like going from using a Zippo to start a fire to rubbing two sticks together, even with all of the improvements in HTML5, CSS3, and the new JS libraries.

How do I know that HTML5 hasn’t changed the world as fully as the internet echo chamber would have me believe if I haven’t used the technologies in the last 5 years? All of the issues that made it a pain in the butt then are still there now.

  • Browsers still don’t implement the “standards” the same way. I’m using the most current version of the most popular (or 2nd depending on whom you ask) browser and I still see major sites every day whose layout is broken to the point of illegibility.
  • Half of those cool “look what HTML5 can do” sites only work in 1-2 browsers.
  • I can view source on most web pages and see at least one JS function that includes a workaround for a certain browser or set of browsers (not just IE6).
  • It was non-trivial for sites to implement the SOPA boycott without messing up their search rankings and results.
  • I watched professional, high-quality, web designers and developers put together websites for two months this winter. The number of problems they had dealing with various browsers was ridiculous. Figuring out how to get a design to work in HTML/JS/CSS that would have taken one person a day in XAML to get working completely was amazingly complex.
  • Netflix, the largest site on the internet by traffic, is half broken if you try to access it via https.

The list goes on. The point is that things have gotten better in the HTML world since the bad old days of dealing with IE6, but they still aren’t good.

So what now?

Now I see myself as I was back before I discovered XAML but with a few bright spots out on the horizon. The biggest is that I know now that it’s possible to create UX technologies that are a joy to work with. There’s a good chance that XAML will have a big future with WP7 and Windows 8, including their app stores and WinRT looks like a big step forward for Microsoft. Last but not least, XAML has shown developers what a UI technology could be and the Microsoft development community is (finally, slowly) starting to take an interest in open source development. I salivate at the idea of an open source implementation of something like the XAML presentation stack that could be used across platforms and/or virtual machines. But that’s an idea for another day.

Categories: Opinions Tags:

Observable Kinect

December 7th, 2011 2 comments

When the Kinect SDK was first introduced I said that it should really be used in conjunction with Rx to really unlock the power of the Kinect hardware. I started making my first application for the Kinect a few days ago and it turns out that my impression of the SDK that I saw fly by on stage during a Mix Keynote was correct, here was a piece of code that could really use a prescription of Rx! Take two IObservable<T>s and call me in the morning.

I checked around NuGet and looked for some open source Rx for Kinect implementations but there didn’t seem to be any so I created one. There are two parts, a wrapper for the standard Kinect APIs and a separate one for the speech APIs. Both have been published to NuGet. Note that the NuGet packages do require the proper SDKs to be installed, you can find download links here.

Right now Observable Kinect is a very thin wrapper around the existing APIs, though the speech package does help to simplify the speech SDK. Feel free to use Observable Kinect, expose issues, send pull requests, and just generally kick the tires.

Let me know what you think.

Categories: ObservableKinect Tags: , , ,

MVVM in the Real World

October 19th, 2010 No comments

I presented my talk “MVVM in the Real World” at the October meeting of the Twin Cities .Net User Group. Considering that it was my first “real” technical presentation that wasn’t just to coworkers it seemed to go pretty well. Some good questions were asked and I hope I helped clear up some problems people were having when trying to use MVVM in a real world project.

I mentioned during the talk that you should be careful when searching WPF & Silverlight blogs to try to solutions to problems you run into. A lot of people have started to love the XAML, which is awesome, but not all of their advice is good. Although quite a few have slowed their posts lately here are some of the WPF & Silverlight blogs I follow:

I also mentioned Rob Eisenberg’s presentation at Mix 10, Build Your Own MVVM Framework. It’s an excellent presentation if you want to dive deeper into MVVM and see some of the tools I mentioned that are used to solve common issues people run into with MVVM.

I hope the presentation and this post were helpful, you can get the slides here.

Categories: Presentation Tags: , , ,

Rx – Remove from an ObservableCollection after a specified time

September 27th, 2010 1 comment

There was an interesting question on StackOverflow today that leads to another good example of the power of Reactive Extensions. The question was “How can I remove an item from an ObservableCollection some fixed amount of time after it was added?” With Rx it’s extremely simple! Here’s a quick console application demonstrating how to do it.

using System;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using System.Threading;

namespace Test_App
{
    class Program
    {
        static void Main(string[] args)
        {
            var oc = new ObservableCollection<int>();

            var disposer =
             Observable
              .FromEvent<NotifyCollectionChangedEventArgs>(oc, "CollectionChanged")
              .Where(e => e.EventArgs.Action == NotifyCollectionChangedAction.Add)
              .Delay(TimeSpan.FromSeconds(5))
              .Subscribe(
                  e =>
                  {
                      foreach (int i in e.EventArgs.NewItems)
                      {
                          Console.WriteLine(string.Format("Removing item {0} at {1:HH:mm:ss}", i, DateTime.Now));
                          oc.Remove(i);
                      }
                  });

            for (int i = 1; i < 10; i++)
            {
                Console.WriteLine(string.Format("Added item {0} at {1:HH:mm:ss}", i, DateTime.Now));
                oc.Add(i);
                Thread.Sleep(1000);
            }

            Console.WriteLine("Press any key to exit..");
            Console.ReadKey(true);

            disposer.Dispose();
        }
    }
}

And here’s the output:

Added item 1 at 10:21:44
Added item 2 at 10:21:45
Added item 3 at 10:21:46
Added item 4 at 10:21:47
Added item 5 at 10:21:48
Added item 6 at 10:21:49
Removing item 1 at 10:21:49
Removing item 2 at 10:21:50
Added item 7 at 10:21:50
Added item 8 at 10:21:51
Removing item 3 at 10:21:51
Added item 9 at 10:21:52
Removing item 4 at 10:21:52
Press any key to exit..
Removing item 5 at 10:21:53
Removing item 6 at 10:21:54
Removing item 7 at 10:21:55
Removing item 8 at 10:21:56
Removing item 9 at 10:21:57

Pretty simple huh?

Categories: Code Samples Tags:

Rx – Calling a long running function asynchronously

August 25th, 2010 3 comments

Time for a little more Rx love. Today we’re going to call a long running function asynchronously and handle the return on the Dispatcher thread almost as simply as calling the function directly.

void CallSomeLongFunctionAsync()
{
 Observable
 .ToAsync<int>(LifeTheUniverseEverything)()
 .ObserveOnDispatcher()
 .Subscribe(theAnswer => MessageBox.Show(string.Format("The answer was {0}. What was the question anyway?", theAnswer)));
}

private int LifeTheUniverseEverything()
{
 Thread.Sleep(600000);
 return 42;
}

I may have used my new-found powers to calculate the answer to life, the universe, and everything but imagine a service call or long running file operation. Making those UIs completely non-blocking just got a lot easier.

Categories: Code Samples Tags: