Lately I had to change some code on older systems where not all of the code has unit tests.
Before making the changes I want to write tests, but each class created a lot of dependencies and other anti-patterns which made testing quite hard.
Obviously, I wanted to refactor the code to make it easier to test, write the tests and then chang...
Is there any Visual Studio Add-In that can do the remove method refactoring?
Suppose you have the following method:
Result DoSomething(parameters)
{
return ComputeResult(parameters);
}
Or the variant where Result is void.
The purpose of the refactoring is to replace all the calls to DoSomething with calls to ComputeResult...
I'm sure we've all seen it before...A code base that has been around for a year or two, and as features have been added and bugs fixed, we end up with pieces of code that aren't actually in use anymore. I'm wondering if there is a way (especially in VS.NET with or without a third-party tool) to search the codebase and show me which meth...
After I was convinced that labeled breaks/continues are a total "nono" over here, I need help to remove the label out of my code.
I have a square matrix and a vector that has the same length. The vector has already some values in it an depending on the values in the matrix the vector is changed in the loop.
I hope, the code-fragment is...
The Visual Studio refactoring support for C# is quite good nowadays (though not half as good as some Java IDE's I've seen already) but I'm really missing C++ support.
I have seen Refactor! and am currently trying it out, but maybe one of you guys know a better tool or plugin?
I've been working with Visual Assist X now for a week or tw...
Are there any tools which support refactoring PHP code (renaming variables, extracting methods, finding method references, ...)? Thank you.
...
I've joined a team that works on a product. This product has been around for ~5 years or so, and uses ASP.NET WebForms. Its original architecture has faded over time, and things have become relatively disorganized throughout the solution. It's by no means terrible, but definitely can use some work; you all know what I mean.
I've been pe...
I'm a complete Xcode/Objective-C/Cocoa newbie but I'm learning fast and really starting to enjoy getting to grips with a new language, platform and paradigm.
One thing is though, having been using Visual Studio with R# for so long I've kind of been spoiled with the coding tools such as refactorings and completion etc and as far as I can...
This is humbling, but probably something most can relate to. I am currently adding functionality to a PHP application I wrote for a client 2 years ago. In the interest of full disclosure, this was the first "real" application I ever built from the ground up, in the sense that I actually met with clients to determine and write a spec. ...
What is the best way to find something in a list? I know LINQ has some nice tricks, but let's also get suggestions for C# 2.0. Lets get the best refactorings for this common code pattern.
Currently I use code like this:
// mObjList is a List<MyObject>
MyObject match = null;
foreach (MyObject mo in mObjList)
{
if (Criteria(mo))
...
I've got to do some significant development in a large, old, spaghetti-ridden ASP system. I've been away from ASP for a long time, focusing my energies on Rails development.
One basic step I've taken is to refactor pages into subs and functions with meaningful names, so that at least it's easy to understand @ the top of the file what's ...
I am looking for something to integrate to my CI workflow.
I've heard of dbdeploy (http://dbdeploy.com/) but I'm looking for something else. The reason I don't like dbdeploy is I don't want to install java on my server.
I would prefer of course that the solution doesn't involve stringing some shell scripts together.
...
I'm in the process of refactoring some code which includes moving folders around, and I would like to regularly merge to keep things current. What is the best way to merge after I've moved folders around in my working copy?
...
I have a bunch of classes I want to rename. Some of them have names that are small and that name is reused in other class names, where I don't want that name changed. Most of this lives in Python code, but we also have some XML code that references class names.
Simple search and replace only gets me so far. In my case, I want to rena...
I'm sure you have all been there, you take on a project where there is a creaky old code base which is barely fit for purpose and you have to make the decision to either re-write it from scratch or repair what already exists.
Conventional wisdom tends to suggest that you should never attempt a re-write from scratch as the risk of fail...
At work I have found it very difficult to 'sell' the idea of refactoring to management and senior colleagues. This is despite us having inherited a truly awful codebase (we all thought it was awful including them) from a programmer who really shouldn't be in the profession. I recommended over and over that we refactor and it simply didn'...
Let's say you have a class called Customer, which contains the following fields:
UserName
Email
First Name
Last Name
Let's also say that according to your business logic, all Customer objects must have these four properties defined.
Now, we can do this pretty easily by forcing the constructor to specify each of these properties. Bu...
Resharper, RefactorPro, etc?
...
Refactoring is the process of improving the existing system design without changing its behavior.
Besides Martin Fowler's seminal book "Refactoring - Improving the design of existing code" and Joshua Kerievsky's book "Refactoring to Patterns", are there any good resources on refactoring?
...
Let's say you work someplace where every change to source code must be associated with a bug-report or feature-request, and there is no way to get that policy reformed. In such an environment, what is the best way to deal with code refactorings (that is, changes that improve the code but do not fix a bug or add a feature)?
Write up a ...