refactoring

Need refactoring ideas for Arrow Anti-Pattern

I have inherited a monster. It is masquerading as a .NET 1.1 application processes text files that conform to Healthcare Claim Payment (ANSI 835) standards, but it's a monster. The information being processed relates to healthcare claims, EOBs, and reimbursements. These files consist of records that have an identifier in the first few...

How do you programmatically identify the number of references to a method with C#

I've recently inherited C# console application that is in need of some pruning and clean up. Long story short, the app consists of a single class containing over 110,000 lines of code. Yup, over 110,000 lines in a single class. And, of course, the app is core to our business, running 'round the clock updating data used on a dynamic we...

Are there any utilites that will help me refactor CSS

I am working with some CSS that is poorly written to say the least. I am not a design/CSS expert, but I at least understand the C in CSS. While the built in CSS support inside of VS-2008 is far improved over previous versions, it still doesn't quite do what I am looking for. I was wondering if anyone knew of a good program or utility th...

Best Practices: Storing a workflow state of an item in a database?

I have a question about best practices regarding how one should approach storing complex workflow states for processing tasks in a database. I've been looking online to no avail, so I figured I'd ask the community what they thought was best. This question comes out of the same "BoxItem" example I gave in a prior question. This "BoxIte...

How to refactor in a branch without losing my mind?

I refactor my and other people's code all the time. When I work in a branch and not in Trunk, this sometimes results in some extremely painful merges, especially if I don't merge back to Trunk regularly (the code at the branch slowly shifts away from the Trunc, and when people modify Trunk I have to figure out manually how to apply this ...

Reuse MVC arhitecture; Have two layers of UI : ASP.NET MVC and .NET Winforms

Although my question might seem abstract I hope it's not. Suppose I develop an application, an ASP.NET MVC site and later I am tasked to build an Winforms client for this application how much and how can I reuse from the existing application? I defined the models, I defined controllers and views. They all work well. Now the boss comes ...

Visual Studio 2005 - Refactor multiple attributes in same time?

Hello, I use the right button>Refactor>Encapsultate field to have my accessor every time. The problem is when I create new class, I can have more than 10 attributes and it's long to do 1 by 1 every accessor. Is there a faster way to create them? Thank you for your time. ...

What are the best code refactoring strategies ?

Thanks for sharing your point of view and previous experiences here. Here are some of the point you can write on: What must be the main refactoring goals ? How do you scheduled your refactoring tasks ? Do you recommend any specific tool ? Do you plan pre and post refactoring tests ? Do you plan refactoring specific code-reviews ? ... ...

What is the state of C++ refactor support in Eclipse?

Is it at the state where it is actually useful and can do more than rename classes? ...

Refactoring global to local. Should they be static or not?

I'm refactoring "spaghetti code" C module to work in multitasking (RTOS) environment. Now, there are very long functions and many unnecessary global variables. When I try to replace global variables that exists only in one function with locals, I get into dilemma. Every global variable is behave like local "static" - e.g. keep its valu...

Semantic merge tool

Background: In my job, we use SVN, C# and VisualStudio. Part of my task regularly involves global renames. Often I end up with a broken build after renaming something and then merging in changes. The question: is there a solution out there that can look at my changes, notice the global rename and then apply that to the edit that others ...

How often should you refactor?

I had a discussion a few weeks back with some co-workers on refactoring, and I seem to be in a minority that believes "Refactor early, refactor often" is a good approach that keeps code from getting messy and unmaintainable. A number of other people thought that it just belongs in the maintenance phases of a project. If you have an opin...

Are you a code neat freak?

How do you handle ugly code? Are you a code neat freak? Do you feel that you have to clean up a file of source code before you can do anything useful? Do you have the urge to refactor bad structure when you see it? I admit that I'm often tempted to clean up other people's code when I have to modify the code anyway. Bad code is a pe...

Refactoring "include file hell"

One thing that's really been making life difficult in getting up to speed on the codebase on an ASP classic project is that the include file situation is kind of a mess. I sometimes find the function I was looking for being included in an include file that is totally unrelated. Does anyone have any advice on how to refactor this such t...

Is there a tool that will look at my Java code, and suggest a good package structure?

I have a large codebase, and I'd like to refactor the package structure so that classes which interact heavily go in the same package. It seems that it should be possible to create a tool that could look at the interactions between classes, and then group together those classes that interact heavily. These groupings might then suggest ...

When is it good (if ever) to scrap production code and start over?

I was asked to do a code review and report on the feasibility of adding a new feature to one of our new products, one that I haven't personally worked on until now. I know it's easy to nitpick someone else's code, but I'd say it's in bad shape (while trying to be as objective as possible). Some highlights from my code review: Abuse of ...

What are the limitations of refactoring?

I'm making a study on refactoring limitations on improving existing software architecture and I would be interested to hear your experiences where you have found refactoring to be not enough or still too immature to accomplish your goals. ...

Options for refactoring bits of code away from native C++?

So, one commonly heard comment when talking about performance is that you write your code with whatever language gets the job done fastest. If performance in specific areas is a problem, then rewrite those bits in C/C++. But, what if you're starting with a native C++ app? What options do you have if you want to write the easy bits, or r...

Tools for refactoring table-based HTML layouts to CSS?

Given an HTML page that has a complex table-based layout and many tags that are duplicated and wasteful, e.g.: td align="left" class="tableformat" width="65%" style="border-bottom:1px solid #ff9600; border-right:1px solid #ff9600; background-color:#FDD69E" nowrap etc. Are there tools to aide the task of refactoring the page into a mor...

Refactoring vs. Rewriting

With legacy code, how do you know when it's best to rewrite over refactoring? ...