Thought experiment: letting git normalize whitespace

I’m working across a lot of different repos these days, and while fixing a whitespace issue in one of my patches, I wondered if it would be possible to eliminate this altogether.

Working with git, we already have a version of what I want in terms of core.autocrlf.  You wrote this patch on Windows, I’m on OS X, and our server is Linux?  No problem, we’ll just use Unix EOLs and have git automatically manage the line endings whenever we checkout or commit.  In other words, when I checkout the code locally, I get a version of it customized to my environment.  There’s a canonical version that git will store, but every developer can have something different in their editor.

Now let’s go one step further.  Imagine you need to add the following code, as I did today:

module.exports = function( req, res ) {
  res.json({
    http: "okay"
  });
};

How many arguments can you have about how to style that code?  Come on, what would you r- in this?  “Dave, no space between `(` and `req` please;” “Dave, you need to indent with 4-spaces not 2;” “Dave, you should just put that `res.json` all on one line.”

The truth is, there’s no right answer here.  Of course there are famous examples of automatic semi-colon insertion causing havoc (`return\n{` vs. `return {`), but let’s stick with my example code for a minute.  Could we let git manage the whitespace here?  Could we, in other words, take that code above, and when I commit, actually store this:

module.exports=function(req,res){res.json({http:"okay"});};

Now imagine that I’ve got a .gitstyle file in my tree, or I’ve somehow specified config options globally, and I can tell git how to style this code again when I check it out.  Imagine you like 8-space indents and I like 2-spaces; imagine you’re allergic to spaces around arguments, and I love them; imagine your OCD demands that all variable declarations line up on the equal sign, and I’m happy to let them wind their way down my editor like a raindrop on a window.  And, imagine we can both do what we like with the same code in the same tree!  Imagine there’s no style guide, it’s easy if you try…

BUT DAVE, THIS CAN’T WORK BECAUSE <strong-reason />!!!  Sure, there’s all sorts of things to work out.  This is a thought experiment.  I’m supposed to be grading final assignments right now, and I needed to procrastinate.  But if this could work, it would be so, so useful!

Patches accepted (please use 2-space indents).

Posted in CDOT, MoFoDev, Mozilla, Mozilla Education, Seneca, Teaching Open Source | 9 Comments

Toward Webmaker Custom Elements, Web Components

I’ve been thinking quite a bit lately about how Webmaker can take advantage of the work being done on Web Components and Custom Elements.  I tasked Pomax with doing some research and prototyping, and the results have been encouraging.  I wanted to say something about my current thinking and what we might do.

One of the successes we had with Popcorn.js was that it became really easy to create plugins that could take care of the complexities of working with third-party APIs and showing web content dynamically, and linearly in time based on media resources.  Consider the Google Map plugin, which allows one to specify a location, map type, etc. and have a map dynamically load within the provided container div:

var p = Popcorn( "#video" )
  .googlemap({
       start: 5,
       end: 15,
       type: "ROADMAP",
       target: "map",
       lat: 43.665429,
       lng: -79.403323
  });

We’ve seen people make all kinds of plugins to simplify the use of more complex APIs like this.  Often it means dynamically loading some script, setting up a div or iframe, adding an element with a particular class name or id, and applying some styles.

There are a few things I’ve always wanted to improve about it, though.  First, how to properly combine a bunch of styles with a plugin.  Currently a plugin like the googlemap one is just JavaScript.  In reality, you almost always want a mix of JS and CSS, and doing CSS in script is not ideal; nor is having to manage the loading of two files per plugin (*.js, *.css).  A second issue is that these plugins are tightly bound to Popcorn, which is fine if you’re time-based experiences, but not so good for a normal web page.

With custom elements, we can solve a lot of these problems.  First, a custom element is a simple HTML file containing the definition of a new element, any associated styles, and scripts.  I use it in my page by loading it via a link:

<link rel="component" href="webmaker-components.html">

