Adding Viemu to the Toolbelt…

October 12, 2010



Since I’ve been using MacVim more and more in my personal development projects, I’ve grown to have a significant amount of muscle memory. Pretty frequently now I find a string of ‘jjjj’ in the middle of my C# code as I’m trying to take a look at what it’s doing. So I figured it was time to explore the possibilities of getting viemu up and going. The biggest hurdle was my concern about losing CodeRush/Refactor Pro! support. I am heavily dependent on them so they had to play nice together. Good news. This worked out of the box. After a quick install of viemu and a firing up Visual Studio, I was off and running.

Small tweaks

I did have to make a couple of small adjustments. First was my key re-mappings. In my configs , I snagged a couple of key mappings that I’ve found really helpful. I needed these same behaviors in viemu in order to take advantage of all my muscle memory. The key was creating the .viemurc file in my home directory since it picks that file up by default.

I also had an issue with colors – I prefer dark themes both in vim & Visual Studio. By default, the highlight in viemu clashes so strongly with my theme that I had to disable it. I couldn’t get it to switch up the color schemes appropriately either so I’m guessing I’ll have to dig a bit more to get that working but overall I’m pretty happy. If I find a way to get this working properly, I’ll update the post.

David O’Hara is a Principal with Improving Enterprises in Dallas, Texas.

Introduction to CodeRush: Part 1

September 1, 2008

I believe that anyone not using a productivity tool with their IDE is wasting time and, quite possibly, ripping off their employer/client. I don’t care if it’s CodeRush, Resharper, CodeSmart, or whatever but you should get a tool, get familiar with it and use it for everything it’s worth. I enjoy using the CodeRush/Refactor Pro! tools. As a matter of fact, I feel like I can’t hardly use Visual Studio without them. The only drawback I’ve found with CodeRush is that discoverability is just not there and with the vast array of capabilities, a lot of folks would rather do without than flounder so I’m hoping that this will help to ease that learning curve.

[ ?posts_id=1228631&dest=-1]

This “episode” is the first in a series screencasts I’ve been trying to put together for a while and I’m hoping that it will introduce the new user and maybe even show some existing users a few things that they didn’t know. I’m certainly no professional video editor so please excuse the quality while I try to find the right mix but I would appreciate your feedback.
Anyway, we’ll take a look at the structure markup that CodeRush does to help enhance readability and decorate code to make certain aspects visually evident. And we’ll be introduced to the mnemonic templating system and how just a few keystrokes can turn our intent to code.

Reducing Unit Testing Friction…

June 26, 2008

Gears.jpgIt doesn’t matter if you’re a TDD purist or a test-as-you-go guy, having a quick way to execute the tests that you’ve created is critical to them actually getting run as regularly as they need to be. To that end, here is the current setup that I’m using to make this as easy as possible.

Everyone knows that I’m a sucker for a new tool but this tool has been with me for quite a while and I’m skeptical that anything will be able to replace it. TestDriven.Net is the foundation of a great workflow when it comes to unit testing and it’s truly worth the small amount that Jaime asks for his efforts. He’s a great guy and it’s a great tool – go buy it and install it immediately.
So now that you have it installed, there a couple of settings in Visual Studio that help make that test/code/test cycle even tighter.

Keyboard shortcuts

Once you have TestDriven installed, you’ll notice some extra options in the context menus when you right-click on class files, projects and even in code. These will allow you to run tests in various fashions but I’m a lazy man and I hate moving my fingers off the keyboard so I’ve added a few shortcuts to Visual Studio. In the options menu for “Keyboard”, I bind Control-1 to “TestDriven.NET.RunTests”, Control-2 to “TestDriven.NET.ReRunWithDefault”, and Control-3 to “TestDriven.NET.ReRunWithDebugger”. The way this helps me is that I am able to use Control-1 to execute the test that the cursor currently resides in (if you’re in between tests or on the fixture itself, it will run all in that fixture). If it doesn’t pass, I can hop over to the code that’s being tested, make the changes and then just press Control-2 to see if the test passes. No back and forth between the two. The last shortcut is helpful because it allows me to set a breakpoint where I am (using F9 of course) and rerun the test so that it will hit that breakpoint. Again, no back and forth.

Output window

Every time you execute a test, the tool bar will give you a quick look at the status but the output window will be your friend when things don’t quite execute as planned. All the output gets piped here but you don’t need it in your face so be sure that the “Show Output window when build starts” is unchecked but also be sure that you have it collapsed just below your code file. output window.jpg This way if you do have need to see what is in the output, you can just press Control-Alt-O and it will pop up with focus. (Pressing Escape will cause it to hide again and leave us in our code.)

I still haven’t quite figured out how to bind to the “Run All Tests” so if you have a suggestion, I’d love to hear it. However, I do still find it helpful that a “Run All Tests” will execute again when using the rerun shortcuts and I use that quite a bit right before commits. (If you’re not religious about running ALL tests before a commit, I hereby grant your co-workers permission to knee-cap you.)

Because unit tests only provide benefit when they are actually run, we need to do everything that we can to tighten the code/test loop and make executing the right thing at the rightht time as easy as possible.

