Archive for October, 2008

The Dvorak Keyboard 0


I’ve always heard about this mythical keyboard layout that was the apogee of all keyboards, the glowing golden standard to which all others fail to equal, and the other keyboard, designed to be slow and awkward. What might surprise some people is it’s the other, slower keyboard that has sprouted up on desks and laps all over the world and the Secretariat of keyboards never gets its chance to show its true legs.

The Qwerty keyboard was designed to keep the mechanical arms of typewriters from jamming by positioning common successive strokes on either sides of the machine. In contrast the Dvorak keyboard was designed to make the most common letters and
sequences of letters the easiest to type.

While installing Ubuntu this evening I noticed the Dvorak keyboard as an option. Immediately I thought about the several Dell keyboards I have tucked away in drawers gathering dust. Now I love my new slim Apple keyboard, but I’m going to stow it in the drawer for the next few weeks. Tomorrow I plan on laying out a Dvorak and giving it a try. I would like to find a typing speed test and see how it compares to the Qwerty and how it improves over time.

Book Report: The Cognitive Style of PowerPoint: Pitching Out Corrupts Within 2



So I commit one of the mistakes Tufte describes before the first sentence, but I need to draw you in. I need to grab your attention and keep you from bouncing off to YouTube. So if you made it this far, I probably have you, so here’s the meat and potatoes.



I’ve just finished The Cognitive Style of PowerPoint: Pitching out Corrupts Within on recommendation from a friend. I recently consulted with him on presentation I gave to another team within our organization. A few of his pointers were a result of his reading of CSPP. Given his excellent advice, and the inexpensive price tag of CSPP, I thought I would give it read.

Now I don’t work anywhere like NASA, the location of one of Tufte’s case studies. Nor do we deal with life and death presentations; however, instantly a correlation between us and NASA appeared as we both use PowerPoint as a substitute for a technical report or documentation. Following the Columbia disaster NASA and Boeing prepared several technical PP presentation to summarize their confidence in the safety attempting reentry. In our organization we create PP presentations when projects are initiated, information protection reviews are performed, new security policies are enacted, etc. PP is not the proper medium for such content, although I think Tufte would struggle to find a valuable topic where PP is a proper medium.

Tufte makes several points, although I’m sure if I read it again there would be several more hiding in every passage. The first item that I took away, with the help from previously mentioned advice, is that bullets destroy the continuity and quality of information. Bullets not only add noise to the screen, but fragment information in choppy, diluted, ambiguous phrases for the sole purpose of following the PP paradigm and fitting into 6 word sound bites. If the subject is important enough to get everyone in the room, more time could be spent on information rather than making it snappy and catchy.

For example:

  • Bullets are noise
  • Bullets are dumbed down sentences
  • Bullets dumb down your content

The audience can read faster than the speaker can talk, so keeping the slides short and sweet isn’t necessary. The dilution of information into PP slides became more apparent when he illustrated it took 54 PP slides to reproduce the information on a single page of a book. To apply this to our organization, the information protection review covers several checklist items without any explanation or discussion. Just “Have you done X“? What is X? Why do I care about it? Is it really a binary value or can I complete it to some degree? I don’t know. It just says “YES or NO”. I’ve always thought it was a little odd that we used PP for documentation.

Another interesting observation was the application of Conway’s Law to PP slides. I am really interested to see if slides produced by our organization follow the same deep visual hierarchy of those at NASA.

This is probably enough rambling. CSPP is short, less than 30 pages, and you could probably read it in the time it took me to write this post. I’ll just leave you with two ideas that should come across in my next presentation. When picking the hat to wear when preparing the presentation, pick the teacher hat and not the marketing sleaze ball hat. After all, that is the point of presentations, unless you are a used car salesman. They should understand what I’m trying to say and not just go along with it.

And along the same lines, have less noise and more signal. It will make the presentation more valuable and more creditable. This may mean the PP requires an accompanying document with more detailed information and data.

The two points are symbiotic. The more substance you have in a presentation, the less need for smoke, mirrors and magic to convince whomever of whatever because there is understanding. This also leaves, not only more valuable artifacts, but resonating confidence and more retainable information.

WPF and the DataGrid Shootout – Frozen Columns 3

My recent project has chosen WPF as its display technology. The biggest shortcoming of WPF for a traditional line of business application is its lack of a data grid control. Luckily there are several control providers out there that are already trying to meet this need; however we are attempting to determine how closely they meet our needs.

Our two most likely candidates are InfragisticsxamDataGrid and Telerik’s radDataGrid. The third contender, which unfortunately appears to be eliminated due to being open-source, is the  data grid in the WPF Toolkit. For some reason we are scared to death of open source tools. We would rather pay someone for closed source solution and be at their mercy to fix our problems than have it open and fix it ourselves. This could be an entire post on its own. Right now I’m paying the most attention to XamDataGrid and the WPF Toolkit DataGrid, maintaining hope that we’ll value something free if it provides us the value we need.

