Charlatan developers and the Blunt truth

Summary: A rant on political correctness in the programming world.

Ayende, developer of RavenDB and author of popular ayende.com programming blog, has been blogging the ugly, cringeworthy interviews resulting from his company’s recent hiring round.

Some developers couldn’t sort a list of strings. Others didn’t know what framework they were developing in. Aptly summing the lot, one developer with 6 years experience and a CV mentioning multi-threading experience said, "I only know BackgroundWorker."

The short of it is, we have a lot of charlatans in our industry. (See Why can’t programmers…program?)

But the comments to these posts tell a different story: bleeding hearts sympathizing with the interviewee and chiding Ayende for blogging about the bad interview.

Kelly Somers (@kellabyte), big data extraordinaire, complained:

"As an employer, I don’t think posts like this are a professional way to behave. Although they are anonymous, there is a human trying to make a living being humiliated here and I can only imagine how they might feel after having a bad interview only to then read it up on the internet in the public eye."

Patrick Smacchia, creator of NDepend, chimed in agreement,

"I am with Kelly here…You’d better mention only positive things that happen in the interview room."

“Only the positive things.” ಠ_ಠ

I have much respect for both Kelly and Patrick and the things they’ve built. However, what’s more important, a person’s hurt feelings or telling the truth?

If I was that interviewee, I’d feel bad, sure, but I’d also come to appreciate the truthful feedback. I’d want to know that I’m failing to use loops. Had I interviewed at DataStax or NDepend, I’d probably be calling them repeatedly, receiving uncertain answers about whether I’m hired or not, everyone beating around the bush and no one telling me just why it is that my calls aren’t being returned.

Contrast with Ayende’s approach, I’d just know straight up my current skills are lacking, and that I shouldn’t be advertising my many years of developer expertise if I can’t work with for loops.

When I visited Israel the other year, people were blunt, to-the-point, and honest. It was jarring, but good. Having lived in the US for my entire life, it’s been drilled into me that you never say what’s really on your mind. Criticism should be withheld for sake of politeness. If it will offend someone, nobody really tells the truth here.

Ayende’s honesty is wonderful for that reason. Yes, even if it were my code being criticized, I’d appreciate the honesty. Wouldn’t you?

I suspect this blunt honesty is foreign to most folks from the US, and is the reason some people are chiming in with bleeding hearts. They think "positive only" is better. “Think of the human being searching for a job!” But this sort of thinking is not really thinking at all, but rather emoting, thinking with your emotions rather than intellect. Compassion to the point of untruthfulness is not actually helpful to human beings.

I’d rather know the truth, even if it hurts. Wouldn’t you?

/rant

Startup! Use your software superpowers

Just finished giving this tech talk:

image

image

It may sound grandiose, but it’s essentially true: developers have a superpower. We’re the inventors of the modern age. We have a unique power that is new to humanity: we can build useful things and instantly put a thousand eyeballs on it. All for about $0 and very little time investment.

(My startup company, BitShuva internet radio, was the product of about a weekend’s work, where I churned out a minimally viable product and published it in 2 days. The net result is several radio stations across the web and a few thousand dollars in the bank.)

The things we’re doing with software are diverse and jaw-dropping:

Software is doing that, and more: giving us turn-by-turn directions, driving our cars, winning Jeopardy!, challenging Chess champions, letting us communicate with anyone in the world at anytime…the list is staggering and is only increasing.

And we, software developers, are the ones who make it all happen. This bodes well for our careers.

Building software is a superpower that shouldn’t be wasted building CRUD apps for insurance companies. That may be necessary to pay the bills, but developers should build their side projects to advance their goals and tackle the things they want to tackle.

Build your side project, build what’s interesting to you, build what you think the world needs. If nothing else, you’ll expand your horizons. And if it works out, you might just have contributed something useful to the world and even made a little money on the side.

My beautiful web development soup

Summary: Web development is chaotic, overwhelming, and beautiful. How many technologies does it take to build something useful on the web? You might be surprised. Advice for developers getting into web development.


3654636770_3b1a5d470bThis week I was working on my open source startup project, BitShuva Radio. I acquired a new client this week, but this client was unique because he’s a Java developer and wanted to know how to edit the open source code for his new radio station.

As I typed out my answer, it dawned on me that the sheer number of  technologies utilized in building a useful web application is staggering. That they actually work together is a testament of the beautiful soup that is web development today.