I love the simplicity of this method of packaging and loading new elements.  This file can include one ore more new elements, making it possible to do some server-side bundling for dynamic builds–imagine loading components a, b, c, and d via http://components.webmaker.org?c=a,b,c,d.

Now in your markup it’s possible to take our Google map from above, and rewrite it like so:

<webmaker-map start="5" end="15" location="Maruyama Zoo">
</webmaker-map>

Here content attributes on the custom webmaker-map element provide a way to indicate start and end times, and a location to pass thorugh to Google’s API.  However, while I can specify timing info, I can also leave it off, indicating that the map should always be visible:

<webmaker-map location="Maruyama Zoo"></webmaker-map>

By moving the functionality of the Google Map plugin to a custom element, we’ve made it possible for it to be used in any web context or tool.

You can see this in action in Pomax’s demo page: first with timing info, second without as a static web page.  View the source of both pages.  First off, notice how little code there is, and more, how it’s all markup vs. script.  You might be wondering why this works at all, since browser vendors are still defining and implementing the spec.  You’ll see that this uses a polyfill to give us the ability to play with things now.

This model of providing functional-units to authors is also exciting in the way it lets us mix and match depending on the needs of the individual.  For example, lets say you want to add comments to your page.  One option would be to use Facebook’s comments plugin, another would be to use Disqus’s embed.  Both can be wrapped into custom elements, and users can choose.  I did just that for Facebook’s comments: code (view source) and demo (scroll to the bottom).  Here I use

<facebook-comments></facebook-comments>

to add the functionality I want.  No scripting of any kind, which means that this becomes accessible to so many more web makers, for whom coding is beyond their reach.  Whenever we can reduce complexity like this, we should do it.

I think moving toward HTML-based custom elements vs. script-only plugins is going to make a huge difference.  It’s going to mean that it’s easy to integrate with existing tools and workflows, easy to find and use them (they are just web pages, after all), and most of all, easier for non-devs to use all these amazing APIs and services, which require coding.

Pomax and Matt have already started work to convert Popcorn Maker to use this, and are making good progress.  I’m looking forward to building more pieces of the Webmaker tools and gallery infrastructure using these same methods, and I’ll write more about or progress later when I have something to show.

Posted in CDOT, MoFoDev, Mozilla, Mozilla Education, Seneca | 1 Comment

Watching people use Media Clips

I wrote previously about our work to add Media Clips to Popcorn Maker. Since then we’ve watched as people have started to make things with it, from Ron Swanson dancing to any song to the International Space Station orbiting Earth, which has been a lot of fun.

One project Brett showed me today was done by BBG as a procedural storytelling experiment using a SoundCloud audio monologue about the election of the new Pope.  It’s a really good example of how one can take a bunch of source media (multiple YouTube clips, images, text, audio clips) and mix them together into a more complete, seamless, web-media experience.  What’s even better is that you can click “Remix” and see how it was done.  I’ve done just that in the image below, which shows the media clips they’ve used in the Media Gallery, and the timeline where they get used.

I love the final effect–it really feels like something new, something I don’t see on the web right now: people have all kinds of tools for telling stories spatially, but not in time, linearly.  We’ve long had people making fully rendered videos, but that’s not what this is: this is taking media and resources from across the web and mixing them together in the browser.  We’re still testing and evolving this, but already it’s getting to be quite usable.

I’m equally interested to see what people will do with another experiment we’re trying, using YouTube’s webcam uploader.  I think when we combine user created media with the ability to mix audio and video from other sources, we’re going to have something really interesting.  Almost there…

Posted in CDOT, MoFoDev, Mozilla, Mozilla Education, Seneca, Webmaker | 2 Comments

‘Pattern Recognition’ pattern recognition

Though he does little to develop it, one of the enduring images for me of William Gibson’s novel, Pattern Recognition, is his idea of jet lag, and the disconnecting of the body and soul, how the speed of modern travel unravels us.  He writes:

