TypeScript: To Be or Not To Be

TypeScript

I’ve been having an ongoing convo with some of my colleagues (e.g.) at Infragistics about TypeScript as of late. Now by way of preface, I started my professional programming career in ASP, have done more than my fair share of ASP.NET, was an ASP/ASP.NET MVP for years, and an ASPInsider for even longer, so let’s just say I’ve had a ringside seat, as it were, to Microsoft DevDiv’s relationship with the Web over the years. That said, for the last few years, I’ve been more focused on UX and the broader Web community at large, and I’ve spent a lot more time coming at Web dev from the non-MS perspective. So my angle in the discussion is something of a friendly Devil’s advocate.

Let me start by saying that Microsoft wins the overall dev productivity competition hands down. Visual Studio is an absolutely top-notch, amazing IDE, and there really is nothing that can compete with it in the overall category. On top of that, Microsoft has produced some top shelf Web dev tooling over the years. There really is no doubt about that, but there is always room for improvement.

The Web, in particular, presents a very challenging, wild-west environment for tooling. The technologies in themselves don’t lend themselves well to that, and there are all sorts of hacks and workarounds to address the problem, including some produced by Microsoft. To be a guru in Web dev requires mastery of so many different moving pieces and nuances, multiple, not-very-well-defined languages, innumerable libraries and frameworks, and a vast number of potential runtime environments. It’s a hard egg to crack when it comes to productivity tools, not to mention just general dev productivity, defined as time spent actively producing value-adding software assets.

The Problems for TypeScript

Unfortunately, TypeScript comes across as a sort of “here, let me fix that for you” in the broader JavaScript world.

The problem is exacerbated because some advocates of TypeScript position it as “better” than what everyone else is doing. They say things like, “it’s for ‘large scale’, ‘complex'” apps. Heck, even the homepage says it in big bold letters: “TypeScript is a language for application-scale JavaScript development.” In other words, Rest of World, all those apps you’ve been making with JavaScript for years without TypeScript are puny, simplistic, toy apps.

I am Locutus of BorgThere’s also an undercurrent of fear of assimilation–oh great, the Borg have discovered JavaScript. Microsoft has at least partially earned that sentiment over the years, even if it is exaggerated by most critics, and even if all the great folks producing the technology themselves are not to blame. Trust me; I’ve known many of them, and they really aren’t agents of evil any more than you or I. I promise!

In any case, these perceptions are compounded due to various other biases and prejudices against Microsoft, however well or ill founded those may be for any given individual. All that stacks up to a lot working against TypeScript, certainly more than basically any other individual or organization creating a similar solution would face. And then you have folks who:

  • are just against any sort of preprocessor (WTF!?)
  • really prefer dynamic over static (for whatever reasons)
  • feel like this is just one more thing to learn
  • are fans of one of the existing quasi-competing solutions
  • are well invested in an alternative solution
  • are worried about adopting a niche technology, when the whole point of the Web is openness and interoperability

Adoption

Measuring adoption and market share is always challenging, especially with the Web. However, here are some indicators around TypeScript.

First off, looking at job listings is always interesting in this area. It can tell you what people currently are doing as well as what is in the immediate plans. Numbers were accurate when I wrote this down. 🙂

That’s 0.08% of JavaScript jobs that are asking for TypeScript! I listed some other major JS solutions for dealing with complexity and increasing productivity in JS app dev, for comparison. Angular and Ember have been around roughly as long.

Followers/Starrers

Oh, and that’s another thing–CodePlex? Really? 😉

Language Popularity (GitHub)

I just ran across this today, TOP GITHUB LANGUAGES FOR 2013 (SO FAR). You have to scroll down to the Top 100 lists to see TypeScript. It’s pretty puny. Whether or not this is a “fair” comparison is debatable, but it is just one data point/indicator of current popularity.

The Buzz

This is impossible to reasonably quantify, but I do keep a good eye on Web dev stuff in general, and except for asking “is anyone using TypeScript,” pretty much the only time you see people talking about TypeScript is if they are Microsoft devs or Microsoft employees. Granted, it’s still very young/early, but it is a data point nonetheless.