How many technologies does it take to build something useful on the web? Here’s my answer:

  • I use TypeScript, rather than plain JavaScript, for all client-side code. A superset of JavaScript with optional types, TypeScript is a well-structured, typed language with excellent tooling. I use it for practical reasons: as the app grew in complexity, the need for a more structured language became apparent. I ported the JS to TypeScript last month, and I’m quite pleased with the results.
  • KnockoutJS is used heavily absolutely relied on. BitShuva is a dynamic single page application, meaning we’re doing lots of dynamic updates to the UI in real time. Knockout lets us make dynamic UIs very easily without resorting to tons of DOM manipulation code. Instead of DOM manipulation, Knockout lets you change your objects, and your UI automatically updates. For example, songsOnScreen.push(new Song()) will automatically show the song in the UI, no jQuery DOM manipulation required. 
  • I use knockout.postbox for decoupled pub/sub communication between client-side code components. For example, when I hit the play button, the click handler doesn’t need to know about HTML5 audio or any infrastructure concerns. Instead, it calls ko.postbox.publish(“Play”). Whoever is in charge of playing audio simply calls ko.postbox.subscribe(“Play”, …). This way, the click handler and the HTML5 audio component don’t need to know about each other. Nice and clean. Bonus: it works with Knockout observables, so you can say currentSong.publishOn(“SongChanged”) to automatically publish messages on a particular topic.
  • UbaPlayer is used for playing HTML5 audio with a Flash fallback. 
  • For styling, we use LESS, the CSS superset. We use LESS because CSS is redundant; LESS lets us use variables and functions for code reuse, but still compiles down to plain CSS.
  • jQuery is still there, but not as much as you might think. Because KnockoutJS handles the DOM <—> code interaction, jQuery is only needed in rare cases where we need special DOM manipulation (e.g. to fade in/out an element). We also use jQuery to do AJAX calls.
  • The site generally uses Twitter Bootstrap UI toolkit for styling and consistency across the UI.
  • We’re using Google Web Fonts for typography. 
  • For images like thumb-up/down, play button, etc. these are actually font characters, from the special Font Awesome web font. Because it’s just a font, they scale infinitely without losing fidelity, and you can change their appearance (size, color, etc.) using plain old CSS stylings. Icon fonts are awesome.
  • We use Asp.NET MVC Razor view engine to actually render our UI. Because of heavy reliance on KnockoutJS, Razor isn’t needed much; it’s mostly just plain HTML that is dynamically swapped in through AJAX and KnockoutJS.
  • The server code is written in C# 5 using Asp.NET MVC 4 + MVC Web API
  • ASP.NET Web Optimization Framework is used for minifying and bundling the scripts and CSS.
  • The database is RavenDB, a modern, 2nd generation document database, easily the best NoSQL database in the .NET world. I use it because it’s blazing fast and simple to just start dumping objects into.
  • ReactiveExtensions (RX)  is used on the C# server end to treat events as observable streams, which can then write LINQ queries on top of. We also use its sister project, Interactive Extensions, for some useful extension methods to IEnumerable objects (such as .Do and .ForEach).
  • To load up the whole shebang and edit the project top-to-bottom, I use Visual Studio 2012 + TypeScript tools plugin (for editing/compiling TypeScript) + Web Essentials (LESS compilation, better tooling for HTML5 web standards, and more).

Holy cow!

Here’s the final tally of languages, frameworks, and tools used:

  • 5 languages – C#, TypeScript, LESS, .cshtml Razor syntax, plus bits of plain JavaScript here and there
  • 5 UI JavaScript frameworks – KnockoutJS, jQuery, UbaPlayer, Knockout.postbox, Twitter Bootstrap.
  • 6 server-side .NET frameworks – RavenDB, MVC 4, MVC Web API, Reactive Extensions, Interactive Extensions, Web Optimization Framework.
  • 3 tools – Visual Studio 2012, TypeScript tools plugin, Web Essentials plugin.