She knows, now, absolutely, hearing the white noise that is London, that Damien’s theory of jet lag is correct: that her mortal soul is leagues behind her, being reeled in on some ghostly umbilical down the vanished wake of the plane that brought her here, hundreds of thousands of feet above the Atlantic. Souls can’t move that quickly, and are left behind, and must be awaited, upon arrival, like lost luggage.

This image has always stayed with me.  It’s something I’ve pondered at different times, likes yesterday while reading the BBC web site.

Nilson Tuwe Huni Kui came to New York from the rainforest to study as part of Tribal Link’s Indigenous Fellowship Program.  Of his trip, he says:

I came to the city of New York directly from the rainforest.  It’s a very long trip. First you arrive physically and you are very tired.  But only after a while, your soul gets here too.  Because the plane is very fast, but the soul takes longer to arrive.

It’s a beautiful thought, and I’m glad to have been reminded of it again.

Posted in Reading | Comments closed

HTML5 time and data elements in Firefox

HTML5 includes some great additions for authors wanting to work with microformats and microdata in markup.  Last week I finished implementing the new <time> and <data> elements in Firefox (see bugs 629801 and 839371).  You can already use them in Nightly, and they should ship as part of Firefox 22.  I wanted to say something about what they are, how you can use them, and why I implemented them.

The idea behind both elements is to make it easier for authors to include various kinds of data in markup.  The <data> element enables one to store extra machine-readable data along with textual content.  For example, imagine I want to display a user’s name, but also include their user ID without displaying it:

<data id="user" value="humphd">David Humphrey</data>

The <data> element adds a new attribute, value, which contains a string representation of your data.  In script I can use the .value property to get the reflected value:

var user = document.getElementById("user"),
id = user.value;

In the past people used data-* attributes to do something similar, for example:

<span id="user" data-username="humphd">David Humphrey</span>

This works well, but it introduces a non-standard way of naming such data.  With the <data> element, all such data is accessible via the value attribute and property.

The value of a <data> element can be anything, from part numbers to IDs to co-ordinates–your scripts can parse it out and decide what to do with it. When the value you wish to store is really some form of date or time, the more appropriate choice is <time>.

The <time> element a specialized form of <data> used to add machine-readable dates and times to web pages.  There are a few ways to use it:

<time>2013-03-05</time>
<time datetime="2013-03-05">Today</time>

In both cases a <time> element is used to markup a date.  The latter uses the datetime attribute to record a machine-readable date/time value.  In JavaScript you’d access this value via the element’s .dateTime property (note the use of a capital ‘T’ on ‘Time’).  The .dateTime property reflects the datetime attribute.

I wanted to implement these for a few reasons.  First, one of my classes is implementing the HTML5 <track> element right now, and I wanted to show them how Mozilla’s new WebIDL bindings work with some simple examples.  Second, I wanted to do some work on the ideas Atul mentioned in his blog post about Markup APIs.

One of the goals Brett and I have this year for the Webmaker tools is to have them publish pure markup vs. using JSON or JavaScript.  We want to make it possible to create dynamic web experiences using only HTML and CSS.  I’ll write more soon about what we imagine, but the idea of being able to include start and end times in markup was very interesting to me, since much of our work is building time-based web pages using media with Popcorn.js and Popcorn Maker.

It’s neat to see that people are already using these elements in the wild.  Github, for example, uses <time> to record detailed info about commits, while not cluttering the UI with overly verbose data, for example:

<time class="js-relative-date updated"
datetime="2013-03-05T07:21:28-08:00"
title="2013-03-05 07:21:28">March 05, 2013</time>

I’m looking forward to seeing how people will use <data> as well–I haven’t been able to track down any users of it yet, but I’m sure they’re out there.  If you know of any, throw links in the comments.

Go forth and microformat!

Posted in CDOT, Implementing WebVTT, MoFoDev, Mozilla, Mozilla Education, Seneca, Teaching Open Source | Comments closed

Webmaker – Sequencing Web Media