Even though the solutions compared above are different (language vs framework vs library), the core problems of productivity, maintenance, large scale, and so on are the target for all. The fact is that real, large-scale Web apps have been built and are being built using these technologies as tools to enhance productivity and overall effectiveness. And this is the space that TypeScript competes in.

All this doesn’t paint a pretty picture for TypeScript, so…

What Does TypeScript Need to Be Widely Adopted?

Ken and Dennis

A really great beard! Come on, Anders! It’s a miracle that C# ever went anywhere! 🙂 I kid…

Let’s face it, there are a percentage of Web devs out there who are more or less lost to Microsoft, those who are deeply and irrationally against any and everything that Microsoft does. In a word, haterz. There’s no point in focusing on them, but I honestly don’t think that’s the vast majority. Most devs at heart value technical merit, and most, however altruistic they may be, do have to answer for their productivity and/or simply want to be productive for their own satisfaction.

So that’s the key thing:

TypeScript needs to demonstrate that it makes you significantly more productive.

Forget making claims about it being for apps that are supposedly more complex or larger scale. Forget about inane, academic, ideological arguments about the value of static typing. They smack of arrogance. They inevitably lead to rabbit holes, and they stir up all sorts of irrational passions in otherwise intelligent people.  Just stay focused on productivity.

And the thing is, I think the team behind it gets how valuable this is. I mean, Microsoft DevDiv is all about dev productivity. Consider this from Anders shortly after the launch:

Specifically, [Microsoft] wanted to make it possible to create world-class developer tools that would make building large web applications easier, without breaking compatibility with existing browsers and standards. (Source)

Okay then. Let’s see more of the world-class dev tooling built on top of TypeScript!

Oh and ideally, let’s see the great tooling on all of the major desktop OSes. This latter would help a lot to dispel the notion of borgishness and is, IMO, essential to the widespread adoption of Web technologies in general. From a Microsoft business perspective, it makes sense in numerous ways, not the least of which would be as a way to make Azure even more attractive to a broader audience. Of course, you can’t be pushy about that, either, but I’m talking about things like increasing awareness, increasing positive associations (through enhanced productivity), making using Azure that much easier, and so on.

Advertisements

No -> Packaged HTML5 Apps: Are we emulating failure?

Packaged HTML5 Apps: Are we emulating failure? | groovecoder.

The simple answer is “no.” But just some nitpicks.

The Problem Is Contrived/Misapprehended 

  1. If you already have a QR scanner in place, you skip half the problem.
  2. Android?
  3. The pizza place could just have their own app, easily searchable or linked (as in the captive wifi situation).
  4. If it’s an FB, they could say, “just search for ‘incredible pizza tulsa’ to get to our FB page” in the app. It worked fine on the iOS FB app search…

Just because one place offers a sub-par way to find them on mobile FB does not mean, “apps suck!”

The Web is a Bigger App Store

Claiming that discoverability is bad on the app stores may be true; however, the Web is essentially just a bigger app store, and discoverability is worse because it’s not just apps, it is all kinds of content, much of which is not pertinent nor optimized for your device.

There are many good reasons to go native or even PhoneGap. They may not be compelling for everyone, but the reasons given in that post simply show the bias of the writer.

BookBook Initial Thoughts/Review

For some time, I’ve been thinking about having an iPhone case that looked like a book. This is, in part, because of the looks you get at church if you use an iPhone, like I do, for devotional material (prayers, in particular).  I’m also a history geek and love the “old book” aesthetic, so I thought I’d give the BookBook a try.

The, theoretically, nice addition with this one is that you can use it as a wallet as well.  So, I just got mine in the mail yesterday, and here it is.

BookBook Side

BookBook Top

As you can see, it doesn’t stay closed on its own very well.  Now, I generally try to keep the bare minimum in my wallet anyways, but I had to skimp even more.  We’re talking: driver’s license, health insurance card, AAA card, one credit card, and one debit card.  I also have maybe 5 bills of cash.

Even though it fits, you can see it doesn’t really fit well.  That said, with some pressure, it almost fits in terms of the binding, i.e., it is about as thick as the spine of the book.  It is and feels fairly bulky in my front pocket, where I always keep my phone.  But it’s not uncomfortable.  It is noticeable even when standing, and I don’t wear tight pants. 😉

