Geertjan's Blog

  • November 20, 2013

Floss Refactoring in NetBeans IDE

Geertjan Wielenga
Product Manager

Ralph, the NetBeans refactoring guru, tells me to press "Ctrl-R" below, over the variable "x". Then I see (a very nice small unobtrusive) dialog that shows the label "Apply Rename on Comments", with (even more unobtrusively) "Press 'Ctrl+R' Again for Refactoring Dialog":

Next, when I press Ctrl+R again, I see the Refactoring dialog, in the place and with the functionality that I am used to from other refactoring actions in NetBeans IDE:

So, then, I ask Ralph: "What's the big deal here?"

He says: "Well, this is the first step to fully supporting 'floss refactoring', which means being able to refactor continuously. We do not want to be obstructed by various dialogs, but we want to have the full refactoring engine at our finger tips."

What's the next step, then? "To add full support for all the other options, e.g., renaming getters and setters and copying the same principle to the other refactorings. Extract method will directly show you the extracted method and will  let you configure the new method name in the editor, instead of in a dialog."

Is this all about not needing to open dialogs and, instead, refactoring in-line, within the code? "Yes, this is one of the things we need to support floss refactoring."

OK, so what else do we need? "Drag and drop refactoring..."

So, what's "floss refactoring"?

When we talk about refactoring tactics, we are referring to the choices that you make about how to mix
refactoring with your other programing tasks, and how frequently you choose to refactor. To describe the
tactics, we use a dental metaphor. We call one tactic "floss refactoring"; this is characterized by frequent
refactoring, intermingled with other kinds of program changes. In contrast, we call the other tactic "root
canal refactoring". This is characterized by infrequent, protracted periods of refactoring, during which
programmers perform few if any other kinds of program changes. You perform floss refactoring to maintain
healthy code, and you perform root canal refactoring to correct unhealthy code. Further details: http://web.cecs.pdx.edu/~black/publications/IEEESoftwareRefact.pdf

Join the discussion

Comments ( 1 )
  • markiewb Wednesday, November 20, 2013

    Nice one! I've seen something similar in other IDEs, so am glad that it will be introduced in NB too.

    @Geertjan: Please add your screenshot (and the link to this post) to http://wiki.netbeans.org/NewAndNoteworthyNB80

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.