One of the most requested new features we get for Mozilla Webmaker is web media sequencing.  Users want to be able to use multiple video or audio clips in a single experience.  This past week Scott and Kate, with help from Matt and Chris, have been building and testing a solution in Popcorn Maker.

The idea is to make it easy to pick media clips, including HTML5 audio and video, YouTube, SoundCloud, and Vimeo, and let users position each clip along the timeline, and within the video canvas.

Here two YouTube clips have been added to the gallery.  I might want to use the video from one (surf video) and the audio from the other (“Wipe Out”).  The sequencer supports video+audio, video-only, and audio-only for each clip.  Next you figure out where to place clips in the timeline:

Here a Vimeo video and an HTML5 video are positioned within the timeline so that the former will start part way through the latter.  We can also specify the position and size of each visual clip within the video canvas, which means we can do interesting parallel layouts of multi-video experiences.:

In this example, four separate YouTube videos are positioned into a common space, with one of them occupying the majority of the space, and thereby emphasizing its importance  Each clip can be resized or moved (you can see that one of the clips is selected in the editor and has resize handles).

The Sequencer feature is still in active development, but is ready to be tested.  You can already make some interesting things with it.  Here are some examples you can look at:

You can remix any of the above, or make your own using this experimental branch.  You can let us know about issues you find or make suggestions in this bug.

Posted in CDOT, MoFoDev, Mozilla, Mozilla Education, Seneca, Teaching Open Source, Web Made Movies, Webmaker | Comments closed

On Code Review

One of the discussions happening right now in the Mozilla Foundation software team is whether mandatory code reviews are a good thing.  I’ve had versions of this conversation a number of times in the past few months, and today I’m going to write my thoughts down so I can point at them when it comes up in the future.  Before I begin, I’ll be honest and voice some frustration, and wonder aloud why this is even necessary.  To me, the question of code review is resolved: you should do it, and the effects on your code, community, and project will be positive.  However, I think it’s a useful exercise to defend things you hold to be true; so here are some of my thoughts on the subject.

My introduction to code review, and the type I know best, is the one practiced by the Mozilla project, specifically what happens with code changes making their way into Gecko, Firefox, etc.  The easiest way for me to describe what happens is to show you some examples.  Before I started writing this, I went and picked a handful of the most recent changesets landed in the mozilla-central repository.  The first thing to note is that these changes explicitly point at the review process, calling out the the reviewer by name:

diff
browse
4a1b771880d8
2013-01-16 18:39 -0800
Matthew NoorenbergheBug 829995 – Ignore case of .url extension when migrating bookmarks from Internet Explorer. r=felipe
diff
browse
7d49dd8c58dd
2013-01-16 18:39 -0800
Matthew NoorenbergheBug 496471 – Silence satchel warning about ORDER BY without an index since an index can’t be used. r=dolske

Along with who wrote the code, the bug being fixed, and a description of the problem, we also see who did the review, r=reviewer.  The person who wrote the code, and the person (or people), who did the review, both show up in the history of the code.  That’s a fundamental part of how we work.

What kinds of code needs a review?  What does it take for that code to get an r+ instead of an r-?  Let’s look at a few real-world cases, starting with Bug 830871.  Here’s a bug about evolving code, laying ground work for things that need to happen down the road.  It’s a small but common type of bug: We used to do X, now we want to start doing Y.  Let’s take a look at the fix:


-extern JS_FRIEND_API(bool)
+extern bool

This fix removes 15 characters. It’s trivial; hardly worth bothering anyone with, so why not just land it without review? Jeff, who wrote the patch, is an expert developer. Jason, who is being asked to spend time reviewing this, is incredibly busy with much more important patches of his own. So what’s going on here?

The first thing to understand about code review in a project with more than one developer (Mozilla has hundreds if not thousands), is that it communicates change. This bug is a perfect example. In the past, some decision has been taken (“We want to get rid of JSProtoKey as part of the JSAPI eventually“) and this is one step on the path to arriving at that change.  We get closer to understanding what’s happening here if we think about code review for such a patch as a kind of Catechism, where an assertion is made publicly, then affirmed.  By reciting what we believe about the direction that the code is taking, we bolster understanding and awareness.  “Folks, remember that we’re changing this API.”