Anyway, our first out non-standard requirement is to freeze the column and row headers so we never scroll the first column or the headers to where they are no visible.

image

The column headers were simple. Both did that right out of the box. To freeze the first column with the WPF Toolkit datagrid requires setting one attribute:

<Controls:DataGrid AutoGenerateColumns="False" Name="grid" FrozenColumnCount="1">

No problem.

For the Infragistics grid there appears to be a lot more code to write. According to a post on the Infragistics forum, column freezing is not available with the Infragistics grid. The people I have seen implementing it put two grids side-by-side and only allow one to scroll, and I assume manually scroll them vertically together.

Replacing TFS Diff Tool 5

The TFS diff tool is horrible. It a pretty bare minimum difference between the two versions. The UI is basic.

image

Nice huh? This line changed, but you’re on your own to know what characters actually changed. While tooling around in the Visual Studio Options dialog I can across the settings that would let me change the diff and merge tools.Check out Tools | Options | Source Control | Visual Studio Team Foundation | Configure User Tools…

image

I needed a another diff tool, so I downloaded a trial of Beyond Compare and plugged it in there and it worked great! Except, in 15 days it wouldn’t be working so great unless I could convince someone to shell out the $X to get us past the trial. After pinging some of my buddies about what diff tools they use, I decided to try the diff tool in TortoiseSVN. I installed it and added TortoiseMerge to the dialog.

image

Ran my compare again and Bang! A new diff dialog appears that is much better than before.

image

That is still a lot of redundant clutter for me, so switching views helps a little with that.

image

We no longer get the detail about what changed on a line, but it is so much easier to manually identify when the rows overlap, I’m not missing it.

Join the Dark Side of the Force 0

I catch a lot of grief at work, hopefully in jest, about my non-traditional IDE colors. After reading through some links on A Continuous Learner’s Weblog I stumbled upon a link showing people’s dark IDE colors, so I thought I would post mine. I’ve tried a lot of different IDE colors, but still haven’t been persuaded away from my color scheme.

I stole the example text from CodingHorror. The font is Monaco which comes with Mac OS X, but can also be found for the PC.

Incentivizing Programmers 0

In most factories, especially those that pride themselves on their safety records, you’ll find a sign that says something like “600 days since our last lost time incident”. We should have the same for our automated build qualities, although I doubt they will ever reach 600 days of consecutive green builds. It would hopefully generate a sense of pride in the build. Imagine if you joined a team that had 60 days of green builds and that number was publicized for the entire organization to see. Wouldn’t you take extra care to make sure you don’t do something that flips it over to red, even for one build?

Gaining momentum behind doing automated build is something our organization is struggling with at the moment. For some reason the value isn’t immediately apparent or the schedules and budgets don’t allow for it at the moment. Both of those are topics for another post. Maybe a component to gaining that momentum is illustrating the elevation and longevity of the quality of the builds. I see two metrics being valuable.

  1. Days of consecutive green builds
  2. Change in the number of unit tests over time

Potentially a third being the number of customer reported defects.

The number of consecutive green builds is important, but if one team is doing nightly builds and another is doing continuous integration, does one team have a significant advantage in quality over another? I would say there is benefit there, but I wouldn’t categorize the advantage as significant. Also, looking at the change in the number of tests provides a better indication of progress than percentage change. Adding a hundred unit tests to a build that already has a thousand is substantially better than adding one unit test to a set of ten. I imagine you’re saying that is still rather subjective because you could have ten quality tests and a thousand horribly simple ones and that’s true, but maybe this isn’t the place to make those determinations. Let’s assume all unit tests are of roughly the same complexity and comprehension.

So here is my question. Would it be valid and beneficial to incentivize teams to improve these metrics or compete against other teams to improve the metrics? In the past we’ve given out $5 gift cards to Starbucks or iTunes when people did good jobs on something, just as a nice “thank you”. Would that work here? Could giving a $5 gift card to the each member of the team that has the longest stretch of green builds or added the most unit tests in the last month help motivate people? Now I don’t expect people to add hundreds unit tests every month to get their free fat free half caf soy carmel white chocolate mocha macchiato (I’m not even sure that drink exists or if would be less than $5 if it did). I’m not saying those are the metrics and the periodicity of the rewards that would work the best, just wondering if the spirit of it would work.

Recent posts by Ayende and Joel Spolsky seem to imply it would fail miserably.

I’m not sure something like $5 will lead teams to work the system just for the reward. Even without the monetary reward the principle behind taking pride in the build quality could established by making an aggregated build report public. Something really public. Maybe a screen when I get off the elevators, or a TV in the lobby that gives some metrics. Let me see who the people are who are writing the most unit test. I’m sure they can answer some of my questions or give me advice. Show me who isn’t building and we can get them the help they need to get it off the ground. There should be something we could do to help.

