My thoughts on Typescript

I have been asked quite a few times in the last 24hrs how I stand regarding TypeScript – Microsoft’s answer to solving the elephant in the HTML5 adoption room (JavaScript). First impressions count and they were positive, I studied the marketing material, I installed the plugin and I even wrote some code – outcome yes, it works for me. The work done on this “it tastes like chicken” façade to the JavaScript issue is outstanding and I’d not think anything less of the work Anders spits out from that enormous talent sized brain of his. I am however suspicious of this concept – time to put my Microsoft trouble maker tinfoil hat back on. I have mentioned numerous times that there has been this divide or chasm between Windows + Internet Explorer and WPF/Silverlight – that is to say XAML/C# vs. HTML5/JS/C++. It is pretty well documented on this blog and in other parts of the web, and there is not much more to discuss on this suffice to say Typescript is yet another win for the HTML5 camp and loss for the XAML/C# camp. This Is the part where a Microsoft evangelist or product manager for the team(s) feign innocence and give you the usual “it’s about choice” speech.  True it will be about choice; I just cannot help to think that with all that investment and work gone into C#/XAML mix that taking a few steps backward to prop up HTML5/TypeScript seems an awful waste of time and energy to date. There is no doubt that I would personally adopt TypeScript/HTML5 when the time comes to write a HTML based solution, as to me it fits nicely with my desired development pipeline. I still think however, the entire web based development pipeline is around 3-5 years behind where XAML/C# is today (I will even throw in Adobe ActionScript/MXML into that mix as well). My thoughts are simple
  • Ecma6 is hopefully going to crush JavaScripts skull and the abomination of JavaScript we see today will be wiped from the face of the earth hopefully never to be spoken of again (ie Typescript leads that charge from a Microsoft developer standpoint)
  • Internet Explorer is still being regarded inside Microsoft as a standalone ecosystem. I am still nervous and not excited about this thus suspicious of Typescripts charter (that fork in the road for IE vs. other browsers in the parity/ubiquity story is still coming up ahead).
  • HTML5 vs. XAML/MXML. I still roll my eyes at HTML5 mainly as when you’ve used both MXML or XAML in your day to day development then look at HTML5 one can’t but help see the HTML5 has not only gone of charter – yet again. If we are going to go full, tilt XML UI declarative then let us fold Resource Dictionaries into place instead of CSS / style tags and be done with it.
  • Typescript was fun to develop with. I almost got a little giggle at making my HTML do stuff via Typescript that I’ve grown accustomed to with Flex/WPF/Silverlight but it still felt 3 steps backwards. It reminded me of the days of DHTML when we did this kind of thing by ourselves when writing your own JavaScript framework was the cool-kids thing to do (I once – 2004 - wrote a Flash framework that read in XML as instructions on how to design UI, I also did the same for JavaScript.  Crazy eh?)
  • A few people will whine about Typescript being a big ol façade or yet another JavaScript wrapper but the difference form all the alternatives is that firstly, Microsoft wrote this one. Secondly, it comes as a plugin for Visual Studio and thirdly it has a geek-celeb behind it (Anders). Most non-Microsoft developers will give a “hand jerk” motion to those tickboxes but you do not understand the requirement most .NET shops have (which has now been ticked). Adoption will follow, remember this.
  • Typescript reminds me of the days when Adobe/Macromedia switched from ActionScript 1.o to 2.0/3.0. You felt it was a move forward and the idea isn't new, at the same time it took a long while for existing developers to cross that chasm of adoption. Hopefully it ECMA6 wont fall into that same vortex of pain.
In Summary, Typescript will be a hit amongst the .NET kids out there, I don’t think it will go beyond that but that’s ok as that’s a few million developers out there that it will influence. I think this is still setting the ground work for future Internet Explorer development going forward and stay tuned for more of that discussion.
Why is Internet Explorer its own ecosystem?

Why is Internet Explorer its own ecosystem? Why not say "Web" .. 🙂

