Visual Tooling Will Make You Go Blind

It's Rob picking on someone again! I've been goaded into this post, to be sure, but it's all in the name of good, clean Twitter fun because what came out of it is probably something worth your time. If you're an MS dev it's likely you're hooked on Visual Tooling - and you're paying the price. Get faster, make more money, and get all the [chicks|dudes] using some command line love.


Twitter Work Stoppage

Twitter is perfect for not getting work done. I’m doing up my next Tekpub production while simultaneously suggesting to my friend Kevin Dente that he forego the visual tooling for Mercurial when, out of the murky depths surfaces a tweet that I’ve seen a zillion times:

@robconery @kevindente it’s pointless typing all that crap when you don’t have to …

@robconery lol, but why make your life more complicated than it needs to be?

Embarrassing

I find it really embarrassing sometimes to say that I’m a Microsoft developer when I’m in a mixed-developer crowd – for reasons like this. This, people, is why we get laughed at. Command Line stuff isn’t “hard” and it requires about as much memorization as the System.IO namespace (which, I bet, you just rattled off 5-10 calls for).

The conversation ended amicably – he called me a “Cheeky Fucker” for climbing up is CLI-negative behind, and for that I gave him a coupon to Tekpub’s Mercurial series so he can watch me increase my productivity 10-fold by kicking the visual tooling to the curb.

Make More Money, Go Home Sooner

Dependency on visual tools to “show you” how to work something is utterly demeaning to your intellect. You’re a programmer for [deity's] sake!

LOL, but having to remember all those bloody commands extensions and syntax is a PITA…

I have to remember 4 other programming languages, two markup languages, 3 IDEs, 2 Graphic Design apps…

I’ve got enough to remember without having to remember CLI shit too :P

This was my favorite one though…

I could write myself a cheat sheet, but I’m too busy deriding you for your archaic attachment to DOS :D

That last part is pretty much where he called me a “cheeky fucker” after I asked him if he thought Mercurial required DOS in order to run…

Mercurial Command Cheat Sheet

From the department of “Try it you’ll like it” – here’s some commands you can use to increase your speed at work, amaze your friends, and get all the chicks/dudes you want:

hg init

This creates a repo in a directory

hg add

This adds the files from that directory to mercurial

hg commit

This commits the files to the Repository and creates a changeset, or commit.

hg push

This pushes your commits to a remote

hg rollback

Undoes your last commit – for when you goof up.

Give it a Second! It’s Going Up To Space!

OK so you don’t like typing – I can get that :) . You can assign these to your external tools menu in Visual Studio. Just click on Tools/External Tools and when it pops up you click on “Add”.

In the title call it something fun – like “hg commit”. The command should point to hgtk.exe, which is usually in Program Files\TortoiseHg. The argument is commit and make sure to choose “$SolutionDir” as your Initial Directory. This is where the executable will run.

Here’s what this looks like:

This command will open up the Gui tool for you from inside Visual Studio. If you want to go full CLI monty, point to “hg.exe” instead, and change the command to “commit -m”. You’ll have to check “prompt for arguments” as it will ask you to enter a message (that’s what the highly cryptic “-m” means). When you execute this command (by dropping open the Tools menu – you’ll have a new command) – a box pops up where you enter your commit message.

You’re Not Lazy – You’re Awesome

When you save your work in Visual Studio do you go to “File/Save” or hunt down the disk icon? When you have to move text from one part of the editor to the other, do you use the Edit menu and select “Cut” and then “Paste”? Of course not – that would be silly!

Yet you remember these commands – they’re ubiquitous to every operating system – CTRL-C and CTRL-V (or CMD on a Mac). CTRL/CMD-Z is Undo, CTRL/CMD-s is save. Shift-end is “select the text in this line”, and so on.

When working with source control – all the same things apply. 90% of the time you’re adding, committing, or undoing and the commands you use will almost always be those – and these commands will be the same for every machine that has these source systems installed (as opposed to the many VS addins you can get for Hg).

Yes, I realize that things like browsing commit history is much better with a visual tool – but that’s not every day work really…

Visual tooling changes per client, and every Visual Tool developer has a different take on what the underlying system is “trying to do”. Your experience with the tool is then filtered through the visual tool designers perceptions, which can be good, or utterly horrible.

With Mercurial, rolling back a commit through the tooling requires you to:

  • Leave Visual Studio
  • Find your solution directory
  • Right click to bring up the shell menu, then find the Hg context menu flyout
  • Follow that flyout down to the bottom, where the “Recovery” selection sits
  • Click “Recovery”, which loads another UI that has a series of choices – one of which is “Rollback”
  • In takes 4 bits of “memory space” to get to the final point – you have to remember that the command is located in the context menu, then where the menu item is, what it’s called (why they call it “Recovery” I have no idea), and finally that you need to use “Rollback”.

    Moreover, the UI is utterly useless is providing any help, whatsoever:

    And I’m supposed to believe that this is a better choice than the Command Line? For comparison, in case you’re wondering – here’s the alternative:

    hg rollback

    … Yes but I have to open a command line tool and navigate all the way to my solution directory with “cd this” and “cd that” – what a pain!

    Well, I’ll give you that much. Although you can just use “Open Folder in Windows Explorer” (r-click on your Solution) and then Shift-click the solution directory, which brings up “Open Command Window Here”. I have Console2 sitting as a button in Visual Studio – so it just opens up for me in the right directory:

    Your Life is ASCII. Even This Little Violin.

     /~(_)~\       
    (  :=:  =====II
     \_(~)_/

    In the end it’s just text that we’re discussing here – something you make a living by mastering the use of. Emails, code, Twitter… computers in general. You type – all day long. It doesn’t make any sense that harnessing the fastest possible API between your brain and your PC causes you alarm.

    Working visually, you actually have to remember 5-10 times more information – and you have to retain it in visual memory. Think about that – it’s like asking someone for their phone number and having them stare back at you – completely blank… muttering:

    I’d give you my phone number – but I don’t have my phone

    So give it a try – you’ll be amazed just how much faster you can be. I’ve even started to use my terminal here on my Mac to move files around and navigate my drives… it’s 10 times faster to type out “cp ~/sites/meatcake sites/tekpub” or “rm -R ~/sites/biffalobuff” than it is to kick up yet another finder window so I can navigate a see of little yellow icons, reading as I go… and then using my mouse to move them from one place to another.

    My Mom Loves It Though…

    Don’t get me wrong here – the desktop UI “representation” has drawn a lot of people to computers – as it was designed to do. But it’s a tool for the masses – for the people who don’t really understand how a computer works (nor care to). Like my mom (who’s awesome by the way… Hi Mom!).

    But “Mom don’t Program” – and the designers of my beautiful Mac thought about her, not me, when designing this machine. And that’s OK – since they also gave geeks like me a backdoor pass to get by all the visual interference – knowing that I need to sling code files and text like a madman – and that I don’t have a lot of time to waste climbing through their conception of how I want to get work done.

    A Challenge

    Download Console2 and keep it open beside VS, and work your commits through it – just for a day or two (you can use my cheatsheet above). You really don’t need to pump another addin into Visual Studio – the damn thing’s like newborn baby giraffe right now and will just tip right over when the COM wind blows … which it seems to do often when you have addins installed. Especially source control addins.

    I promise you – you’ll work faster and won’t stress out when you can’t install TortoiseHg on your work machine.