Things I like:

  • The look – obviously, that’s my main reason for getting it. It looks great, just like an old book.
  • The feel – it feels (and I believe is) real leather. Also, for reading emails, etc., it’s kind of nifty to hold it like a book.
  • The smell – it smells like leather.
  • Eliminating separate wallet. Now I just need to get rid of my keys. 🙂

Things I don’t like/will have to be tolerated:

  • Bulkiness – as shown/discussed above. I don’t think I can get away with much less in the wallet side, and even without that, it is still fairly bulky itself.
  • Using as a phone – I don’t want to wear the spine/binding, so for me, the only option is to pop it out for this. It’s not hard to get out, but still, it is weird to have to take it out to make a call.
  • Difficulty of access – this is extension of the phone thing; it is not exactly easy to get cards out, or cash, or put it back. (It is leather, so it should break in a bit/get easier.) Also, if you want to switch to left hand or use both to type, it’s a bit awkward for sure.

At this point, I’m not really sure about it. It’s the first of this kind of phone case I’ve tried, and most of the issues have to do with the class of case, rather than this specific one, which is quite snazzy/feels well made.  Will try it for some days at least and see if I can adapt w/o too much bother.

UPDATE 2 January 2013:

I’ve been using it for three weeks now, and I’m more happy with it now than I originally was.  Here are pics from today.

BookBook Vintage Brown from Front

BookBook Vintage Brown from Back

BookBook Vintage Brown from Open Side

You can see there is some wear. Twelve South says, naturally, that this wear just adds to the character. I’ll say that at least it doesn’t take away from it. Looking like a vintage book, you might expect it to show some wear.

Now, about my main concerns:

  • Bulkiness – I did use a wallet app to get rid of one card. It still sits open (as you see). This isn’t really any better or worse, but I will say that I have come to really appreciate not having to carry a separate wallet. This is more convenient for a wallet, too, as it is usually more easily accessible (e.g., sitting in the car in a drive thru–it is easier to get to because I often either have it out or have it in my front pocket).
  • Phone – It is a bit awkward, yes. But maybe less so than I anticipated. I find myself using speakerphone when I can, but in situations where I need to answer normally, I’ve gotten adept at holding it open to my head.  Probably looks a tad silly, but for short calls, I do that.  If I intent to talk for a while, I pop it out, which once you get the technique, is fairly easy to do. I have a couple accessories that don’t want the case, and I regularly pop it out for those as well.  No biggie, but it is as expected a tad more cumbersome.
  • Access – as mentioned, it is actually easier and often faster to access my wallet than before. As expected, the leather did break in, so the cards come out easily enough now, and cash isn’t hard to get either. The big win in this aspect is how quick I can get to the wallet stuff.  And it is a bit easier to show my ID to people as well.

About the pluses, well, the main thing is that it is really quite nice to hold, to look at, and to smell (though of course it is less smelly now). I’ve had quite a few compliments on it, even some jealous comments. I have found it is actually easier to hold for taking pics/video in landscape–the case gives you more to grip on without worrying about blocking the lens. As one person pointed out, people endure far more annoying things than the drawbacks of this case in service to aesthetics/style, so I can’t really complain. I find myself quite satisfied with it overall, and mostly I don’t think about or mind the cumbersome aspects. I do enjoy it and am keeping it as my case for the foreseeable future.  As always, your mileage may vary.

Installing Nest in a 100-Year-Old House with Radiator Heating: A Guide/Review

Nest Learning Thermostat on Amazon.com
Just thought I’d share my experience with a great product–the Nest Learning Thermostat. Given that I own an over 100-year-old house with radiator heating (and no central air), I was dubious about this working for me. After doing a fair amount of research, it came down to this one or the ecobee. The ecobee (main model) was more expensive and, frankly, just doesn’t look as good. Let’s face it; the Nest has been designed, by real designers, and it is obvious. Other thermostats on the market are clunky gear head boxes.

