11/26/2008

A Time to Reflect

"Everything you can imagine is real" -- Picasso

As we approach the end of another year, most people begin a period where there is more introspection and reflection about their inner feelings and aspirations, making donations where appropriate to favored causes, hopefully spending more time thinking about the family unit and the blessings that it provides.

I’ve already given thanks to my Twitter brethren for the enlightening 140 character or less pearls of wisdom and links they’ve provided. And I would like to extend the same thanks to readers here.

I want to wish great peace to anyone who reads or has read my UnBlog, a happy Thanksgiving and Holiday season, and don’t forget – work isn’t everything. Take time to nurture your family and loved ones, and make an effort to do good in your community. Not only now – but all year.

Commune with your family and friends, support those who need help with whatever resources you may have available to you, and – above all – be confident in your skills and your future.

Tough economic times will eventually pass. Hopefully, we will learn the lessons of history and be able to apply them to create a better future for ourselves and those who follow us.

11/20/2008

Silverlight vs. Flash – Where’s the Fire?

Is fuel efficiency really what we need most desperately? I say that what we really need is a car that can be shot when it breaks down. –-Russell Baker

I had a chance to reflect a little bit today on Silverlight and Flash and I’d like to offer these observations.

I have some not insignificant experience with Flash. Many developers are too new to remember FutureSplash – but I remember it very well, and I used it when it first came out, circa 1995. That was the predecessor of today’s Flash, which was ultimately purchased by Macromedia, and now of course subsumed into Adobe.

A lot of the stuff you read today revolves around “Flash vs. SIlverlight”. The media loves controversy, and they’ll hammer on this subject ad-infinitum – often to the extreme detriment of any real content.  If you are on Twitter, the latest volley was about MLB (Major League Baseball) dropping Silverlight and going back to Flash for their video coverage. Its seems like every Tom, Dick and Harry Blogger / Twitterer needed to “break the news”.

It was a joke – it got to the point where the signal-to-noise ratio made it uncomfortable to even find relevant content about “Silverlight”. Fortunately, they’ve started to give up and things are getting back to normal.

I have no idea what the facts are behind this arrangement, nor do I particularly care, because Silverlight is already “on a roll”, and it’s just the beginning. Flash is not going to go away, and I don’t want it to - that’s good because competition is good for everyone.

When I and Robbe Morris (my MVP partner on the eggheadcafe.com venture) worked for Sprint Telecenters back in 2000, Sprint spent over $500,000 to have some very sophisticated Flash developers put together a really hot-shot Flash animation web page for their current home – business offering called “ION”. Needless to say, it no longer exists as a product. The animation was fantastic – but at the time, that’s all it did – be a Flash-y animation.

Flash was and still is used primarily as a delivery system for graphic animations, banner ads, and to a lesser extent, a UI front – end for interaction with data on some back-end such as a database. Flex has brought some notable changes, but I haven’t seen any compelling business scenarios built with it. Microsoft properties use Flash – and they’ll probably still be using it for quite a while. Sure, they want to promote Silverlight – but they aren’t stupid! Bloggers seem to want to expose some sort of hypocricy on the part of Microsoft here – but Microsoft is simply being pragmatic in my view. The Flash IDE has not changed much in all these years – it it still “Timeline” concept – based. Silverlight is much different.

When I was able to use the Silverlight .NET Framework to perform fast custom binary serialization of strongly typed .NET objects combined with in-memory Zip compression and send the resultant  compact byte arrays back -- and forth -- over the wire from the client – side Silverlight application to a WCF service on the server side, that’s when I realized that my Flash friends cannot perform this kind of sophistication. Their infrastructure simply does not permit this kind of enterprise – level, “create your own transport channel” architecture at present. (Note in the comments to this post that I stand corrected in some areas, but you can draw your own conclusions). Bear in mind, we are talking about custom binary serialization in Silverlight, and doing it in your language of choice – C#, VB.NET, Ruby, etc.

The main difference with Silverlight is that it really leverages the developer base – both designers and coders – to use their .NET Framework skills to build line-of-business applications that can deliver enterprise-level interaction coupled with high quality video and vector graphics -- with animation -- in a subset of the .NET Framework that installs and runs on the user’s PC, in their Internet browser. You could clearly make the case that the single compelling reason to look at Silverlight is that you are already a .NET (or Mono) developer and don’t want to learn ActionScript (or that you like VB.NET or Ruby or Python!)

And unless you’ve been living in a cave, I don’t need to sell you on the fact that  .NET has matured to the point where most all of the major corporations around the globe are using it as a mainstream technology.

Moonlight, the Microsoft / Novell supported *nix version of Silverlight, is about to make it’s debut.  And the Eclipse Silverlight IDE is already available to try in BETA.

SIlverlight code is compiled. It runs (in several different programming languages now)  up to 300 times faster than comparable Flash code, which relies (currently) on ActionScript.

The next generation of Silverlight will support Hi-Def video, adaptive streaming, and much more.

I still like Flash. But I just love Silverlight, because the productivity curve with Expression Blend and being able to create applications in the familiar environment of Visual Studio 2008 (and even in Visual Studio Express versions) Is quite compelling.

