I recently wrote my first extension for Visual Studio called VSBlockJumper. It came about as I was watching Casey Muratori’s Handmade Hero series and noticed he was jumping over blocks of code in Emacs. As a programmer I’m always looking for things that might speed up my workflow and this seemed like it could be one of them.
Perusing his .emacs file (in the Handmade Hero git repository) I found two small small scripts which move the cursor to the next or previous blank line. I immediately found an extension that does this for VSCode. However, I couldn’t find one for Visual Studio.
“Alright then! I’ll just write a Visual Studio macro to do the same thing!”
Except that macros were discontinued years ago with Visual Studio 2012 (I am currently working in Visual Studio 2015 and 2017). Microsoft had this to say about it:
In this version of Visual Studio, while there are literally hundreds of features, there are some we’ve actually taken out. One of those is the macros automation feature, including macro record/replay, macro projects and the Macros IDE. While we know that macros have been valuable for those who use them, unfortunately our usage data shows that less than 1% of Visual Studio developers take advantage of this feature. Therefore, we’ve found ourselves investing more deeply in the Visual Studio areas that get used every day, and have not updated macros for several releases.
They have a point! I never even noticed they were gone. I had a handful of macros which I used back at THQ and the early days of my career at Ubisoft, but I guess extensions and other tools just got so much better that I didn’t need macros again until now.
“Oh well! I’ll just write an extension? How hard can it be?”
pained groan
Ok so I’m being dramatic. The groan comes from the fact that I wrote almost all of the important code for VSBlockJumper in an afternoon, but it ended up taking two weeks to get it to a state where it was working for both Visual Studio 2015 and 2017 and another week to package it up with my own graphics and a couple of settings that could be tweaked depending on programmer preference.
Keep in mind I was only working on this for a couple of hours a night (and missed a few nights due to Papa responsibilities) but still! I thought I’d be done in two, maybe three evenings.
Overall it was actually a fun experience, and I personally see the project as a success on many fronts. Mainly it was great to have a project like this on a small scale that I could develop from start to finish and publish to a platform (Visual Studio Marketplace) which makes it widely available to its intended users. It was something small and concise that I could polish and ship and be happy with.
Its important to have had this mini success in order to convince my subconscious that its worth pushing through the unforeseen difficulties and work that arise in my next project (which is slightly more ambitious). My goal is to build momentum off of these mini successes (and I consider this blog to be one of these) and proceed to become more and more ambitious with my personal work.
I learnt a little bit about marketing. My friends on social media were my biggest cheer leaders. Reddit was also surprisingly great. I was at the top of the front page of r/programmingtools for a day or two. I received some positive feedback and questions from other subreddits as well. I expected the handmade hero forums to show a little more fanfare, but I guess the community is largely inactive with streams currently only occurring on weekends.
I learnt that even though you think you’re ready to publish you’re not really ready to publish. You can see on the releases page that I scrambled to fix a bunch of issues, releasing 4 different versions in the space of two days. One of those issues was that I was initially using Mario sprites for the icon, it started out as a bit of a joke to myself and I ended up releasing with it, thinking nothing of it. A programmer friend of mine pointed out that Nintendo can be rather vicious when it comes to intellectual property, and I didn’t feel comfortable about redistributing software I’d made with someone elses work as the image of it. Not only that but its just plain illegal. So I learnt to be less careless!
I developed a much deeper appreciation for GitHub after shipping this project with it. It’s very intuitive and straight forward and comes with a tonne of nice features. Stuff like releases, issues, analytics, licensing templates, readme markdown. That’s barely scratching the surface.
Finally, I learnt a lot about writing extensions for Visual Studio, which makes me well equipped should I ever need to extend Visual Studio for a future project. I’ll cover the technical aspects of these lessons in-depth in Part 2!