David O’Hara is a Principal Consultant with Improving Enterprises in Dallas, Texas.

Now I’m a Rushie…

March 28, 2006

I've always taken some sort of perverse pleasure in doing things the hard way and learning for myself. When I first started working with HTML, I used Notepad – not that wholesome goodness Notepad2; plain old, suck ass Notepad. While I was involved with NaviPress in its infancy (I'd link to it but NaviSoft was gobbled up by AOL in 1995 and is WAY gone), one of the first WYSIWYG HTML editors, I felt that writing in Notepad made be smarter tougher better. Ah…the days of stupid youth.

Fast forward to today. I now understand that benefits of productivity tools and attempt to invest at least a few hours each week in either finding them or developing them myself. Even though I like doing things the hard way, I'm a big "Intelli-crack" addict. With the .NET Framework ever expanding, I can't possibly know all the classes and methods that I need so I rely on Intellisense to inform me of my options. It's like pair programming with someone who "knows what they're doing" and I also no longer see these tools as a crutch to help me hobble but rather as a turbo charger on my "350 small block V8" that is my coding skill…but I digress…

A while back I found two candidates, Resharper and CodeRush (with Refactor! Pro), I wanted to explore for us to use here at work. Being the "try before you buy" person I am, I attempted to download each of them. Unfortunately, CodeRush was in one of it's "blackout periods" so I was unable to test it so Resharper won by default. Sidenote: I didn't realize that the CodeRush installs weren't going to work until AFTER I'd spent the time to install them – this just added to the frustration and made it that much easier to kick it to the curb. While I realize that a little reading on my part (the expiry date was noted on the site near the download link) would have clued me in to this fact, Mark, if you're reading this I'd recommend changing up the installer to check the date BEFORE installing so as to warn the users.

So I've been using Resharper for a while now and I like the fact that it did a few things really well and stayed out of my way for the most part. The "Live Templates" and "Surrounds" were very cool and a big help. Auto-completions such as closing braces, adding both parentheses and even adding semi-colons to the end of the lines were also big boosts in that it reduced the amount of typing that I had to do. Being an OCD type, the code formatting feature was AWESOME. Once I defined how I wanted it to handle whitespace, carriage returns, braces, etc. it would format my code (even the entire solution if I desired) for me. Ah…all neat and tidy. Although it was a hassle to share these settings across devs (something that's supposed to be fixed with version 2.0), it was nice to standardize these and kept from distracting me when reading code. The refactoring stuff was ok. I found the "Find Usages" to be invaluable when refactoring over a large number of files and/or projects. All of that was nice but the number one thing that I LOVED about Resharper was the dynamic compilation. The ability to provide "real time" syntax checking, declaration checking, using statement cleanup in a very graphical way via the red/yellow/green sidebar. This allowed you to see the state of your code and the location of any errors or warnings at a glance. Sadly, its downfall has been the fact that it doesn't have a VS2005 version. Well, they HAVE one but it's in beta, which acts more like an alpha than anything else. So after fighting with it for a few days via re-installs, IDE crashes, and a general lack of usability, I decided to re-evaluate my use of Resharper. Plus, since there was supposed to be built-in support for some of these features, I figured I could limp along without it. Turns out that was roughly the equivalent of trying to program using only my thumbs.

I read Scott Hanselman's blog on a daily basis, have kept up with him for some time now, and deeply respect his abilities and opinions so I figured I'd give CodeRush another shot. He's been a "Rushie" for some time now and enjoys telling folks about it. So I've been using it for a few weeks now and while it's complex, the power lies in that complexity. I'm not very far up on the learning curve yet (did I mention the steep learning curve) and I'm seriously missing a few of my Resharper features (dynamic compilation and code formatting especially) but I've found some serious gains in productivity already. Due to the depth of the product, I know that I'm not using half of the things that would save me time on a daily basis but there aren't really all that many tutorials and those that exist don't really help you learn what keystroke does what. So for now, I'm going to continue fumbling my way thru and figuring out as I go what I need and what's what. I'll post again once I've got a firmer grasp on everything.

(Whew that was a long post – sorry about that!) 🙂

Visual Studio 2005 Commercials…

March 27, 2006

(Sorry couldn’t think of a witty name for this post – guess you’ll just have to deal with “informative” instead of “humorous”.)

I just found this link to some great little ads (UPDATE: ads are gone – here’s all that remains) for the new Visual Studio 2005. You may or may not get some of the jokes depending on your level of geekiness. 🙂

I’ve actually had Team System installed for some time now on our development network and am really impressed. While the upgrades to the developement environment (IDE) are significant, the most important portion has been the integration of the collaboration and project tools. Being able to generate, report, and track work items (bugs/features/etc) without leaving the IDE is great and really cuts down on the amount of time needed for the project management details (once you get over the learning curve). Plus, all the project related reports are available without the need for an “update meeting” to constantly reasure “The Bobs” that you’re actually doing something. 🙂

Visual Studio Team System RTM…

March 21, 2006

Here’s my Newsvine seed. Wow, now I’ve got to get the latest download off of MSDN and upgrade our test install. 🙂