Visual Studio: Navigating large files

I am often working in Visual Studio in Controllers that have a large amount of code in them and want to look at code from multiple parts of the file. Using the split screen view is not sufficient.  The following is how I maximize my monitor space to get the best experience with the fewest distractions.

1. Select the tab you are working with.
2. Select Window -> New Window
3. Select Window -> New Vertical Tab Group
4. Press Shift – Alt – Enter to switch to full screen mode.

Lazy Programming: The Three Virtues

Three Virtues

According to Larry Wall, the original author of the Perl
programming language, there are three great virtues of a programmer; Laziness, Impatience and Hubris

  1. Laziness: The quality that makes you go to great effort to
    reduce overall energy expenditure. It makes you write labor-saving
    programs that other people will find useful and document what you
    wrote so you don’t have to answer so many questions about it.
  2. Impatience: The anger you feel when the computer is being
    lazy. This makes you write programs that don’t just react to your
    needs, but actually anticipate them. Or at least pretend to.
  3. Hubris: The quality that makes you write (and maintain)
    programs that other people won’t want to say bad things about.

via Laziness Impatience Hubris.

ReSharper, getting started again

Years ago I used to use ReSharper on a daily basis. Then I left that company and didn’t have easy access to it any more. I missed it. I finally am at a place where I have a copy again. I am in the process of relearning how to use it. Here are a few linking that I found useful:

1. This is ReSharpers PDF file the most used shortcuts
2. Pluralsights “ReSharper Fundamentals” course
3. 24 + 3 ReSharper tips by Rapid Application Development blog
4. A Code Project article with more detailed examples
5. ReSharper documentation of the various functionality

Lazy Programming: Lowercase URLs

Just so everyone knows, when it comes to programming I prefer to be as lazy as possible. This means that when I got my most recent story to render all routes in lowercase I decided fixing the Routing manually was way too much work. I spent some time on Google and discovered that the built-in lowercase functionality that is built into MVC 4 is broken and its a pain to work around. Instead I am adding a nuget package called LowercaseRoutesMVC to the project. It automatically renders routes in lowercase.  Unfortunately my coworker spent a couple hours yesterday working on updating his code to work manually.

Update: Quote from my boss to the coworker who did it manually yesterday, “hard work sometimes pays off tomorrow but procrastination always pays off immediately.”

MVC Tips n Tricks: Using a button like an action link

I had the need to display a button that works like an action link to redirect the user to a page within an Area and didn’t want to wrap the whole thing in a form just to do the redirect.  Here is what I used.  It allows the same styling and behavior as a button but redirects directly like an action link.

<input type="Submit" 
       value="Add Persona" 
       class="btn btn-primary btn-lg" 
       onclick="location.href='@Url.Action("Detail", "Persona", new { area = "ProfileInfo" })'" />