These so-called Catechism reviews can be seen all over the place in Mozilla.  Here’s another one that landed a few minutes earlier.  Again, a tiny change that simply removes a few lines of code, and the desire for confirmation from a trusted peer: “ted: Please rubber stamp trivial change.” Code review spreads awareness of changes across the community.  I’m changing X, and I want you to know about this, too.

Notice also a secondary review request in that bug, this time for testing validation: “gaston: Please verify this actually fixes the problem.“  Here we see the role of review in helping test conditions beyond the means of the developer.  I wrote this patch on platform X, can you test it on platform Y?  Review distributes, shares resources, increases the power and reach of an individual to test their own assumptions.  The review ends with a moment of encouragement, “That allow m-c to pass configure & start building (so fixes the regression from 784841), and i can even use mach now \o/

Another type of review you’ll find happening a lot is one in which a strategy is developed, an architecture established, or an approach agreed upon.  In the first review I examined above, there were hints of this from the past, “We want to get rid of JSProtoKey…“  At some point that decision was made, and what was being reviewed was more the decision than the code as such.  Code enacts the decision, but the strategy has to get signed-off on as well.  You see a bit of this happening in Bug 831188.  Again, a one line patch (if you’re starting to feel like Mozilla developers never write big patches, don’t be fooled), and this time a review from one of Mozilla’s senior developers and architects.  Benjamin goes on to not only r+ the patch, but also takes the opportunity, through the review, to spec out some new work.  Code reviews are decision points, moments where the direction of not only this code, but that other code we should do, come into view.  What’s more, they are public decisions, which enable participation.

A lot of people decry code reviews as nothing more than busy-work, since many reviews do little more than identify so-called nits.  Having the work of hundreds of developers all adhere to certain standards, and display a common style, etc. means that there will inevitably be things you have to change in order to get your code landed in our code.  I write code for so many different code bases that I don’t know what my coding style is anymore–I do what the current code does.  Nits don’t bother me, and mainly because I know that they often evolved with good reason.  Here’s an example in bug 828228:

One other nit: I don’t like using constants for short strings, like TELEMETRY_SERVICE_INIT/TELEMETRY_BUILD_CACHE – it’s a level of indirection that makes the code harder to read/grep, and doesn’t really serve a purpose (typos would be caught otherwise, and we don’t need to change these values often).

“We’ve found that if you do it this way, it’s better, and here’s why…” Often the rationale for a nit isn’t given (sometimes it’s clearly understood, and just an oversight by the developer). Gavin chooses to use this code review to not only get his way with the code, but also to help educate another developer as to why this is practiced. Code review is where one learns how and why we do certain things.

How about a larger code change? Sure, bug 824864 will do.  Go scan that bug, look at all the various interactions.  What do you see?  First, notice that Bobby confirms the code is passing automated tests.  This review isn’t going to be about “does it work?” since that’s already been established.  Here, code review is about how and why things have been done.  What else do you notice?  I notice Bobby asking for review from two different people.  Next I see three separate reviewers helping out with the effort.  It’s a big and complicated set of changes.  Code review is something we need to do.  What do the reviewers find?  Style issues, re-introduction of unwanted APIs/code, things this change exposes we should follow-up on, changes that maybe shouldn’t be made, brittle code, inconsistent use of APIs, and on it goes.

A reviewer like Boris (truth be told there probably isn’t a “like Boris” anywhere) spends a lot of his time just doing reviews of this kind.  I’ve had people tell me that so-and-so is spending too much time on reviews, implying that if they were writing code instead, they’d be more productive.  The thing this misses is how one developer can only write so many patches, but their influence and ability to affect many more is increased through reviews: Boris doesn’t need to write every line of code, but the 4 or 5 he discusses in a review can make all the difference.  Code review is leverage, which allows top people to be in more than one thing at a time.

