refactoring
How to refactor function parameters for this logic: "param 2 is only needed if param 1 is true"?
I have to following functions: public enum class SetMinMaxMode { Auto, // min and max is set based on the channel data[详细]
2023-04-01 12:30 分类:问答C#: Simplifying many similar implicit operator methods
I have a class with a bunch of implicit operators. In the code below, only a few examples of the implicit operators are used. I\'m looking for any ideas how to refactor this, without making the SafeVa[详细]
2023-04-01 09:20 分类:问答How to Remove Duplicated Codes in This Design?
I have about 30 data access classes and all of them contain a GetAll method with some parameters. My code in all of them looks like below:[详细]
2023-04-01 07:14 分类:问答Unrecognized selector sent to an instance after refactoring - Xcode4
I\'m trying to clean up some old code that I wrote to comply with Apple\'s guidelines on method naming etc. and encountered this. Basically, I have a button in Interface builder and a tapDown action c[详细]
2023-04-01 01:52 分类:问答How to Refactor this simple Ruby algorithm
Ok, I have this ruby script which opens a file and passes each line to the line_parser method. This method simply changes tabs for a couple of spaces. Here it is:[详细]
2023-03-31 21:39 分类:问答Trying to refactor to Null object pattern but the end result seems worse
I\'m refactoring a big class that has a lot of checks for null all over the place into using the null object pattern. So far it\'s been an almost smooth change but I am having a couple of issues with[详细]
2023-03-31 16:53 分类:问答Tool for extracting base class?
If I have a C# code like this: public class A { public string PropA { get; set; } public string PropB { get; set; }[详细]
2023-03-31 16:24 分类:问答How can I DRY this code and clean up my model?
I have the following two methods for a Number model. def track number = sanitize(tracking) case determine_type(number)[详细]
2023-03-31 15:19 分类:问答How to handle step-by-step refactory of some heavily used libraries?
I have a couple of libraries that were targetting multiple platforms, of which some realtime ones that did/do not have decent STL support, let alone tr1 or C++11. This means everything uses the librar[详细]
2023-03-31 14:21 分类:问答Refactoring over several branching with a lot of directory structure changes
There is a very large Visual Studio solution (almost 200 projects) which I need to refactor and restructure, merging and possibly dividing many of those projects, altering code...[详细]
2023-03-31 14:10 分类:问答