The sheer number of tools required to really build something useful on the web is staggering. You get the sense of why desktop developers — who often work in just a single language + UI framework (e.g. C# + WPF) — are hesitant to embrace the web. It requires massive retooling.

And to be truthful, this is only my beautiful web soup. I chose C# + KnockoutJS + TypeScript + LESS, but other web devs might prefer Ruby + BackboneJS + CoffeeScript + SASS. Or something entirely different.

The great thing is, there is so much evolution going on in web development space today, and this produces unique and specialized toolsets that help move the web forward. For example, languages like CoffeeScript and TypeScript are influencing the future direction of JavaScript.

It’s a fun time to be in web development.

My advice for developers? Learn a few web technologies that pique your interest and cook up your own beautiful web soup.

The big list of developer conferences in 2013

Looking for good software & technology conferences in 2013? I did a bit of scrounging around, talked with some colleagues, and came up with this big list of 2013 dev conferences, ordered by date.

  • W3Conf
    February 21-22
    San Francisco, California
    The W3C’s annual conference for web professionals. Latest news on HTML5, CSS, and the open web platform.
  • Web Summit
    March 1st
    London, Great Britain
    "Our events focus on giving attendees an incredible experience with a mix of world-leading speakers, buzzing exhibitions and effective, deal-making networking opportunities. Our illustrious list of past speakers includes the founders of Twitter, YouTube, Skype and over 200 international entrepreneurs, investors and influencers."
  • MX 2013
    March 3-4
    San Francisco, California
    UX and UI conference. “Managing Experience is a conference for leaders guiding better user experiences”
  • SXSW Interactive
    March 8-12
    Austin, Texas
    "The 2013 SXSW® Interactive Festival will feature five days of compelling presentations from the brightest minds in emerging technology, scores of exciting networking events hosted by industry leaders, the SXSW Trade Show and an unbeatable lineup of special programs showcasing the best new digital works, video games and innovative ideas the international community has to offer. Join us for the most energetic, inspiring and creative event of the year."
  • Microsoft VSLive Vegas
    March 25-29
    Las Vegas, Nevada
    .NET developer conference. “Celebrating 20 years of education and training for the developer community, Visual Studio Live! is back in Vegas, March 25-29, to offer five days of sessions, workshops and networking events – all designed to make you a more valuable part of your company’s development team.”
  • anglebrackets
    April 8-11
    Las Vegas, Nevada
    anglebrackets is a conference for lovers of the web. We believe that the web is best when it’s open and collaborative. We believe in the power of JavaScript and expressiveness of CSS the lightness of HTML. We love interoperability and believe that the best solution is often a hybrid solution that brings together multiple trusted solutions in a clean and clear way. We love the expressiveness of language, both spoken and coded. We believe that sometimes the most fun at a conference happens in the whitespace between conference sessions. More details at
    Hanselman’s blog.
  • Dev Intersection, SQL Intersection
    April 8-11
    MGM Grand, Las Vegas, Nevada
    Visual Studio, ASP.NET, HTML5, Mobile, Windows Azure, SQL Server conference. Focused on .NET and SQL developers.
  • TechCruch Disrupt
    April 27th-May 1st
    New York City, New York
    Technology and startups conference.
  • Microsoft VSLive Chicago
    May 13-16
    Chicago, Illinois
    .NET developer conference
  • Google I/O
    May 15-17
    Registration opens March 13th at 7am.
    San Francisco, California
    Probably the most anticipated developer conference in the world. Expecting some news on Google Glass, perhaps some haptics support in Droid devices, maybe a bit on self-driving cars…what’s not to love?Registration to be opened up early February. Tickets usually sell out immediately.
  • GlueCon
    May 22nd-23rd
    Denver Colorado
    "Cloud, Mobile, APIs, Big Data — all of the converging, important trends in technology today share one thing in common: developers. Developers are the vanguard. Developers are building in the cloud, building mobile applications, utilizing and building APIs, and working with big data. At the end of the day, developers are the core."
  • Microsoft TechEd
    June 3-6
    New Orleans, Louisiana
    Longstanding Microsoft developer and technology conference.
  • Mobile Conference
    June 6-7
    Amsterdam, The Netherlands
    Conference for mobile devs, focusing on the future of mobile app development.
  • WWDC
    June 10-14
    Apple’s highly-anticipated Worldwide Developer Conference. Tickets go on sale April 25th.
  • Norwegian Developer Conference (NDC)
    June 12-14
    Oslo, Norway
    Huge developer conference featuring some of the biggest speakers in software, including Jon Skeet, Scott Meyers, Don Syme, Scott Allen, and Scott Guthrie.
  • Microsoft BUILD
    June 26-28
    San Francisco, California
    Microsoft’s one big Windows developer event. All the big Microsoft names –from Guthrie, to Hejlsberg, to Hanselman — will be there. Expect great technical presentations, tablet giveaways, and an all-hands-on-deck Microsoft powerhouse conference.
  • SIGGRAPH 2013
    July 21-25
    Anaheim, California
    40th international conference and exhibition on computer graphics and interactive techniques. Graphics, mobile, art, animation, simulations, gaming, science.
  • OSCON
    July 22-26
    Portland, Oregon
    Biggest open source technology conference.
  • ThatConference
    August 12-14th, 2013
    Kalahari Resort, Wisconsin Dells, WI
    Spend 3 days, with 1000 of your fellow campers in 150 sessions geeking out on everything Mobile, Web and Cloud at a giant waterpark.
  • <anglebrackets>
    October 27th – 30th
    MGM Grand, Las Vegas, Nevada
    Hosted by renowned developer and speaker Scott Hanselman, <anglebrackets> is a conference for lovers of the web. We believe that the web is best when it’s open and collaborative. We believe in the power of JavaScript and expressiveness of CSS the lightness of HTML. We love interoperability and believe that the best solution is often a hybrid solution that brings together multiple trusted solutions in a clean and clear way. We love the expressiveness of language, both spoken and coded. We believe that sometimes the most fun at a conference happens in the whitespace between conference sessions.

    Author’s note: I attended the spring <anglebrackets> in April, and it was positively fantastic. Highly recommend this conference.

  • DevConnections and WinConnections
    Week of November 18
    Mandalay Bay, Las Vegas, Nevada
    Microsoft developer event

If you’re into futurism and technology evolution, The Singularity Summit might be for you, with speakers like Ray Kurzweil and Peter Norvig. The dates for 2013 are yet unannounced.

As for me, I’m headed to anglebrackets/DevIntersection in April. This dual conference will host speakers like Scott Hanselman, Phil Haack, Damian Edwards, Elijah Manor, Christian Heilmann. Should be a blast!

Know any good conferences not listed here? Let me know in the comments.

Stop writing for loops in Javascript

You have an array; you want to find an element in the array. What do you do?

Most developers go with the old procedural for loop:

var items = [
   { Name = "Matthew", Id = 1 },
   { Name = "Mark", Id = 2 },
   { Name = "Luke", Id = 3 },
   { Name = "John", Id = 4 }
];

// Find the item with Id === 3
var matchingItem = null;
for (i = 0; i < items.length; i++) {
     if (items.Id === 3) {
       matchingItem = item;
       break;
     }
}

  // Do something with matchingItem
}