Recently I subscribed to NetFlix just so I could opt –in to the SIlverlight – delivered “Watch Instantly” feature, which is a pleasure to use. Full – screen, searchable hi-def video of your favorite movies, streamed live right to your computer monitor. I like Indie, comedy and foreign films – and they have plenty.  It’s comedic to see these MAC users (who are often hardcore Microsoft – haters) having their jaws drop when they see it working so well on their MACS!

Don’t sell Silverlight short. You’d be making a big mistake. It’s not about Flash vs. Silverlight; it’s about RIA and good competition.

11/11/2008

Why ASMX-Style WebReferences to WCF Services Don’t serialize Numbers

 

Based on a casual googling of this problem, it appears that some developers have spent days trying to figure out why an integer they set on the generated proxy field comes over the wire into the actual WCF service as ZERO.  I didn’t spend days figuring it out, but it certainly did cause no end of annoyance and cursing until I  did.

Let’s say you have a WCF service and for one reason or another (maybe your app is on a Handheld device and you cannot use “Add Service Reference”) you’ve set an ASMX – style “Add Web Reference”.  Your code in the generated proxy Reference.cs class may look like this:

 public int Quantity {
            get {
                return this.quantityField;
            }
            set {
                this.quantityField = value;
            }
        }
        /// <remarks/>
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool QuantitySpecified {
            get {
                return this.quantityFieldSpecified;
            }
            set {
                this.quantityFieldSpecified = value;
            }
        }

Note the extra field XxxSpecified with the XmlIgnore attribute that gets generated. If you do not set the QuantitySpecified Boolean field to “true”, your Quantity isn’t going to make it over the wire, period.

The extra XxxSpecified properties are added when you use ASMX-style references  to a service that contains nullable value types, as ASMX does not directly support nullable types. The XxxSpecified must be true for ASMX to know that the value is specified in the XML, otherwise it will assume that the value is 'null'. So for example  if your datetime value contained MinDate, how would you know that this signals 'null' ? The same is true for reading property values; if the XxxSpecified is false, then the related value must be considered to be 'null'.  

The only exception to this is for strings.  The documentation for this may be there, but I sure could not find it.

Twitter Tip

Recently I saw somebody I follow on Twitter announcing they had started to follow everybody who follows them as an “experiment”. I’m not sure I would advise that – because it could bring the signal-to-noise ratio to an unacceptable level. When I get an email that somebody is now following me on twitter, I go check them out. I look at their list of followers. If I don’t recognize too many names of people I’m already following, I usually decline to follow them unless I can clearly see that their content is of interest to me.

I’ve made a Twitter policy of only following people I’m interested in – fellow MVP’s, gurus in various disciplines such as Silverlight or WCF, and so on. The result is that I get a lot of very relevant content and very little “noise” – except for the inevitable “fembot” spammers – but it seems that Twitter has been doing an excellent job of putting those out of commission lately.

I also follow a few luminaries like Jeff Attwood, even though a lot of his Tweets are not that relevant – because of his occasional “Twingers” that really make you think!

11/08/2008

Does Web Censorship Software Make Sense?

Like many other .NET Developers, I try to work as efficiently as possible for the benefit of my employer and clients. I don’t take smoking breaks, I usually eat lunch at my desk in about 10 or 15 minutes, and I don’t waste my employer’s time needlessly surfing the net.

But many employers don’t seem to appreciate that. They look at what they see as a problem, and use web filtering software like WebSense to block employees from “doing bad things” under the guise of “improving productivity”.  You know what I say to that? Bull!

Look, there are always going to be a small minority of employees who are irresponsible and don’t have good work-ethic values who will spend hours of their employers’ time surfing “unacceptable” web sites. But to punish everyone for the offenses of a few is like using a sledge hammer to swat a  gnat.

If you block people from web sites, what do you think they’ll do instead? Their productivity won’t increase – the “Baddies” will just do something else, like playing Solitaire on their computers. Or they’ll find something else to do that wastes the employer’s time.

Scott Hanselman actually got his blog “Banned” by WebSense because it got mindlessly categorized as “Personal Web Sites; Society and Lifestyles.” Can you believe this utter B.S.?   WebSense, because of the nutty algorithms that it uses, is intrinsically flawed.

For the majority of us “good guys”, being blocked in what sometimes seems a heavy-handed, indiscriminate manner is both an annoyance and a reduction in productivity.

Some companies prohibit employees from using IM clients like Live Messenger. At the company I work for, we all agree that it is a great productivity booster. Even the “higher ups” use it.  Sure, there may be a few abusers – but the benefits far outweigh.

Occasionally when doing a search for technical resources on a programming problem, I end up on one of those WebSense “blocked” pages. At a client’s site recently, I found that the entire domain “blogspot.com” – which has thousands of legitimate technical blogs on .NET, Silverlight, WPF, WCF and other technologies (including this UnBlog) – is BLOCKED.

What on earth are these people thinking? Is it really about “productivity”, or just the heavy hand of self-appointed righteousness? What do you think?

Item of Note:

My “playground” Social Short Url / Search / Tagging site, http://ittyurl.net, now has over 958 user-submitted links related to Silverlight, which has been the site’s focus since about June of this year. Keep those new links coming, and check out the Webservice API, which now features a new Webmethod to discover and Feedburnerize feeds on any webpage that has “link rel=” feed discovery tags! By creating a Feedburner Url for your feed, you automatically enable Silverlight cross-domain requests!