I have noticed that things that appear to be well designed often are. Not only that, if people go through the trouble to do great industrial design, they usually at least try to do great software design, and maybe even full on service design, and in this, the Nest does not disappoint. Everything from learning about the Nest ahead of time on their Web site to the out-of-the-box experience to the install to the setup to the ongoing usage (with apps for devices and a matching Web control site) has been designed, and designed well (and kudos to Amazon for 1-Click Prime ordering and one-day delivery–a day ahead of time).This is just one of those products where they have really pulled it off. And who’d have thunk it–for something as “simple” as a thermostat.

I used their online compatibility checker to verify that it’d work with my system. I have one of those old-fashioned Honeywell round thermostats.

Honeywell CT87K Front

But it turned out that after popping off the front, it was a relatively new model, the Honeywell CT87K, made for heat only systems.

Honeywell CT87K Inside

See the old wires?? Wrapped in like cloth or something. I told you it was an old house. 🙂  Anyways, zooming in I was able to see the R and W letters by the wires, so I could plug that into the compatibility checker, and voila, they said it was good, and they even give you a wiring diagram up front to show how you’ll hook it up. Pretty snazzy!

I thought I’d give it a whirl, and so I clicked the little 1-Click button, and a day later (two days, ahead of time, thanks to Thanksgiving), it shows up. (Even the box is kinda cute.)

Nest Box

You take off the plastic wrap, slit the tape holding it shut, slide off the cover, and open up.

Nest Unboxing 1

Lift out the Nest (has a little plastic circle on it), lift off the first layer, you see the booklet, lift that out, and you have the next layer of goodies.

Nest Unboxing 2

You see their chubby little screwdriver, the Nest back, and two mounting screws.  Slide out the booklets; there are three.

Nest Unboxing 3

You have the install guide, the setup guide, and a “concierge” card (if you need to bail on a self install, a nice security blanket). What you see above is the first page, that tells you high level steps for uninstalling your old thermostat. What’s cool about it is the built-in stickers to label your current wires as you take them out. Given the variety of systems out there, and no standardization on colors, this is the only way to do it. So be careful! For me, of course, it was simple–two wires. But I labeled them anyway!

BEFORE MOVING ON, CUT THE POWER TO YOUR THERMOSTAT. For me, the thermostat wires come from the boiler, so the circuit to break was the boiler’s circuit. I verified this using my handy dandy Greenlee GT-16 Adjustable Non-Contact Voltage Detector, which I bought some time ago for other amateur electrician work on this old house. I can detect voltage in the air on the max sensitivity, so what I usually do is check it before trying to disconnect. Dial it back until it detects only when you’re near the hot wire. BTW, don’t take my word for it–I am not an electrician; YMMV.

Nest Install Voltage Detector

Now that you’ve cut power, you can label the wires safely.

Nest Install Label Wires

Even though the old plugs only say R and W, Rh and W1 were the only/closest option, and it matched the wiring diagram from the compat checker.

Now, niftily enough, the screwdriver they include has a small enough head on it to reach in those holes on the right and unscrew (loosen) the wire clamps. Simply pull them out at that point. I cheated and used my drill to quickly remove the two screws holding it onto the wall. I carefully pulled it off the wall at that point, to avoid ripping any extra paint off (the painters got mighty close to it). It revealed the green wall beneath the new cream paint. Here’s the whole old thermostat.

Nest Install Remove Old Thermostat

It probably took you more time to read this than it did to get the old one off.  Now for the install. I walked the Nest’s back over and looked at where it would install. The hole is in the center on the Nest; on the old one you can see it was to the left. Bottom line, this meant I couldn’t cover up the old green with just the nest, and since I didn’t have any putty or paint handy, it was back to the Nest box for the decorative backing plate. Lift up the last layer in the box to reveal the backing choices; they have an option to mount on electrical boxes as well. I just needed the pretty plate to cover the ugly wall stuff.

Nest Install Backing Plate

Again, I cheated with my cordless drill (Makita 18V Lithium Ion, BTW, if you need a recommendation).  Would be more annoying (not impossible) to use their included screwdriver.

Nest Install Back