It’s important to state that all of the people involved in that last bug are expert developers.  How many times have I heard people claim that their code doesn’t need to be reviewed?  Don’t believe it.  Code review has nothing to do with how good you are as a programmer and everything to do with how complex programming is, and how impossible to get right.  When Brendan (yes that Brendan) writes code, it goes through review too, fails, and gets better.  Code review isn’t something that gets done to you, it happens to the code you write.  It’s not a personal assessment.  It’s something we do in order to not get crushed under the complexity of what we’re building together.  Programming is hard, and Mozilla code reviews are filled with people missing things that others help them see.

Code review is humbling, and it’s good to be humbled.  Code review is educational, and it’s good to be taught.  Code review is public, and it’s good for open source to happen where people can see what’s going on.

I also think that code reviews can be done badly.  People can use code review as a weapon to endlessly tie-up some change from ever happening.  Some might argue that the examples I chose above, while current, are all changes that actually landed.  What about those that didn’t, got WONTFIXED, or the like?  I would argue that the failures there are not about code review, and only show up because of the public nature of a review.  If person A and B are fighting, that review may expose things.  If one camp is against using tool X and others are trying to get it landed, the real issue is communication between those two groups.  Things come to a head in review, which can be uncomfortable, but is also necessary if those issues are latent within the community, project, company.

You can and should call out bad review practices.  Is someone being a jerk with nits?  Talk to them about it.  Is someone infinitely delaying a feature with pointless follow-up review failures?  Go have the real discussion that should be happening instead of the secondary arguments about the code.  The problem isn’t code review, so don’t lay it there.

Code review is also one of the best ways to enable participation, and though there are many other things I could say, I’ll end on this one.  Why not just use pair-programing?  Why not talk to so-and-so at her desk, and get some advice before doing it myself?  Code review, at least in the Mozilla context, happens in public view.  The evolution of the code is something I, as a non-employee, can witness, understand, discuss, and participate in productively.  If we replace code review with higher-bandwidth interactions, which let’s face it means things happening at the office, we eliminate the potential for the same degree of open collaboration.

Mozilla taught me the value of code review a long time ago, and now I want to help continue that culture within the Foundation.  It’s easier to work alone, or in pairs, to not have to pass everything by other people.  It’s also how you stay small and insular.  If you want to grow, if you want to be open, if you want community, and if you want to be Mozilla, I think code review is one of the best ways to get there.

Posted in CDOT, MoFoDev, Mozilla, Mozilla Education, Seneca, Teaching Open Source | Comments closed

A prayer for Aaron

Today, and as I write this, friends and family of Aaron Swartz are gathering to pay their last respects to a son, friend, and colleague.  Our Mozilla Foundation software team call, which normally happens at this time, was rescheduled in order to allow a number of the engineers to attend the service in Chicago, and for others to mourn and reflect privately.

I have been reading and pondering the many tributes, interviews, and articles about Aaron, his case, and death.  I didn’t know him personally, but I am familiar with his work and place within our community.  I am also deeply aware that Aaron was an archetypal figure, the 26 year old genius hacker–I’ve taught and worked with literally hundreds and hundreds of people like him in the open source world.  He has come to represent our community, which is, I think, why his death has affected so many, including myself.

The post that has stuck with me, and the reason why I write today, was Lessig’s.  In it, he writes:

Aaron had literally done nothing in his life “to make money.” He was fortunate Reddit turned out as it did, but from his work building the RSS standard, to his work architecting Creative Commons, to his work liberating public records, to his work building a free public library, to his work supporting Change Congress/FixCongressFirst/Rootstrikers, and then Demand Progress, Aaron was always and only working for (at least his conception of) the public good. He was brilliant, and funny. A kid genius. A soul, a conscience, the source of a question I have asked myself a million times: What would Aaron think? That person is gone today, driven to the edge by what a decent society would only call bullying. I get wrong. But I also get proportionality. And if you don’t get both, you don’t deserve to have the power of the United States government behind you.

