Posts Tagged productivity

Automated refactoring for C++

During the year that I  was on a Java project, I found Eclipse’s automated refactoring tools such a productivity boost.  I remember doing probably my first automated Extract Method and seeing it automatically deduce which parameters would need to be passed, and saying “No way.  No way!” And then you could rename methods (and it would update the dependencies); you could extract a local variable; you could do a quick fix… I would find myself giggling and sometimes laughing out loud – there were all these mundane, tedious and error-prone manual manipulations of source code that I was used to doing, being careful and manually checking everywhere to try not to miss something – and now that I could use the Refactor menu my mind was freed to think about the problem I needed to solve.  Wow!

Automated refactoring was such a productivity and energy boost.  I don’t want to go back to the way it was before.  So, now that I’m in C++,  I’m interested in finding an automated refactoring tool for C++ – preferably one that integrates with Visual Studio.

What’s Out There?

For C++ development, a quick Google search turned up devexpress‘s Refactor! for C++ and Whole Tomato Software‘s Visual Assist product, both of which integrate with Microsoft Visual Studio.  Refactor! for C++ is a free download, whereas Visual Assist costs $249 with $49 maintenance renewals (or $99 for a license that is not eligible for the renewals).

This post on refers to SlickEdit as an alternative.  Ah yes, apparently SlickEdit can do refactorings in C++ .  And it appears that some people around here already use it. Hmm!

For Tonight’s Program, the Screenshots Part Will Be Played By…

Here is the part where I would take a bunch of screen shots demonstrating the use of Extract Method… but Whole Tomato has a nice post about that on codeproject already.  Helpful to see the tool in action.

Out With a Whimper

And to add to the letdown of me not having my own screenshots… I haven’t come to a conclusion yet either.  I have SlickEdit, the trial version of Visual Assist X, and Refactor! for C++ installed.  Guess we’ll try ’em and see!

(Const) References

Refactoring Tools Shoot Out by Legalize Adulthood

All developers are equal, but some are more equal… (Maciek Talaska)

A couple of Stack Overflow exchanges pointing to Refactor and VAX