Now, I used my old, somewhat crappy level to install this. It didn’t quite come out straight, as you can see.  Then I noticed the built-in level, and also, the screw holes have a little play, so I loosened the bottom one and realigned using their level. Hey, look, it also aligned with the nearby wall edge at that point, too!

Nest Install Back Leveled

Oh yeah, I plugged in the two wires into the matching slots. One of the cooler but maybe non-obvious features of Nest is that it runs fine on your 24VAC line. Many new/digital thermostats require a “common” lead that provides dedicated power. Not so with Nest–no extra wiring needed. Even my ancient two-wire system works fine with it!  Just use their compat checker to verify yours.

My wires are tough (they were made back when men were men, wires were wires, and little furry creatures from Alpha Centauri were little furry creatures from Alpha Centauri); they are not huge but not thin either, so I used needle nose pliers to straighten them. A more obsessive person may have grabbed some electrical tape to cover up more of the exposed wire. Me? I don’t sweat the small stuff. It will soon be covered up.  We’re almost there! Next step, grab the pretty Nest and plug it on.

Nest Install Done

NOW, you can go flip the switch back on. My breaker box is in the basement, but no worries, when I came back up, it was waiting for me.  Time to setup. You say “Hi” to it, and confirm your language, then on to the coolest part of the gadget–it is Wifi connected. Seems to have a decent antenna, too.

Nest Setup SSID

I also thought the interface for entering the password is cool. The Nest slides so smoothly. Feels solid, and dialing it to enter the password was strangely reminiscent of using a rotary phone. (Yes, I remember using them, although they were definitely on their way out by that time.) Hello, nostalgia. And it wasn’t that hard either. They seem to have put thought into how fast you turn, inertia, and that sort of thing. Nice.

Nest Setup Wifi Password

After a short connecting message, it confirms, we have lift off!

Nest Setup Wifi Connected

Just a few more steps.

Nest Setup Steps

BTW, I glanced through the setup manual. It is super thin and easy to follow. You don’t really need it though at this point–just follow the prompts. After confirming I only have heating installed, it just needs to ask a few questions about it.

Nest Setup Heating Source

(For the record, I have oil. sigh. Maybe someday it’ll be different.)

Nest Setup Heating Type

Radiators, yup. That’s us. I had NEVER seen them in person before I moved up here to NJ. But I like them a lot better than forced air, I have to say. I like the feeling of the warm, radiant heat. When you keep the house cool-ish like we do, forced air sometimes feels more like air conditioning than heating–blowing around 66 degree air. Radiators always feel warm, reminding one of a fire. (And I love fires!)

A few more questions–zip code and number of thermostats. Now I get to my favorite question. When was this house built?

Nest Setup House Age

What? No 1910s?  Come on!

Next up, naming this Nest; wish I could do a custom name, but they just have some preset to pick from. Ah well. Can’t have everything!

Last, it asks a couple simple questions about temps and lets you know it’ll try to learn/calibrate for some time.  And.. we’re done!

Nest Setup Done

As before, it likely took you longer to read my account than it will to set your Nest up in real time. In fact, I bet Nest is annoyed with me because this may make it seem more complicated than it is. 🙂  Really, we’re talking <30 min end to end, and it felt great and easy!

At this point, I was pretty pumped, because I wanted to go control it from my phone.  But first, to the Web site.  I quickly signed up, and it detected the nest on the network. Too cool!  I walked over to it again, and it said this.

Nest Setup Added Account

Too cool!  In no time, I was managing my thermostat remotely.  THE POWER!!!

And the app is nifty. It seems to gradually reveal complexity (another great UX principle). Just tonight I discovered some new things that weren’t there before. Still, it is quite simple and pleasing. I like how it incorporates local conditions in the background.  For instance, now it’s like so.

Nest Control Home

I won’t bore you (more) with all the settings and stuff. The interface is quite nice and, in my estimation, easy to learn and use. And hey! Will you look at that!? I guess you can have everything–it let me rename my thermostat here.

Nest Thermostat Control

Note that when you hover over it, you can simply click the up arrow or down arrow to increase/decrease your thermostat setting.  You get the same basic interface on the phone and tablet (I use iPhone and iPad, FTR). There of course they smartly don’t rely on hover to see the up/down arrows. 😉