What’s wrong with this?

It’s the classic procedural programming affliction: over-specification. It painfully specifies all the steps the program must take to reach the desired state.

All you want is the item with an Id of 3, but instead you create a new loop variable, increment that variable each loop, use special loop iteration language syntax, index into the array, check if it matches your condition, store the match in a mutable variable.

The how obscures the what.

Thank you sir, may I have another.

This obfuscates the intent of your code via over-specificying pageantry.

It’s also error prone. The above code omitted the var declaration for the loop variable i, (did you catch that?), thus adding it to the global scope (oops!). Developers often forget to break; out of the for loop when a match is found, resulting in superfluous loop iterations at best, unintended behavior at worst.

Can we do better?

How about .filter?

Today’s JavaScript (1.5+) includes the built-in .filter function:

var items = [
     { Name = "Matthew", Id = 1 },
     { Name = "Mark", Id = 2 },
     { Name = "Luke", Id = 3 },
     { Name = "John", Id = 4 }
  ];

  // Find the item with Id === 3
  var matchingItem = items.filter(function(item) {
     return item.Id === 3;
})[0];

  // Do something with matchingItem...

.filter is a higher-order function that returns all elements in the array that match your predicate. The above code calls .filter(…) and then gets the first matching item.

This is better, but still not right.

What’s wrong with this? Like a for loop that forgot to break; out of the loop after finding a match, .filter will iterate over your entire array, even if it already found a match. This will result in superfluous iterations. And if your code doesn’t account for multiple items matching your condition, you’ll get unexpected behavior.

Solution

There’s no way to do this efficiently or succinctly using any of the built-in JavaScript array functions.

Because of this, most developers just do the ugly one, or the inefficient one.

A proper solution would be a function added to the Array prototype chain. In lieu of the browser vendors doing that, we can do it like this:

if (!Array.prototype.first)
{
   Array.prototype.first = function(predicate)
   {
     "use strict";   
     if (this == null)
       throw new TypeError();      
     if (typeof predicate != "function")
       throw new TypeError(); 
     
     for (var i = 0; i < this.length; i++) {
       if (predicate(this[i])) {
         return match;
       }
     }      
     return null;
   }
}