WPF Day 1 0

Our new project at work has chosen WPF for our UI Framework. There is a nervous feeling around the office that WPF might not be the proper choice, due to the nature of WPF or the quality of the development staff and the staff to follow. After spending a few days in WPF and developing a really rough prototype, I have to admit I am pretty sure we will put both concerns to rest. WPF has so many features that make it suitable to Line of Business applications, whatever that term truly means. While I haven’t mastered WPF in the past few days, I have a fairly good understanding of those features and usage potential.

The hardest myth to overcome is that WPF is only for the shiny, glossy, media rich applications. While it is excellent at delivering those user experiences, it is filled with numerous techniques that would provide use to any desktop application (except maybe command line applications).

I’m not going to try and do a job of completely enumerating why I’m excited about using WPF in a Line of Business application, but a brief list might help to summarize them.

Layout Managers

My WinForms experience includes mostly .Net 1.1 and VB6 over the past 10 years or so, but I do have a sprinkle of experience doing UI in Java Swing. The layout managers Java had looked like they would be a huge advantage over the absolute position of .Net and VB6. WPF introduces similar functionality with content containers.

There are several devices for laying out controls on the design surface. Before, when using the .Net 1.1 devices such as Dock it was very awkward to get the layout fluid. Controls required manual resizes and would often overlay other controls unexpectedly.

With new containers like StackPanel, Grid, DockPanel, etc. and the ability to nest them as needed, complex layouts become more manageable.

Even the controls themselves have the ability to be more flexible with their layout. Making three controls proportionally resize in WinForms required handling events, doing math to determine the new sizes based on the proportions and setting the sizes of each control. With WPF, you do the following:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="1*" />
        <RowDefinition Height="1*" />
        <RowDefinition Height="1*" />
    </Grid.RowDefinitions>
    <TextBox Grid.Row="0" />
    <TextBox Grid.Row="1" />
    <TextBox Grid.Row="2" />
</Grid>

Control Content Containers

In WPF near everything is a container. You want a checkbox inside a button? No problem.

<Button>
   <CheckBox>Cool<Checkbox/>
</Button>

Some controls, like TextBox doesn’t accept custom content. While this doesn’t appear useful at first, but the ability to override the content generated by list boxes provides am endless array of options. I imagine this will work like a repeater in ASP.Net.

Data Binding

By far the most impressive feature of WPF, at least to me, is the ability to bind, not only data elements, but also control properties and wire these bindings to other properties. There is a new rich model for binding almost anything to almost anything else. I know this seems a little vague at the moment.

The heart of the robust data binding is the dependency property. It allows for change notification as well as a few other nice features. Since the controls of WPF have their properties implemented by dependency properties, the binding is notified when they change and can bind the appropriate values.

Data binding could be used, for example to bind the font size of a grid cell to the value which it holds. We could a custom converter to convert the value of the cell to a font size or even to a color. Likewise, you could bind the text of a tooltip to an error message produced via a validator that is run when a text box value has its value changed.

Baby Steps

There are too many features to enumerate. I am about 250 pages into Programming WPF. I usually hate buying language books and prefer something with a little more longevity, but so far it has been a really fast read. I can’t say it is going to be the last WPF book anyone will every need, but coming from zero WPF knowledge, it has shed some light on the features of WPF that I see valuable. There are many more things mentioned in the book that I forgot to mention, haven read yet, poorly or entirely incorrectly phrased. :S This is by no means an expert synopsis of WPF.

While I’ve gotten my hands slightly dirty in WPF over the past week, I haven’t even begun to leverage its full power. I plan on keeping everyone abreast of my progress, short comings, troubles and successes…hopefully more of the later.

I am considering keeping a sample project running to show where I’m at in my WPF journey, but haven’t decided if it will be of value or interest to anyone. It would most likely be a simplified obfuscated version of my current project and a testbed for running spikes.

ReSharper tip of the Day: Move Code Left and Right 2

Josh showed us how to slap around our code with CTRL+ALT+SHIFT+UP|DOWN. We can now smack around our markup a little further. In addition to the four fingered up and down bully job, we and take an attribute left or right in the pecking order of the opening tag.

CTRL+SHIFT+ALT+LEFT|RIGHT (right in this case) bumps the attribute over.

If you prefer a more vertical representation of the attributes like the following, the command still works, but less intuitive since left and right actually move it up and down, and up and down move the entire tag up and down.

<CheckBox
     Margin="0,0,0,0"
     Unchecked="DoUnchecked"
     Checked="DoChecked">
     Some Text
</CheckBox>

One last thing to note is you do not need to select the entire attribute. Having the cursor in the attribute you wish to move is enough.

ReSharper Tip of the Day: Agent Smith and Agent Johnson 0

On the advice of a super bright coworker, I installed the Agent Smith and Agent Johnson plugins for R#. Now I’m getting all kinds of new advice and context actions.