I am a little obsessive. Sometimes. About some things. I try to fight it, but it gets me sometimes.  I quickly set up a schedule (even though it wants to learn it by you turning it up and down). I mean, I don’t want to run downstairs in the morning to turn the heat up–I want it done for me! This is a minor criticism, but I guess it works for “most” people who wouldn’t otherwise set up the schedule.

In the Web interface, this is easy enough. Add a setting, then copy and paste it to the other days. OMG. Like, I programmed the three thermostats at my last place, and what a friggin pain!  No wonder they say 90% of people don’t do it.  I dreaded changing the temps, too, cuz it meant clicking and switching through about 100 fiddly switches.  This took me 30 sec.  Wow.

Nest Schedule

And yesterday, I discovered my new favorite feature–the energy records. I can see my obsession will not soon end.

Nest Energy

You can selectively drill into daily details to see just when Nest was powering on that monster of a furnace against your schedule for the day.  I think I’m in geek-homeowner love!

Now, time will tell if this does help me save money. I can’t see how it won’t. I mean, last winter (our first in this old house), I just left it on a constant 66-7ish setting on the dial, more or less. If nothing else, being able to have it turn down during the evenings should save a good chunk of change.  And considering how much this old house costs me per month to heat, trust me, in like two months it will probably pay for itself.

So that brings us to the final consideration. Is the Nest worth $250? Well, from the research I did, learning thermostats can save 10-15% on average. You can do the math based on your usage. But that’s just part of the story. This is one grand toy, after all, no? 🙂  So a great toy that can save you money?  Is it worth it?  I think so.

If you’re on the fence, I strongly suggest going for it. It’s awesome. Go order the thing, yo! (Don’t forget to check your compatibility first.)

P.S. Nest didn’t pay me for this review. I’m just totally psyched about it. It took probably 6x the time to put together than installing it took. (Don’t worry–I was watching Burn Notice in the background with the wifey for most of it.) But if you use my links to buy, I might get some small Amazon affiliate commission.  So that’d be a nice thing if you found this helpful.

HTML vs. Native Apps: The Jury is Still Out

Allow me to disagree with my esteemed colleague.  A few thoughts–just my opinion. He echoes another article I read recently (can’t find it now) that basically argues against native and for HTML5-based apps. I’ll offer a few points to the contrary here.

First, you don’t need a plugin for native phone apps, and often native apps run more smoothly. They also still tend give you a better chance of being discovered than, e.g., a pure Web search. AND, with a native app, you can get both Web coverage (host a Web page talking about and linking to it in the app store) and whatever app store coverage you get.

Another point in native app’s favor is that they tend to be optimized for particular platforms from a Design perspective, i.e., they feel native, they feel like the experience that the platform promises–the one that the person decided to buy over the others. They are also (usually) consistent, following platform patterns.  These points are not typically true for Web apps–especially since a major benefit (from the app creator’s perspective) is the whole “write once run anywhere” thing, so you end up with a vanilla app experience that is either native for one platform or for none.

About IE10 and HTML5–it’s not going to be immediately adopted. It’s not clear when, for instance, touch/gesture support will be pushed out to WinPhone yet. Even then, it will take some time for folks to update their phones, and you can’t effectively “be sure” it is there for some time yet.

This adoption problem is much more an issue on desktop. Saying HTML5 doesn’t require a plugin doesn’t tell the whole story because it requires a current browser, which for all intents and purposes serves the same function as a Silverlight or Flash plugin–the user has to have special software installed to use it.  And both of those plugins have much more of an install base right now than HTML5, and will for some time yet (a long time, in software years).  It would be very surprising to see major enterprises all moving to IE10 right away.  It would be nice, but I’m not holding my breath.

Three years from now, maybe it will be true that HTML5 is the obvious winner on the desktop, but I’m still not convinced it will ever be on mobile devices.  Most likely, the best strategy will be to come out of the gate with a mobile Web app OR choose a platform you think gives you the best bang for your buck initially, and then you can fill in the gaps (either building native for other platforms or Web app for your non-primary target).

Just my 2c.