Proportionality–that word has not left my mind since first reading this post on Saturday.  I’ve since read the outcry and petitions against the government prosecutor.  I don’t know the law, and won’t comment on a case I can’t really understand.

And yet I am moved by Lessig’s call, first for Aaron, but applicable far beyond his case, to practice proportionality, restraint, good judgement, and to examine the power one has, to consider its effects.  I could examine and criticize the power of this prosecutor, but I am much more able to examine the powers granted to me in my own life as a father, professor, project leader, etc.  The call for proportionality is an important one, and the lesson laid bare by Aaron’s case and subsequent death, is one I can and should apply to myself.

We need to be aware of the effects of our actions, and how our will goes out into the world.  Whether it be in grading, discipline, reviewing, judging–we are not free from the impact of our actions, and are never wholly in control of their outcomes.  We need, I need, to always be aware of the humanity at the receiving end of  power.

I pray that I would be slow to exercise power, and that love and forgiveness guide my hand.

Rest in peace, Aaron.

Posted in CDOT, MoFoDev, Mozilla, Mozilla Education, Seneca, Teaching Open Source | Comments closed

Visual Studio considered Harmful

I was reading scrollback on irc this morning, where a number of my students were discussing the unit tests for the webvtt project we’re doing this term.  The main issue was that Visual Studio didn’t seem to provide the equivalent of our autotools build system’s `make check‘, that is, it can’t run all our tests and report back.  Various solutions were discussed, some sensible, some less so.

Our autotools build actually works in Windows; you can `make check‘ to your heart’s content.  The real issue here is, in my opinion, an unhelpful (I would go so far as to say ‘harmful’) reliance on Visual Studio.  I make this bold claim because I was once in the same position.  I can remember very well being wholly, and completely dependent on Visual Studio for just about everything I did as a programmer.  And why not?  Visual Studio is an amazing tool, right?

The longer I’ve programmed, the more I’ve come to see it as a trap.  Not because it costs money, or because Microsoft makes it, or because it isn’t open source.  I’m writing this blog post on a Mac, so I’ve already made my peace with pragmatism over Free as in Open.  No, the trap of Visual Studio is being able to do only what Visual Studio can do, which seems like a lot, until you need to start doing things it can’t do, or worse, things it doesn’t want you to do.

I spend much of my time training new developers, and what I’m going to say will seem to run counter to the teaching of my colleagues.  I want to be clear that I think you should learn how to use Visual Studio, if for no other reason than to learn how its debugger works.  While you’re learning and using that debugger, understand what’s happening; understand that as a programmer you have a set of needs, and debugger is one of the main ones.  Now spend some time with Visual Studio’s editor.  It’s pretty good.  While you’re doing this, understand that you’re using an editor, that this is another of the fundamental needs you’ll have for your entire career.

Take an approach to using Visual Studio that makes you aware of its constituent parts, and less as a monolithic whole.  Why should you do this?  It’s important to understand that you need various kinds of development tools, from editors to debuggers to compilers to linkers (quick, what is the name of the compiler and linker on Windows?) to static analysis tools of all kinds, and that Visual Studio provides some of these.  It does not provide them all.  Not by a long shot.

When this isn’t done, and Visual Studio is viewed as a whole, as a development platform, as the way I write code, a number of immediate consequences follow.  First, the only kinds of programs you’ll write are those which Visual Studio can produce.  In essence, your platform isn’t even Windows any more, it is Visual Studio.  Want to work on OS X?  What about Linux?  What about embedded systems?  What about gaming consoles?  The scope and scale of your work as a developer becomes the answer to the question, “Does it run Visual Studio?”