I hope this however puts a lot of pressure on the makers of browsers & tooling that JavaScript needs to be abandoned as we know it, that it needs to keep moving forward if we are truly going to reach absolute parity with plugin(s) / native experiences such as Adobe Flex, Silverlight or WPF in way that doesn’t feel like you’ve had sacrifice your first born to achieve parity. To quote a friend who recently gave his thoughts on HTML/JS development instead of WPF/SL/Flex development

It is like getting a hand job from a crack addict. You know it is wrong, you know it is a substitute for what you really want and lastly once it happens you can never look your friends in the eye the same way again. It however got the job done.

(That was the clean version of that believe it or not).  

Related Posts:

  • No Related Posts
  • anthonyb

    Hi Scott!
    about “this suffice to say Typescript is yet another win for the HTML5 camp and loss for the XAML/C# camp.” that you mention, here is a rather opposite but equally interesting thought that i came across yesterday and is worth reading:
    Anyway, do you think that Hejlsberg just “got bored” with all these internal politics, UI abandonements and the like and set up to create the new big think inside Microsoft ?

  • I dont think he got bored. I think he (either himself or a team below him) was given a mission and it was achieved it.

  • anthonyb

    I am wondering, if that “mission” (e.x. TypeScript) has anything to do with .NET/C# “shifted strategy”…But again, i see that they are doing very seriously work with C#. They wouldn’t rewrite their compiler to C# (Roslyn) if they wanted to abandon it. async/await are exciting stuff and surely took them very busy to produce them. And there are rumours that they are working in a native code compiler for C#…
    Anyway, just my thoughts.

  • It’s funny how some people see XAML as a superior solution to declarative UI, and others see it as a verbose abomination. I’m in the latter camp. I’ve been working a lot with HTML+CSS recently, but last week had to drop into an old WPF codebase and it was awful. The whole styling thing was just painful compared to what you can do with CSS3 selectors and media queries. I guess things click differently for different folk.

    Completely agree about TypeScript, though, my favourite new language in quite some time.

  • I think HTML went out of scope years ago and HTML5 is just the extra free kick. I can see the appeal of a JSOn like existance around how selectors work or overloading class like attributes with multi level design styles, for me however I find it a fail or a hack to overcome an imposed limitation on a approach to describing UI that again was out of scope (gasp).

    For me styling with concepts similar to ResourceDictionaries work as not only does it keep it in the family (XML) but it also helps ensure that styling boat rises with the UI tide (html) whenever there’s a point release. In our case with CSS3 its a bit of a mess at the moment in browser support despite the spec being fairly well defined. Lastly the reality you have to dump large amounts of CSS styles into one spot in order to achieve a balanced UI – that or you have to know a little about how the UI is declared – to me is a fail as well. In WPF to apply a style to a control you’re not inclined to know exactly how the UI works structurally or play a game of “one of these styles will override the other, guess which one”. It doesn’t require as much cognitive load or perspective memory.

    Currently however XAML’s tooling approach to resource dictionaries suck so thats probably why you’re having the painful experience. The concept and initial logic however in my view kicks HTML/CSS to the curb and to be fair HTML5 spec was basing a lot of decisions at the time of its creation from ideas like XAML/SVG which if you trace the origins all mutated from the same level of thinking.

  • I think TypeScript is merely a lipstick on the Javascript pig in response to Google Dart. They wanna attract developers to the MSFT solutions so they offer some sugar if you will to that large JS camp out there. I do not for one second believe MSFT has any interest in a fully successful HTML5 (not that HTML would have any chance) to take the crown away from Windows as their goto client platform. TypeScript to Javascript is more like J++ to Java or IronPython to Python. It’s somewhat of EEE but they deny it obviously.

  • Great article. However I must disagree on ” If we are going to go full, tilt XML UI declarative then let us fold Resource Dictionaries into place instead of CSS / style tags and be done with it.”

    I think XAML is a very ugly when used without tooling. It’s a mess to read and write. It’s verbose. Additionally CSS3 is actually one of the more elegant parts of this whole web thing. Especially combined with tools like LESS.

    Now what I would like to see is a hybrid.

    HTML with the layout engine and power of XAML
    CSS3 for pure visual declaration
    C# with jQuery selection model
    All running through DirectX