Here, we’ve defined a .first method on the Array prototype. It uses the efficient-but-ugly for loop. But instead of coding up this for loop every time, we can now just call our higher-order function:

var items = [
   { Name = "Matthew", Id = 1 },
   { Name = "Mark", Id = 2 },
   { Name = "Luke", Id = 3 },
   { Name = "John", Id = 4 }
];

// Find the item with Id === 3
var matching = items.first(function(i) { return i.Id === 3 });

// Do something with match...

Much cleaner, syntactically similar to .filter, but without the superfluous iterations.

JavaScript has no lambda syntax (yet), so it’s not as clear as it could be. Ideally, we’d write it more succinct, something like:

var matchingItem = items.first(item => item.Id === 3);

We’ll have to wait for the proposed arrow function syntax for the next version of JavaScript before we can get that succinct.

In the meantime, Array.prototype.first is a nice polyfill with decent syntax, allowing your code to focus on what, rather than how.

TypeScript, CoffeeScript, and the state of web development in late 2012

Summary: The problems facing web development today. Microsoft’s new TypeScript language, what problems it addresses, and what it leaves wanting.


Earlier this year, I predicted Microsoft would be utilizing their still-baking Roslyn compiler service to transform C# into targets besides IL, such as JavaScript. That prediction didn’t come true, but I was close: Microsoft is indeed getting into the compile-to-JavaScript games, but they’re doing so with a brand new language announced today, TypeScript.

JavaScript is a messy, powerful language.

The whole compile-to-JavaScript trend addresses a real problem in web development today: JavaScript just isn’t a great language for big web apps. Some argue it’s not a great language for anything besides quick DOM + event handler glue. And honestly, they kind of have a point.

Half baked, escaped the lab too early, leaving us silly things like implicit conversions for equality comparison. Quick, what’s the result of this?

foo = 0 == (100 + 23 === “123”)

If you guessed the boolean true, you’re right (I think!) but it shows kind of the trouble you get into when languages try to do too much for the developer.

But silly syntax puzzles aren’t the real reason JavaScript is bad for big apps.

No, it’s for a number of more deeply-seated reasons the difficulties arise when coding a large JS app with a team of developers:

  • The automatic, often accidental, inclusion in global scope. (The above snippet adds foo to the window object, woops!) This results in code littering the global namespace at best, and overwriting other code’s functionality at worst.
  • No modules or namespaces for code organization. In addition to contributing to the above problem, a lack of built-in modules means we have to resort to 3rd party libraries for dependency detection and loading. Often, developers will just take the easy route and load everything, resulting in web apps that load slowly and use excessive memory.
  • A 10-ways-to-do-this inheritance pattern that kinda sorta looks like classical inheritance but is really prototypal. Some codebases standardize on a 3rd party library (such as MooTools or Prototype), while other codebases become the Wild West of inheritance problems.
  • Without any types, refactoring and symbol analysis becomes painful. For example, want to find all callers of a function? Have fun with CTRL+F, and weed through who’s calling your function and who’s calling a function of the same name. Want to rename a property? CTRL+H and pray that no other code file has a property of the same name. And so on.

Plus other uglies like optional semicolons to end lines, resulting in production-level frameworks being filled with, in the words of JavaScript creator Douglas Crockford, “insanely stupid code.”

But one thing JavaScript is, is capable. It’s a functional, prototypal, object-oriented language. General purpose.

So rather than wait for JavaScript to slowly evolve through standards bodies and bickering, we build our own fast-evolving languages that compile down to JavaScript.

CoffeeScript: A (slightly) better JavaScript

At the time of this writing, the compiles-to-JavaScript language de jour is CoffeeScript: a superset of JavaScript that adds things like classes, and removes things like semicolons, parenthesis, and other staples of the C family of languages.

But CoffeeScript still lacks a proper compiler. Oh, sure, there’s the CoffeeScript compiler, but it’s not really a compiler. It can’t tell you if you’re passing the wrong type into a function. It can’t tell you if foo.Blah will error at runtime, because there’s no symbol analysis.

CoffeeScript also suffers from its straddle-the-fence stance on compatibility with JavaScript. Want to include parens? OK, valid! Want to exclude parens? OK, valid! While it sounds nice in theory, in practice you end up with an inconsistent codebase, and an awkward rule set about when optional syntax isn’t really optional.

And though CoffeeScript tried its hand at list comprehensions, it falls far short of what Python and C#/LINQ devs have been enjoying for years.