If, on the other hand, you start to understand Visual Studio as a set of tools, and more, a set of replaceable tools instead of your go-to-dev-platform, interesting possibilities arise.  You might notice, for example, that you’re writing code in C or C++, and this code is being compiled by cl.exe.  What if you switched compilers?  What if you used clang or gcc?  What if you tried a different editor, one that also worked on other platforms, one that supported languages Visual Studio doesn’t seem to know about?

A number of things happen in that moment.  Suddenly, and it is like opening a dam, a flood of new tools, languages, and platforms comes into scope.  Maybe you’ve avoided trying some new language or tool that others are raving about, putting it off because it didn’t seem to fit into the world-view that Visual Studio provided.  Don’t tell me you haven’t because I know it to be true–I used to do this all the time.  If your choice of tooling, platform, language, etc. begins with a question about Visual Studio, you are missing out already.

And what am I advocating instead of Visual Studio?  Should you do what I do?  Probably not.  I use the command line and emacs for everything, and there are probably better options for someone starting today.  Whatever you pick, be aware of the limitations your choices impose on you.  I still use emacs because it’s important to me to be able to SSH into remote boxes and work identically to how I work locally.  I also choose to only work with tools that work on Windows, Mac, and Linux, so I can be productive everywhere.  If I was starting today, I’d probably use Sublime.

It doesn’t matter what you use, and the best programmers I know change their tools and platforms all the time, making decisions based on project needs vs. what their old tools can do.

You should use what works until it doesn’t, and then move on to other things.  Don’t be nostalgic.  Your life as a programmer will involve constant changes in languages, tools, and platforms, and if the only thing making that decision for you is Visual Studio, you will quickly lose the agility you need to stay relevant in the industry.

Posted in CDOT, Idea Factory, Implementing WebVTT, MoFoDev, Mozilla, Mozilla Education, Seneca, Teaching Open Source | Comments closed

In 2013: letters, encouragement, edification

In 2013 I’m going to try something.  I don’t usually do New Year’s resolutions, but I like the idea of the cold-startup (I don’t know what the opposite of cold turkey and ’stopping’ is, but that).  For whatever reason, I need to do things all-or-none.  I’m someone who thrives on having discipline in my life, setting goals, and laying out a structure to follow.  I’m not always perfect at follow-through, which is why I’m going to do what I always do when I’m scared I’ll fail: I admit it and create accountability.

In 2013 I want to experiment with writing letters.  I’m somewhat tired of the limits imposed on me by the current methods I have available for communication, especially social media and the web.  I’m under no illusions about the impossibility of any communication medium allowing one to be full present.  We are always mediated, always more than what we say, or what Heidegger calls “creatures of distance…always somewhere else.”  And yet I long to be more than what Twitter permits, both in length, and also content.  So many things aren’t appropriate there, and I’m not talking about explicitly inappropriate things.  The unspoken norms of these spaces mean that one can perform but not be personal, hate but not love, share but never admit.

I’ve got colleagues and friends spread around the planet, and being someone who doesn’t like to travel, or, if I’m being honest, spend a lot of time with people in general (“Hi, my name’s Dave and I’m in introvert…”), I’m interested in finding ways to become more genuine and connected that honour who I really am.  We have many modern ways to communicate, share, and work together, but I’m going to look to an old and somewhat outdated medium for insight into how to build better bonds with people over distance.

Part of me fears that letters won’t be received in the way I intend, that people will find them an intrusion, arcane, and overly personal.  Another part of me longs for the life-of-letters that permeated the writings of my literary heroes.  I don’t know, yet–I’m simply going to try and see what happens.

I’m not planning to leave modern, social communication spaces in 2013.  I’m just going to be more intentional about the ways in which I use them, and perhaps take what might have gone into a post, tweet, or email and expand it into a letter.  Whereas Twitter, irc, et al thrive on biting wit, cleverness, and a well timed jab, I’m going to try to be more encouraging, and focus on finding ways to edify and build-up.

If I ask you for your address, this will be why.  If you want to send me a letter, I’d welcome that too.

Yours,

Dave

Posted in Idea Factory, Introversion | Comments closed