Nesting Files in Visual Studio

A neat trick that I’ve used a few times to help organize files in a project is nest some under a related “master” file just like an aspx file and its code-behind.  I’ve mostly done this to group some page-specific JavaScript files with the page but also to group some partial classes for a WCF service together under a single “master” file.  This is hardly new (I think I did it for the first time with a project file from VS2008 and I know it has been around even longer than that) but every once in a while it comes up in a conversation so I thought it was worth sharing.
Continue reading

Leave a Comment

Filed under Software Development, Tools & Utilities, Visual Studio 2010

JustDecompile – One More Time

I’ve looked at JustDecompile a few times over the past year, following its progress from its early beta stages.  When I saw that it was officially released yesterday (14 Feb 2012) I remembered telling Vladimir Dragoev from the JustDecompile team that I’d give it another look.  I’ve been very critical of this product in the past but given that everything I’ve looked at so far has been pre-release software it’s only fair that I give it one more chance to redeem itself.  Can this version finally handle my tests?

Continue reading

1 Comment

Filed under Software Development, Tools & Utilities, JustDecompile

Operation could destabilize the runtime

Today I was trying to run the code for a project I’ve just been assigned to.  I’d brought down the code from SVN, built the common libraries, and punched F5.  Build succeeded.  Before long the browser loaded and the beautiful new UI stared back and virtually begged me to start clicking around.  Before I could do anything though Visual Studio rudely interrupted with an unhandled exception dialog.  This one looked nasty, particularly since I’d never seen it before: System.Security.VerificationException - Operation could destabilize the runtime…

I found a Stack Overflow question about this that pointed to Json.NET as a possible culprit.  Sure enough, the source of the exception was Newtonsoft.Json.  It seems that Visual Studio Ultimate’s IntelliTrace didn’t like something Json.NET was doing and would throw that exception.  The issue is said to be resolved as of release 6 but I haven’t upgraded the assembly yet.

For the time being I’ve added a rule to exclude *Newtonsoft.* from the IntelliTrace modules list as recommended by in the Stack Overflow answer.  Since excluding the assembly I haven’t seen the problem again.

Leave a Comment

Filed under Software Development, Visual Studio 2010, Libraries, Json.NET, IntelliTrace

IndyNDA – Testing Code From The Pit Of Despair

It’s the second week of February so if you read this blog with any frequency you know what that means.  That’s right, IndyNDA is this Thursday (9 February)!  This month we’re fortunate to have Phil Japikse returning to discuss testing legacy code.

Michael Feathers defines Legacy Code as any code that doesn’t have automated tests, and you agree that automated tests are an important facet of successful software development. Then it happens – you get your next assignment, and it’s your worst nightmare! You have to maintain and enhance a large application that has no tests in place, and there are parts that are just plain scary. Where do you start? Traditional Test Driven Development techniques don’t typically work, since they focus on an inside-out development paradigm.

I will show you the patterns and practices that will help you turn the scary big ball of mud into a tested code base.

I’m excited to have Phil back.  I’ve heard him speak many times and have always found his talks both informative and entertaining.

This month we’re meeting in the 2nd floor conference room at 900 E. 96th Street.  Registration begins at 5:30 and the main event kicks off at 6:00.  Snacks and soft drinks will be provided.


View Larger Map

I hope to see you there!

Leave a Comment

Filed under Community, IndyNDA, Practices, Testing, User Groups

Book Review: Driving Technical Change

Driving Technical Change

Driving Technical Change

A few nights ago I was over at my local Fry’s looking for a battery charger and a new Compact Flash card for my camera when I stumbled upon the book Driving Technical Change by Terrance Ryan.  I think it was the distinctive look of a Pragmatic Bookshelf title that caught my eye.  I picked it up, glanced over a few pages, said “what the hell,” and bought it.  The book weighs in a bit under 150 pages so it’s a pretty quick read.  Even with my slow reading pace and note taking I managed to make it through the book in just a few hours.

Continue reading

Leave a Comment

Filed under Practices, Software Development

Going Underground: Microsoft Moles

Despite having been around for several years I hadn’t heard about Microsoft’s Moles framework until a few months ago when one of my teammates mentioned it during the 2011 Indy GiveCamp. I was interested in learning more about it at the time but given how we were running on caffeine I’m not surprised I forgot about it until he mentioned it again a few weeks ago. This time I was much more alert and started reading about it almost immediately. After seeing what Moles offered and not finding much in the way of resources for it on the Web I knew I needed to spread the word.

Continue reading

Leave a Comment

Filed under C#, Languages, Microsoft Moles, Practices, Software Development, Testing, Visual Studio 2010

IndyNDA – Panel Discussion on Technical Screening

The January IndyNDA meeting is this Thursday!  Join us for a panel discussion on technical screening.  Mark Huebner will moderate the discussion with our panelists including Ed Herceg (Robert Half Technology), Dale Brubaker (Interactive Intelligence), and yours truly.  Audience participation is encouraged.

