Friday, January 22, 2010

Making DevExpress & ReSharper Play Nicely

I use both DevExpress’s IDETools and JetBrains ReSharper on my dev boxes. Why? Because I’m a tool whore. That and I like different pieces of both of them. DevExpress gives me awesome visualization, and R# gives me awesome other stuff.

Here’s my quick steps to making them play nicely together in VS 2008:

  1. Install DevExpress tools first
  2. Install ReSharper
  3. Start VS, fill out license info as you’re prompted
  4. Tell ReSharper to use R#/IntelliJ key mappings
  5. Disable DevExpress options I don’t like
    1. DevExpress | Options
    2. Set Level to Expert (lower left corner of dialog)
    3. Editor | Auto Complete | Intellassist | Setup | clear Enabled checkbox (I like R# completion better)
    4. Editor | Auto Complete | Intellassist |Parens & Brackets | clear both options for Smart Parens and Smart Brackets (I’ve always had grief with these conflicting, so I shut ‘em off)
    5. Editor | Clipboard | Smart Cut(Copy) | clear Enabled (Plain ol’ VS copy/cut/paste works for me)
    6. IDE | Shortcuts | search for Ctrl-B (PasteReplaceWord) | clear Enabled (I use Ctrl-B in R# to go to definition)
    7. IDE | Shortcuts | search for Ctrl-Alt-F (QuickFileNav modal) | clear Enabled (I use this shortcut in R# for formatting code. R# gives me Crtl-N and Ctrl-Shift-N for type/file nav)
  6. Force ReSharper once more to use its shortcuts. ReSharper | Options | General | Visual Studio Integration | Restore ReSharper keyboard shortcuts | ReSharper 2.0 or IntelliJ IDEA | Apply

These are MY preferences, but it’s what works for me.

Thursday, January 21, 2010

Flag Parameters are Evil! (Or at least unclear)

The more parameters you have in a method call, the more chances you have to screw things up. Moreover, method signatures with boolean parameters (flags) add in clarity problems, too – even if the input parameter is well-named.

Instead of exposing a non-private method with a flag, make that method private and instead expose two well-named, explicit methods which are simple facades over the newly private method.

Instead of

protected T CreateRestServiceInstance<T>(bool impersonateEnabled)


use



protected T CreateRestServiceInstanceAsServiceUser<T>()
{
return CreateRestServiceInstance<T>(false);
}

protected T CreateRestServiceInstanceWithImpersonation<T>()
{
return CreateRestServiceInstance<T>(true);
}

private T CreateRestServiceInstance<T>(bool impersonateEnabled)
{
//wonderful shiny stuff here
}



You’re making your class’s API explicit and clear, and you’re cutting the risk of someone goofing up and missing something important – like invoking a REST endpoint as a service account instead of impersonating the user.



Not that I’ve ever done this myself, mind you…

Saturday, January 16, 2010

I Am Not CodeMash

Every year I get lots of people thanking me for putting on CodeMash. I get comments about how the conference has changed their thinking and gotten them fired up to go do great things back at work. I’m humbled and flattered, but I’m not the force behind the conference. I’m not CodeMash.

Brian Prince puts in 300 – 400 hours a year handling registration and overseeing our web efforts. Brian is CodeMash.

Jason Follas puts in around 200 hours dealing with sponsors, t-shirts, schedules, and hundreds of other little tasks I never hear about but somehow magically get done. Jason Follas is CodeMash.

Jason Gilmore puts in nearly 200 hours overseeing the 500 session submissions we get for 60-some-odd session slots, plus he handles all the schedule planning and timeslotting, and he handles all the speaker coordination. Jason Gilmore is CodeMash.

Our content selection committee of Dianne Marsh, Joe O’Brien, Jay Wren, Sarah Dutkiewicz, and David Stanek had the tremendously difficult task of culling through those 500+ submissions to pick out the best possible lineup for the conference. CodeMash has lots of Great Stuff to do, but it’s all based on the amazing content. Dianne, Joe, Jay, Sarah, and David are CodeMash.

Darrell Hawley and Mike Woelmer took on tremendous responsibilities for owning the coordination for the Enter The Haggis concert and all our VIP travel coordination, respectively. If you think that’s an easy task please go kick yourself in the teeth. Moreover, they did that at a point when I was in an awful spot with work and life and could not have handled either task at all. Darrell and Mike are CodeMash.

Our 58 speakers and 3 keynoters delivered the amazing presentations that make CodeMash really shine above many other conferences, regardless of size. Those folks are CodeMash.

Scott Zischerk, Chris Woodruff, Mike Wood, and Steve Andrews are always pitching in to lend a hand wherever it’s needed, regardless of whether it’s schlepping trash, handing out tshirts, or manning the registration booth. Scott, Chris, Mike, and Steve are all CodeMash.

Finally, look at the attendees who show up and get outside their comfort zone. Look at those attendees talking in open spaces during the conference and interacting with folks they’d never get a chance to otherwise. Look at the folks pairing up in the Coding Dojo and polishing up their skills. Look at the folks in Leon Gersing’s PreCompiler TDD Workshop session who filled out retrospective cards with blurbs like “Loved a practical workshop with Agile!” or “Never paired before, but learned a lot!” or “Didn’t know anything about Rails before today, but loved the experience.” Those folks are CodeMash.

I’m not CodeMash. YOU are CodeMash. I’m just lucky to be a part of it. Thanks!

Now go do something with what you learned. Me? I’m taking a nap.

Wednesday, December 16, 2009

Favorites of 2009 (Telligent-Style)

Jana started an interesting thread on a Telligent-internal mailing list, which prompted Josh to follow up with a great blog post. The topic was four questions:

    1. What was your favorite work-related or field related or technical read for 2009 (white paper, book, etc)

    2. What was your favorite new Telligent feature for 2009?

    3. What was your favorite enhancement for Telligent products in 2009?

    4. Favorite external app/product/feature you used in 2009?

I enjoyed a bit of a retrospective over the year and came up with the following responses.

Favorite work- or field-related or technical read: Leading Lean Software Development by Tom & Mary Poppendieck. Awesome motivator for what organizations can do if they get the entire group solidly behind transforming how they build, deliver, and support/service products and services. Bob Martin’s Clean Code would be a close second, Stand Back and Deliver a solid third.

Favorite Telligent feature for 2009: I was lucky enough to work with a great group of guys (Dave, Nate, Sean) on v2 of Telligent’s web services API. They kicked ass with amazing work and evolved our web services into a solid, powerful approach for extending and writing new apps on our Telligent Evolution platform.

Favorite enhancement for Telligent products in 2009: If you’ve read my blog or Tweets much then you know I’m a Lean fanatic. My favorite enhancements for our products in 2009 are those we didn’t. Nope, that’s not a typo. Our leadership gave us some great support for rethinking how we approached development in the last four to six months. As a result, we focused hard on a lot of things behind the scenes. Features were dropped from the backlog. Features were simplified in our current codebase. Features were CUT from our codebase. As a result, we’ve ended up with an improved codebase and significantly simplified user experience. Cutting and simplifying is an absolutely glorious feeling. Lean, FTW!

Favorite external app/product/feature of 2009: Visual Studio, because while I’m not a “real” developer, writing code is a great way for me to stay engaged with things I’m very passionate about. (Testing, development practices, beautiful code.)

Friday, November 27, 2009

Book Review: Beautiful Testing

Beautiful Testing: Leading Professionals Reveal How They Improve Software, by Adam Goucher and Tim Reilly. Pub by O’Reilly, ISBN 0596159811.

This is a great book for testers, leads, and managers to read to get a better picture of where your testing process can bring value to your work. A few sections of this book didn’t get me much value, but the vast majority of the book left me frantically scratching notes and folding corners of pages over. I read the book over a weekend and came away with a large number of major additions to my QA roadmap I use at work.

Kamran Khan’s chapter on fuzz testing reinforced my ideas that choking your system with invalid parameters and input data is a tremendous way to shore up that system’s stability. I also really enjoyed Lisa Crispin’s and Alan Page’s separate chapters, both of which emphasized value-driven, sensible approaches to test automation.

If you want an amazing story around how testing can directly impact the lives of those around you, read Karen Johnson’s chapter “Software in Use.” Johnson ties a visit to an Intensive Care Unit to work she’d done on equipment in that ICU – it’s rare anyone sees that practical a link to work we do in this industry.

Other highly worthwhile chapters include the piece on Python’s development process, the overview on TDD, Mozilla’s regression testing philosophy, and others. The Python chapter, in particular, is a tremendous testament to how a rigorous testing philosophy can guarantee very solid releases even with a broad, distributed team of varying skills.

As my examples above point out, there’s a great amount of broad-stroke value in the book; however, a wealth of smaller, critical points abound in various chapters as well. Some weren’t phrased exactly like this, but I’ve taken away these other concept as well:

  • Track the source of your bugs (test plans, exploratory, developer, etc.) and pay special attention to bugs found by customers. These “escapees” point to areas to shore up in your test plan.
  • Mindmaps are a great way to brainstorm out your test plan or test areas.
  • Use small tools like fuzzers to help create your baseline input data.
  • 100% passing rates for your automated tests isn’t reasonable. Investigating 100% of your failing tests to determine whether the specific failure matters is reasonable. (I already firmly believed this, but it was nice to see in print!)
  • Using image comparison to check formatting.

This is one of the better books I’ve read this year, and it’s absolutely worth adding to your shelf.

Several Book Reviews

97 Things Every Project Manager Should Know by Barbee Davis. Published by O’Reilly. ISBN 0596804164.

This is a terrific collection of small articles on many aspects of project management and successful team leadership. There are a large number of authors involved in this work, so the articles’ voices vary, but each one is very well written and clear.

I loved Neal Ford’s and James Graham’s articles on productivity and finding good individuals, and William Mills’ Meetings Don’t Write Code certainly fit right in with my core philosophy.

The book’s very easy to read and has a lot of valuable insight. Highly recommended!


Elements of Programming by Alexander Stepanov and Paul McJones. Pub by Addison Wesley. ISBN 032163537X.

Serious approaches to algorithms for the hardcore computer science geek. Heavy on math, low on applicability for me and my line of work – but I’m sure lots of folks will find it very useful. Lots of concise, in-depth discussion of foundational knowledge, and plenty of exercises to help evolve your skills.

The tone’s exceedingly dry and academic, and I got very tired of the authors repeated assertions that you need to be using a “real programming language such as C++.” Guess all the value-providing projects I’ve helped roll out in Perl, Java, C#, and other languages haven’t counted.

That said, this is a wonderful book for those interested in raising their skills in hardcore algorithms.


The CSS Anthology, 3rd ed by Rachel Andrew. Pub by Sitepoint, ISBN 0980576806

It’s Sitepoint, it’s CSS, it’s pure goodness in full color. Another amazing book from Sitepoint that is clear, concise, example-driven, and highly useful. I love how many of the topics are written in a before/after or progressive style. It’s a great mix between a cookbook and tutorial approach.

There’s enough content here to make this book useful to CSS novices or advanced folks.


The Manga Guide to Calculus, Hiroyuki Kojima, et. al. Pub by No Starch Press, ISBN 1593271948.

The Manga Guide to Molecular Biology, by Takemura Masaharu, et. al Pub by No Starch Press, ISBN 1593272022.

Both these books follow the same great approach as the Manga Guide to Physics I reviewed some time ago: Break a complex idea down in to small pieces, clearly explain it with practical examples, and use the fun Manga comic style to wrap the entire concept in a great story.

I never took calculus in high school or college, yet I was able to get through the Guide and come out at the end with a pretty fair understanding of it. Moreover, I actually enjoyed the learning journey!

My nine year-old daughter loves these books and always reads through them after I’m done. She’s not coming away from the books with great knowledge of the concepts, but she’s finding them interesting, fun, and is less intimidated with the subjects. I think that’s a big win because these guides are laying some good ground work for her to come back to later.

Friday, November 20, 2009

Displaying the Document Properties Toolbar in Office Documents

The Document Property bar in Office 2007 is handy, particularly if you’re working with SharePoint document libraries and have added some custom columns. Those show up as nifty properties in your document, like so:

Unfortunately, if you close the property bar it’s not very intuitive on how to get it open again. Use Office | Prepare | Document Properties to get it back. Yeah, that Properties command is under “Prepare.” UI Fail, but there you have it.

(Posted because I continually forget how to get the properties bar back.)

Monday, November 16, 2009

Automate Activation/Deactivation of SharePoint Features

Click, wait, click, click, wait, click, wait, wait, click, wait, … Life as someone working with SharePoint development when you’re trying to update features you’re working on or testing. It sucks.

Here’s a little Watir on Ruby script to ease your pain. You can launch this from the command line with a “-a” or “-d” arg to activate or deactivate. Edit the @siteroot and @*Features variables to match your needs.

This uses some XPath-fu to find the Activate or Deactivate button for the feature named in the two *Features variables.

No, it’s not pretty. Yes, there are <x> different more betterer ways it could be done. It skinned the cat I needed skinned and I’m happy.

UPDATED: Refactored it a bit.

require 'watir'
require 'optparse'

@siteroot = "http://w2k3rs/"
@collectionFeatures = [ "Telligent Enterprise Menu Items",
"Telligent Enterprise WebParts"]
@siteFeatures = ["SharePoint Integration for Telligent Enterprise",
"Telligent Enterprise Search Replacement for WSS v3" ]

$options = {}

opts = OptionParser.new
opts.banner = "Usage: SpiFeatures [$options]"

$options[:activate] = false
opts.on( "-a", "--activate", "Activate SharePoint Integration" ) do
$options[:activate] = true
end
$options[:deactivate] = false
opts.on( "-d", "--deactivate", "Deactivate SharePoint Integration" ) do
$options[:deactivate] = true
end
opts.parse(ARGV)


$action = "Activate" if $options[:activate]
$action = "Deactivate" if $options[:deactivate]

$browser = Watir::Browser.start @siteroot + "/_layouts/ManageFeatures.aspx?Scope=Site"
$browser.speed = :fast

def toggle_feature(feature)
$browser.button(:xpath,
"//table[@class='ms-propertysheet']//table//table//tr[td[h3[contains(.,'" +
feature +
"')]]]/../../../..//input[@value='" +
$action + "']").click
if $options[:deactivate] then
$browser.link(:text, "Deactivate this feature").click
end
end

@collectionFeatures.each do |@feature|
toggle_feature(@feature)
end

$browser.goto(@siteroot + "/_layouts/ManageFeatures.aspx")

@siteFeatures.each do |@feature|
toggle_feature(@feature)
end

$browser.close