SlickEdit – Programmer’s Editor (

Are We There Yet? SlickEdit’s C++ Refactoring


, , ,


Sometimes there’s an easier way

I was working to get snapshots of the Hibernate AnnotationConfiguration properties in effect when Hibernate local transactions are in use versus when a JTA transaction manager is in use, and halfway through I found there was a much easier way to capture my data.

What I did First

  1. While a debugging session was stopped at a breakpoint at line 732 of org.springframework.orm.hibernate3.LocalSessionFactoryBean (In buildSessionFactory() where the AnnotationConfiguration is done being built), I went to the Expressions view and selected the AnnotationConfiguration named “config”;
  2. Opened config’s properties field and manually expanded all 116 nodes, exposing their key/value pairs;
  3. Selected the 116 nodes-with-key/value-pairs and chose Copy Expressions from the context menu;
  4. Pasted into Notepad and manually removed the “[0…99]” and “[100…116]” lines;
  5. Saved the modified file as hibernate-annotation-config-jta.txt
  6. Ran the following commands:
    egrep --invert-match "\[" hibernate-annotation-config-jta.txt > keys-values.txt
    egrep key= keys-values.txt | sed 's/[ \t]*key= \"\(.*\)\".*$/\1/' > keys.txt
    egrep value= keys-values.txt | sed 's/[ \t]*value= \"\(.*\)\".*$/\1/' > values.txt
    paste --delimiter== keys.txt values.txt > keys-values-jta.txt

This worked — it got all 116 entries into key=value format, one key/value pair per line — and I prepared to do it again while running my test in Hibernate mode.

Then I noticed…

Then I saw another pane in the Expressions view I hadn’t really noticed before, on the right hand side.  When I clicked on one of the AnnotationConfig’s properties in the Expressions window (even without expanding that entry to show the key and value), I saw the entry in key=value format over in that right hand pane.  And… if I selected all 116 nodes in the left pane of the Expressions view, all 116 key=value pairs showed up in the right pane, ready for me to select and copy!

My new workflow, then, is:

  1. While a debugging session is stopped at a breakpoint at line 732 of org.springframework.orm.hibernate3.LocalSessionFactoryBean (In buildSessionFactory() where the AnnotationConfiguration is done being built), go to the Expressions view, select the AnnotationConfiguration named “config”, and within that select the properties field;
  2. Make sure the “Show Logical Structure” button is pressed;
  3. Expand the properties field so that you can see the individual [0], [1] [2]… entries
  4. Select all these entries:
  5. In the Expressions view’s right hand pane, Select All and copy.

Those are nicer steps than what I did first!  Eclipse comes through again!

, , ,

1 Comment

Amazinger and amazinger

I keep having pleasant surprises at new ways the Eclipse IDE can help my productivity.  I wrote about Quick Fixes before; here’s today’s:

Did you know that you can type just the capital letters of a class, and then when you hit Ctrl+Space, Content Assist shows what names have those capitals?

For instance, suppose I want to add a Spring DefaultMessageListenerContainer reference to my class (admittedly odd, but it’s a big long name I don’t want to have to type):

  1. I type DMLC, …
  2. …hit Ctrl+Space…
  3. …and Enter…
  4. “DefaultMessageListener” appears, and I go on to type a field name:

(The title references Alice…)


Leave a comment

Measuring productivity?

Our new CEO is not afraid to take us where we’ve never been yet.  (In fact, I think that’s a major reason he came!)

One of the things he wants to do is to reward individual excellence*.

Will this require being able to measure (individual) productivity?  (Understand, I’m all for producing excellent work and being rewarded for it!)

Whenever the issue of measuring productivity is raised, I always think of Martin Fowler’s 2003 post in which he says that you Cannot Measure Productivity. However, while Fowler gives examples in that post of productivity-measuring attempts backfiring, he doesn’t demonstrate that it’s intrinsically impossible.

Measuring productivity is hard, and it’s a people-stuff thing that as software developers we’re not trained to do.  But is it really impossible?  Let’s re-evaulate here.  What do others have to say?

I appreciate Johanna Rothman’s writings.  She has some things to say about measuring productivity:

  • In Measuring Productivity #1: Defining Productivity: “…a single-dimension measurement is inadequate for measuring a person’s productivity, and that on a project, it’s the productivity of the project, not the productivity of a given person that matters.” (She re-emphasizes the  the team productivity rather than individual productivity thought in Why Hire Junior Contractors?)
  • In Measuring Productivity #2: Measurement Considerations:

    If we want to start measuring developer or tester productivity, we have to define output per hour (or whatever time period you desire).For developers, we can measure designs considered, lines of code generated, the number of defects generate along with the code, unit tests generated, unit tests run, how good that output is,and the time it took the developers to generate all that output.

    Not so simple, eh? If we just knew how to measure how good our work was, we’d have a chance to measure individual producitivity. The more I think about productivity, the more I know it’s a project-by-project thing, not a person-by-person thing.

  • In Measuring Productivity #3 she gives some potential ways to measure team productivity.

So again, measuring individual productivity is difficult… easy to do wrong… but can we get a picture of how we might work through those difficulties?

Steve McConnell adds to the discussion in his Measuring Productivity of Individual Programmers post and gives some caveats; for example:

The problem with measuring productivity in terms of lines of code per staff month is the old Dilbert joke about Wally coding himself a minivan…This really just speaks to the management chestnut that “what gets measured gets done,” so you need to be careful what you measure.

He gives four caution-laden guidelines to use when attempting to measure individual productivity, and concludes,

On real projects it’s hard to find a use for individual productivity measures that is both useful and statistically valid. In my experience, aside from research settings the attempt to measure individual performance arises most often from a desire to do something with the measurements that isn’t statistically valid. So while I see the value of measuring individual performance in research settings, I think it’s difficult to find cases in which the effort is justified on real projects.

(Measuring team productivity and organizational productivity is a different matter — I’ll blog about that soon).

So if we’re not careful, it seems we could easily cause unintended side effects through a reward system (like in the Dilbert example)

I’m hopeful, though.  There are many difficult things that we need to learn to do well, not just this — wouldn’t it be cool if this were one where we persevered and overcame?  I’m curious to see how this will play out!

*Was that the term?  I think it was something like that — it made me think of individuals rather than teams, but that may be a misperception on my part.


The pies aren’t the same size

Something that’ s been hard to explain is why I think the “sprinklings” can’t, must not, be managed, even when we’re in a time crunch (are we ever not in a time crunch?). The thinking goes, “These sprinklings are great, but you probably need to postpone them till after we fix this critical defect. You need to concentrate on fixing this defect for now.”

See? We don’t have spare time sitting around to throw at these “sprinklings”. Why should we allow or encourage time to be spent on them? We’re so far behind already – we can’t encourage these “other” activities, can we? At least till we’re out of the hole?

Yes. We can. We must. Here’s why.

Doing Only the “Necessary”

Here we have a picture of where a developer spent one week of his time. In a 40-hour work week, he spent 94% of his time doing Official Stuff and 6% of his time doing Sprinklings (He felt a little guilty for doing the Sprinklings since no one had given him permission to do those things). He produced 114 DBPs* of work.

Not many sprinklesLegend

He fell behind on his estimates this week, though. Hmm. It looks like we could boost his productivity 6% by having him eliminate the “sprinklings” for now. Right? Wrong. Here’s the twist: the sprinklings didn’t take time away from his project – they’re what keeps him going.

The Momentum of Flexibility

Here’s my experience. Let that same developer have the flexibility to add in those extra sprinklings using his own judgment, and here’s what will happen (at least if he’s me):

In the following diagram, given freedom, the developer has now spent 56% of his time on Sprinklings and only 44% on Official Stuff. WHAT?! We can’t afford that kind of waste, can we?

Lots of sprinklesLegend

But wait, look, in this same week he produced 745 DBPs of work. He was six-and-a-half times more productive, even though he only spent 44% of his time “on-task” as opposed to 94% time-on-task in the other scenario. (And he didn’t feel guilty – he knew what he was responsible for and was accountable for that).

Is This Realistic?

I admit it – I made up all these numbers out of my head. But I know that personally, when I’m discouraged and feeling that my hands are tied, it is so hard to be productive, and when I’m feeling free to do the Sprinklings along the way, I also get more done on my Official Stuff. It really does make a difference if a developer feels empowered or bound!

What do you think, developers? Does this match your experience (or is this “pie in the sky” ?)

Is this phenomenon limited to developers?

*Development Battle-Points



The weird thing

The last few days I’ve been working at trying to understand and articulate where the discouragement is coming from here at work. Why do good developers keep leaving? Well, because they find brighter-looking alternatives. Ok, but why aren’t we the brighter opportunity? Why do people feel they have to leave to pursue that opportunity?

Perhaps the other company only looks better (when really it has the same issues)? Or maybe they’re just discontented people?

I don’t buy it.

Programmers I admire and respect are getting discouraged and leaving the company for reasons I bet they can’t always completely articulate, and I haven’t been able to clearly articulate the nature of my discouragement either. So I’m trying to figure it out. In the movies it’s always easier to fight the invisible monster once you figure out a way to make it un-invisible. That is what I’m trying to do.

So anyway, the weird thing is, I’m spending all this time thinking about this issue and yet I’m not falling behind on my regularly assigned work. In fact, now that my mind is going on this peopleware-type stuff, I think I’m actually getting more done on my regular work than when I was merely discouraged and trying to stick to just doing my job! I guess this is not a zero-sum game.

One more weird thing: It’s kind of odd to be applying problem-solving skills that I’m used to only applying to software, to people issues. It’s also kind of cool though.

Will I be part of effecting an important change at my company, or be fired? (Maybe everyone who ever tries something big wonders that.)


1 Comment

The hidden assumption

The hidden assumption: that the level of work I’m doing when I am free to improve things is the same as when I lack such freedom and feel that my contribution to the company is not what it could be (with the accompanying loss of hope).

The assumption is that if we take out all the sprinklings* we meet our deadlines faster. But it’s those sprinklings that keep me going, otherwise it could take me a week just to put together a simple design doc! It’s another one of those upside-down things. How can more classes be simpler? And then in this case, how can spending fewer hours directly on a project make it quicker to complete?

Being able to defend and explain these things is a separate skill from being able to do them. I have more of the second, very little of the first.


*What I’m calling “Sprinklings” are the things we do each day to improve our craft.


1 Comment