Some say companies and recruiting firms are using tests based on incorrect assumptions on how developers do their work. C# and jQuery and JavaScript and VB and the .NET framework continue to offer new capabilities. The complexity has generally not been a problem for you because you make liberal use of IntelliSense, online help, books online, reference books, Google searches, and technical online forums. You know how to quickly find information when you can’t remember specific syntax. So, can you pass that technical screening test? Should you need to be tested? Let’s find out

Don’t forget about the C# and JavaScript SIGs after the main event either.  I’m not sure what the JavaScript group is covering but for the C# group Alex Gheith and I will be leading a discussion over a few of the items in chapter 1 of Effective C# by Bill Wagner.

As always registration begins at 5:30 with the main event starting at 6:00.  Thanks to our sponsors food and drink will be provided before the meeting.

Please be aware that our meeting location has changed.  For January and February we’ll be meeting in the 2nd floor conference room in Parkwood 9.  For those that remember when we had meetings in the 5th floor conference room in the same building rest assured, the 2nd floor conference room is better suited to our needs.


View Larger Map

I hope to see you there!

Leave a Comment

Filed under Community, IndyNDA, Software Development, Speaking, User Groups

VS2010: Box Selections

When I first saw the box selection capabilities in Visual Studio 2010 I thought “that’s kind of neat but I’ll probably never use it” and promptly moved on.  I couldn’t have been more mistaken.  In fact, nearly two years later, box selection has become one of those features that I use almost daily.  What surprises me now though is how many developers I run into that still don’t know about them.

Box selections let us quickly make the same change to multiple lines simultaneously.  Creating them is easy – just hold shift+alt and use the arrow keys or hold the alt key while left drag the mouse to define a rectangle.  If you just want to insert the same text onto multiple lines you can define a zero-length box by expanding the box vertically in either direction.

Non-virtual Properties

So what makes box selections so useful?  Some of the things I find them most useful for are changing modifiers and making local variables implicitly typed.  To illustrate, let’s take a look at a few non-virtual properties that we’d like to make virtual.

Zero-Length Selection

Making these properties virtual without a box selection certainly isn’t difficult but it’s definitely tedious.  A box selection lets us make them all virtual at the same time so we can get on with the task at hand.  The thin blue line immediately following the public modifier on each property identifies the zero-length box that serves as the point where we’ll insert in the virtual modifier.

Virtual PropertiesTo insert the virtual modifier we just need to type (or paste) “virtual.”  Here you can see that each property is now virtual and the zero-length box has moved to the end of the inserted text.  What if we decide later though that these properties shouldn’t be virtual after all?

Box SelectionWe can use box selections to remove the virtual modifier from each property just as easily.  In the example to the left we see a box selection highlighting the virtual modifier on each line.  Non-virtual Properties 2To remove the text we can simply delete it.  This will leave us with a zero-length box where the virtual modifiers used to be.  We can then simply click or arrow away to clear the box selection.

Box selections can go a long way toward increasing your productivity by reducing some of the more tedious aspects of programming.  The few seconds they save here and there can really add up over the course of a day.  More importantly though, that time can be spent on the real problems we’re trying to solve.

Further Reading

How to: Select and Change Text

Leave a Comment

Filed under .NET, Environments, Software Development, Visual Studio 2010

New Year, New Name

I’ve been thinking about this for a while but the new year seemed like a good time for a fresh start.  I’ve changed the name of the blog.

The best-laid plans of mice and men often go awry

When I named this site Two years ago I was really serious about both software development and photography and fully intended to use this space to explore both subjects.  Over time though I began thinking that I should focus on one or the other.  Given that programming is my chosen profession it was only natural that I take the site that direction.  For that reason that I decided to retire “The Programmer’s Lens” as the name of the site.  I think the new name, Didactic Code, more accurately reflects the purpose of the blog.

Didactic: intended to convey instruction and information as well as pleasure and entertainment
Merriam-Webster Dictionary

This space is a learning tool.  I’m not ashamed to admit that I write for myself just as much as I do for others.  Writing about these topics is the most effective way for me learn about them.  I also like to share what I’ve learned so when others find benefit in my writings that’s just icing on the cake.

I’ve left the handful of photography related posts intact (not that they get any traffic) but I’ll no longer consider photography as part of this blog.  Should you be interested in my photos feel free to peruse my Flickr photostream.

So what do you think of the change?  Do you like the new name or should I change it back?

2 Comments

Filed under Software Development

Happy New Year!

The WordPress.com stats helper monkeys prepared a report for this blog’s activity in 2011.  It’s pretty cool to watch my little part of the Web grow.  I already have a few posts and talks in the works for this year and as always, I’m still on the lookout for new topics.

Here’s an excerpt from the report:

The concert hall at the Syndey Opera House holds 2,700 people. This blog was viewed about 22,000 times in 2011. If it were a concert at Sydney Opera House, it would take about 8 sold-out performances for that many people to see it.

2011 was a good year for me and my family.  We wish everyone the best for the new year.

Leave a Comment

Filed under Community, Software Development