To make matters worse, there’s still no real standard library for JavaScript. Just a mash of tiny libraries that do things differently ($.map? or array.map?)

And finally, we still have terrible debugging support. Got Coffee? OK! How do I set a breakpoint on this CoffeeScript line? Silly developer, you can’t! You have to look at your Coffee, figure out which .js files were emitted, find those in your favorite web browser developer debugger tool, and break into that. Grahgghhlhlhlhsl.

End result? As of late 2012, we don’t have any great options for building big web applications. We need a language that supports symbol analysis (refactoring and the like), type error detection, modules, classes. We need a web development platform with a standard library. We need a web development platform that supports debugging in the language you authored.

Enter Microsoft’s TypeScript

TypeScript is a Microsoft attempt at solving these problems, in particular through the adding of types. It’s JavaScript with types.

Does it solve all the problems?

Too early to say.

It was announced only today, and I just downloaded the damn thing. At a glance, they solved the classes and modules problem. And by adding types and tooling support in Visual Studio, you can actually perform refactorings in your big codebase; something Java and C# developers have been enjoying for over a decade, but web developers have been suffering without.

It doesn’t appear to have a standard library – sorry, LINQ fans.

Nor does it appear to support debugging in Visual Studio.

UPDATE: The TypeScript compiler supports an experimental –sourcemap command line argument that generates a source map file. These source map files can then be used to debug TypeScript in the browser. I predict that Microsoft will use these source map files to integrate into Visual Studio’s debugging experience, likely through a special debugging browser similar to the existing Page Inspector.

So that answer for now appears to be, TypeScript is an incremental improvement upon CoffeeScript: types and modules and symbol analysis are a nice addition. We’re still missing some important things, namely, a standard library and a powerful source-language debugger. Until we get these things, web development is still a second class experience.

Code Camp interview

Summary: Joining the Twin Cities Code Camp leadership team. Being interviewed by Mike Hodnick, a well-known Minnesota developer and Code Camp leader. We talk software, the future, code camps, and, of course, llamas. If you find this amusing, you may want to follow up when the tables are turned and I interview Mike.

Who are you?

I’m Judah Gabriel Himango, I work for Avtex. I like programming. I like thinking about technology futures and the evolution of software. But mostly I like programming. Creating things is fun.

What are you most excited about in joining the TCCC leadership team?

The existing TCCC leadership is composed of some of the most well-known, respected names in the Minnesota software community. If I surround myself with excellent people, I might trick people into thinking I’m excellent, too.

Why is TCCC a great event to you?

Code Camp gave me perspective on the Minnesota dev community. Helps you see the broader picture, outside of your little technology ghettos and outside your company. I love talking with nerdly folk; with them I am in my element! 🙂 Really, the reason Code Camp rocks is the people. You get to talk to other devs you’d normally never be exposed to. Good networking comes out of that, but it’s not all about career — it’s good to pick other people’s brains, hear what other people are building, expand your own ideas and horizons. Code Camp does that. Oh, and the tech presentations are fun, too.

Llamas or Alpacas?

In my last Code Camp talk, I built, in front of a live audience, Twin Cities Llama Radio. Oh yeah! May the llamas reign forever and ever.

As a programmer, what is your technology comfort zone (what do you typically work with)?

Oh man. I typically work web dev these days — everything is moving to the web. But, honestly, even though I’ve done web dev for 2 years, I’m not really comfortable, in fact, I feel inadequate. It’s like I should really know more than I do, and someday, somebody’s gonna find me out and expose me as an imposter. Even in my talks, I preface my them with, “Hey, I am not an expert! Forgive me for blatant factual errors. But listen to me anyways.” 🙂

But, yeah, web dev is where I’m working now, where I think the most innovation is happening, and where I’ll be for the foreseeable future.

What is a hidden gem of programming that you think every programmer should know about, but most don’t?

Distributed map/reduce function in Erlang. Yes, Bob, I did.

Do you contribute to any open source projects?

Yeah, I’m a big believer in open source, honestly. I’ve contributed to some libraries I’ve found useful, such as HtmlAgility Pack, RhinoMocks, Lucene.NET, and Ninject. I’ve also created a few open source projects for my own stuff, like Chavah Radio. I’m currently in the process of launching a startup, and my main product will be open source as well.

Second try: llamas or alpacas?

Alpacas are llama-wannabes with an inferiority complex. Also, did you know *anyone* can start a Alpaca farm? That’s what an infomercial told me. I mean, are Alpacas so depraved and needy that they resort to late night infomercials? Llamas, dignified and honored as they are, would never stoop to such a low.

Five years ago, did you see yourself doing what you are doing now?

No way! I was really sheltered, actually. I was at a small company writing software; they treated me really well, and I have fond memories of my time there, but I was kind of living in a technology ghetto, ignorant of the state of technology, jobs, and trends in the industry. Code Camp helped me break out of that and see the broad software community, engage with other software people, exchange ideas. Since then, I’ve started speaking at software conferences and user groups, growing my skills, expanding my horizons. I think the last 5 years have been awesome, I’ve advanced myself professionally, I look back and am astounded at how far I’ve come. (Woohoo, go me! :pats self on back:). I’m looking forward to the next 5.

Why does a mouse when it spins?

LOL. At first, I read that, and I was like — wait, is that a typo? OH LOLZ HE MADE A MISTAKE!!111 But then I Googled it, and now I see the light and higher the few. Probably the same difference as a duck, one has wheels. Yee-ahhh!

Apple: Please fix HTML5 on iOS

I’ve built an HTML5 audio player, Chavah Messianic Jewish Radio, that “works” on iOS.

By “works“, I mean, it plays the best it can on Apple’s crippled iOS <audio> implementation. At the time of this writing, this includes iOS 5, tested on iPhone 3 and 4, and iPad1 through iPad 3.

How is <audio> broken on iOS? Let me count the ways:

  • Apple does not let you play audio until user interaction. For me, this means detecting iOS, then showing the music as paused until the user clicks play. Their reasoning is that this will consume data and battery; in practice, though, it cripples web apps, forcing us to resort to platform-specific hoop-jumping  to get the web to work on your platform, Apple. It effectively stifles the evolution of the web in the same way IE did in the late 1990s.
  • Apple does not allow you to play concurrent audio files. This is a huge crippler for gaming apps that need to play sound effects, for example.
  • Apple doesn’t support OGG format. Patent-encumbered formats work, of course, but without support for free and open formats like OGG, Apple is effectively creating a long-term thorn in the side of the opened web.
  • Every dynamic <audio> element must receive user interaction. If you want to play successive sounds (one after another) without receiving user interaction for each one, you must use a single <audio> element, then do the iOS <audio> dance: set existingAudio.src, then call existingAudio.load(), then call existingAudio.play().
  • Audio events don’t fire unless Safari is in the fore. While audio will continue playing if the user switches to a different app, the .ended event won’t fire. This means it’s practically impossible to build a music player web app.

Apple, please, please, please give us better support for HTML5 in iOS Safari. Here are your action items, Apple:

  1. Let HTML5 audio work in the background.
  2. Support OGG.
  3. Support pre-loading audio.
  4. Support concurrent audio.
  5. Let us play audio without user interaction.

Do those things, Apple, you’ll be the industry leader in mobile HTML5 audio, everyone will emulate you, you’ll once again be leading the way, and HTML5 web apps will work best on your platforms. Wouldn’t that be good for Apple?

Yes, these features will use data and the battery, but native apps already do this, so why cripple web apps? Stop stifling the evolution of the web, and start being the leader. Make HTML5 <audio> a first-class citizen on iOS.

Visual Studio 11 crashes with InvalidCastException

UPDATE: This issue can be solved by running the steps described here. There’s also a Microsoft Connect ticket describing the problem.

Just got Visual Studio 11 beta (with recent VS March Update) to crash consistently on start-up:

Launch VS, immediate crash:

Debugging that brings up the following exception:

The exception detail reads:

System.InvalidCastException was unhandled
HResult=-2147467262
Message=Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘Microsoft.VisualStudio.OLE.Interop.IServiceProvider’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{6D5140C1-7436-11CE-8034-00AA006009FA}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Source=mscorlib
StackTrace:
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.VisualStudio.OLE.Interop.IServiceProvider.QueryService(Guid& guidService, Guid& riid, IntPtr& ppvObject)
at Microsoft.VisualStudio.Shell.ServiceProvider.QueryService(Guid guid, Type serviceType, Object& service)
at Microsoft.VisualStudio.Shell.ServiceProvider.QueryService(Type serviceType, Object& service)
at Microsoft.VisualStudio.Shell.ThreadHelper.get_Invoker()
at Microsoft.VisualStudio.Shell.ThreadHelper.InvokeOnUIThread(InvokableBase invokable)
at Microsoft.VisualStudio.Shell.ThreadHelper.Invoke(Action action)
at Microsoft.VisualStudio.Services.TaskSchedulerService.VsUIThreadScheduler.<>c__DisplayClass2.<QueueTask>b__0(Object _)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
InnerException:

How did I get in this state? I’m unsure, but I think I accidentally hit F1 key. (Oh noes, the dreaded Visual Studio F1 key!) Somehow, I think that wired up the VS help, which resulted in a consistent crash at boot.

Running devenv.exe /resetskippkgs didn’t fix it. Running a full VS repair doesn’t fix it.

Anyone else hitting this issue?

5:01 developers are visionless hacks

The 501 Manifesto states that:

  • Our families are more important than the commercial goals of business owners
  • Free time is more important than free snacks
  • Living our lives is more important than maintaining our personal brands
  • Sustainable pace is more important than muscle-man heroics
  • Our personal creative projects are more important than commercial products the world doesn’t need
  • Having money for nice clothes is more important than getting free t-shirts from Microsoft
  • Playing fuĂźball in the pub with our friends is more important than playing fuĂźball in the office with our team leader
  • Not being a dick is more important than being a rockstar

“501” refers to programmers who punch out at 5:01pm and never think about technology until 9am the next morning. They don’t read programming blogs or books, nor do they have a desire to advance their craft. Technology is nothing special to them, software is just another job. They might as well be bagging groceries if the pay was comparable.

There’s some good to be gleaned from this manifesto. If your software job is all you do, your life will pass you by and you’ll wonder why you spent so much of your life living for a corporation. You’ll realize what a waste of a life it is to make all that money but not, you know, live. The young & ambitious tend to overlook this wisdom.

Having a life outside of tech is important and rewarding. For me, I play music, I help run a religious congregation, I spend time with my kids and my wife. Those things are hugely rewarding.

I sympathize with the 501 manifesto, but there’s something not quite right here.

The manifesto confuses corporate interference into personal life with passion for technology. That is to say, it incorrectly implies the people who are passionate about technology are those enslaved to their corporate masters. It makes this confusion when it says those who “write technical blogs, attend user groups, or contribute to open source projects” are those who are enslaved by their corporate masters.

It’s silly, because my corporation didn’t ask me to write this blog, attend Code Camp last week, go to user groups, or contribute to open source projects. In fact, many corporations frown on such things, since it takes time away from working on The Project. My corporate masters didn’t ask me to do those things, nor did I do those things in order to impress my corporate masters.

Instead, I do these things because I love technology. And I suspect those of you who do these things do so because, like me, you’re passionate about software and technology, not because some evil corporation forced your hand.

I entered technology because it’s my passion. I take joy in writing software, and in a bigger sense, I consider technology a frontier for humanity and the advancer of civilization. More on that in a minute.

If you entered the technology field for other reasons like money or easy labor, I suggest finding a career you are passionate about. It’s hard to put a price on happiness, and if you aren’t happy with your choice of career, get out before you waste any more of your life on it.

Why be passionate about technology?

I find it freakin’ awesome that we can make new things. We’re in a new age, an age of technology, and we’re the inventors at the fore. We build things from scratch! Then put those new things in front of people. And some of those things might be so useful, that people will use those things regularly. What a rare and precious opportunity we have, that we can build and invent new things, things that can impact humanity.

Hubris? Not at all:

We explore the universe because of technology.

We fix sick people because of technology.

We can communicate with anyone in the world via the push of a button because of technology.

We prevent disease because of technology.

We have the sum total of humanity’s knowledge in a single repository — the internet — because of technology. That we have a single repository containing the sum of human knowledge for the first time in our history is an accomplishment in itself, but just wait until you see the ramifications of this knowledge freely available to all. It will result in an explosion of learning, new technology, new ideas; raw civilization advancement.

I want to be part of that. It’s why I have a passion for technology. It’s why I don’t consider software, the brains behind technology, just another job. I don’t stop thinking about it at 5:01pm. Technology is a frontier for humanity. And I’m going to add to it, even if through some insignificantly small contribution.

Shortsighted and visionless is the person who looks at software as just another job, technology as just another field. If that’s you, find a job you take joy in, and in a field you are passionate about. Your life will be happier.

For the rest of us, the 21st century is a great time to be alive. We, the technologists, are the new inventors. We are the future, and the future, my friends, is bright. Watch and see.