Click here to Skip to main content
15,892,161 members
Everything / Refactor

Refactor

refactor

Great Reads

by Chris_Green
I was fortunate enough to have the opportunity to attend the Software Architect Conference this year in London.  This is the same group which puts on DevWeek.  It was short and sweet, just 2 days without the additional sessions before and after.
by Fiyaz Hasan
Just like financial debt estimation, technical debt can also be estimated. Know more about this metaphor developed by Ward Cunningham and how the estimation can be done though NDepend's smart technical debt estimation feature.
by Dev Leader
A beginner's guide to Façade pattern
by Kunal Chowdhury «IN»
How to refactor your code easily using Visual Studio 2012

Latest Articles

by Dev Leader
A beginner's guide to Façade pattern
by Greg Utas
Open-heart surgery on your Big Ball of Mud
by Fiyaz Hasan
Just like financial debt estimation, technical debt can also be estimated. Know more about this metaphor developed by Ward Cunningham and how the estimation can be done though NDepend's smart technical debt estimation feature.
by debashishPaul
A tip for getting the most out of your refactoring practice

All Articles

Sort by Score

Refactor 

21 Nov 2012 by Chris_Green
I was fortunate enough to have the opportunity to attend the Software Architect Conference this year in London.  This is the same group which puts on DevWeek.  It was short and sweet, just 2 days without the additional sessions before and after.
20 Jan 2015 by User 59241
Here is an explanation of "feature envy":http://sourcemaking.com/refactoring/feature-envy[^]and here:http://eclipse-metrics.sourceforge.net/descriptions/pages/FeatureEnvy.html[^]And here "code smell"http://en.wikipedia.org/wiki/Code_smell[^]As Andreas has pointed out it breaks...
14 Apr 2013 by Sergey Alexandrovich Kryukov
Yes, this is achievable, but this is quite a big work. Reflection won't help much, because it works with compiled assemblies or assemblies created during runtime, but refactoring has to work with source code.Is there available classes? It actually depends on available compilers. There are...
26 Jan 2015 by Pascal-78
You have to obfuscate it...basically, this operation will not prevent decompile, but the decompilation process will generate something more confusing, without the same name of methods, members, classes...Visual Studio came with a third party program called Dotfuscator community...
2 Sep 2012 by springjazzy
Good day!Could you guide me where should I start searches on such issue. We have a huge amount of WinForms code using some Custom DropDown control(let's say UltraDropDown). Mostly its in InitializeComponent method. I need to change type of that control to let's say DevDropDown. That two...
2 Sep 2012 by Mehdi Gholam
No tool will help you here other than a find/replace with a lot of time changing property names by hand.One possibility is to create a wrapper for DevDropDown to make it look like UltraDropDown ( properties you have used) and plugin that into your source [this may not be possible if the...
6 Nov 2012 by TorstenH.
OKOK. This is basically more text format thingy. You need to parse the text depending on patterns.http://docs.oracle.com/javase/tutorial/java/data/comparestrings.html[^]EDIT: I found a link that describes a technique on how to do that:http://www.rgagnon.com/javadetails/java-0420.html[^]
14 Apr 2013 by Bhavin Jagad
Hi All, I have 300 files which having different namespaces,classes etc. Using System.Reflection I made a list of namespaces, classes, classes' data members ,property and methods list. I need to change name of all namespaces, classes, classes' members, methods and properties names. I...
14 May 2013 by User 4923751
Hi,I have started a c# project to develop an easy board game as a hobby and since there is no pressure I try to improve its design based on the Object Oriented logic. The primary reason is to further develop myself as a programmer and share my thoughts with the community as food for...
14 May 2013 by Sergey Alexandrovich Kryukov
I have just one but big idea: your badly overuse (abuse) the designer. If you get rid of it, it will solve all your problems with this code.It gives you a lot of manual unsupportable tedious work. (Do you understand that "manual" programming in code means high reuse and intellectual...
12 Sep 2013 by J Melkerson
The following snippet of code contains two nested try blocks that try to find information in table "a", and if that fails, tries to find the same info in table "b". The two 'try's are identical except for the table that is queried and the value assigned to 'whereFound'. I know I need to...
20 Sep 2013 by OriginalGriff
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...A very quick search gave over 3,000,000 hits : Google[^]The top hit is wikipedia: http://en.wikipedia.org/wiki/Code_refactoring[^] which covers it well.In future,...
18 Jul 2014 by Boltyk
I have a summary objects, who's responsibilities actually to combine a lot of things together and create a summary report.In this objects I have a lot of structures like this:public class SummaryVisit : Visit, IMappable{ public int SummaryId { get; set; } public int...
7 Dec 2016 by Er. Dinesh Sharma
Hi Experts,Please help me to find the proper way to remove the switch statement when a Interface is implement by number of classes.e.gpublic enum TestClass { Test1, Test2, Test3, Test4 } public interface ITest { void...
7 Dec 2016 by Midi_Mick
I'd be tempted to remove the enumeration altogether, and use generics.public class Test where T: ITest, new() { public ITest GetObject() { return new T(); }}or, if it suits your style a bit better, take the generic away from the class Test, and just apply it to the...
22 Mar 2017 by Fiyaz Hasan
Just like financial debt estimation, technical debt can also be estimated. Know more about this metaphor developed by Ward Cunningham and how the estimation can be done though NDepend's smart technical debt estimation feature.
22 Jan 2018 by CHill60
We don't do your homework or exercises for you - exercises are set to help you learn and to cement that new knowledge into your brain. So if we just gave you all the suggestions then we would be doing you a disfavour. You already have some suggestions that you haven't applied yet: Quote: move...
3 Apr 2018 by Member 13751131
I'm using a Mac osx. I know that this code in the terminal will replace all txt files that include "hello" with "hiThere" in the folder named "world": perl -pi -w -e 's/hello/hiThere/g;' ~/Desktop/world/*.txt But inside that world folder there are other folders which have other txt files...
7 Nov 2020 by codebeginer501
i am required to provide a redesign and refactoring of the classes that provides maximum reusability, extensibility and eliminates as many dependencies as possible in the class Alpha. i am free to change any of the classes in any way i wish,...
7 Nov 2020 by Richard MacCutchan
See Trail: Learning the Java Language (The Java™ Tutorials)[^].
16 Dec 2021 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
16 Dec 2021 by Richard MacCutchan
See Lesson: Classes and Objects (The Java™ Tutorials > Learning the Java Language)[^].
29 Jun 2012 by Kunal Chowdhury «IN»
How to refactor your code easily using Visual Studio 2012
4 Mar 2022 by Greg Utas
Open-heart surgery on your Big Ball of Mud
23 Apr 2013 by Jon Woo
I am writing this article to demonstrate how to build an application from scratch using SOLID principles and common design patterns
6 Mar 2015 by Chris_Riley
Klocwork is kind of like my code spell check, or professional editor. It just makes me sound good. And if I were part of a larger dev team it would be quite a powerful management tool.
16 Nov 2013 by Dev Leader
An example in refactoring code.
18 Apr 2016 by debashishPaul
A tip for getting the most out of your refactoring practice
23 Jul 2015 by xszaboj
Refactoring Real World Application
20 Jan 2015 by Andreas Gieriet
See What is a "feature envy" code and why is it considered a code smell?[^]: [...] because it breaks encapsulation. [...]CheersAndi
20 Sep 2015 by Robert Hoffmann
Finds unused files and images in your website projects.
6 Nov 2012 by AllainLG
Hi, I can't figure out, how to use getDeclaredMethods() (reflection) if the user chooses the file from GUI.Something like this:Class inclass= Class.forName("ClassName");Method[] methods = inclass.getDeclaredMethods(); But I don't know "ClassName", I get it later.I'd like to get...
21 Sep 2013 by Richard MacCutchan
Yes there are some differences and Microsoft will probably have information about it on their Visual Studio pages.
26 Jan 2015 by Member 10377426
How i make my Assembly or DLL or application no one can refactoring it !! ??i found IL Spy here in codeproject it's awesome project... but how i prevent it or any other refactoring tools for refactoring my applications ??That's bullsh*ts every app i open with refactory it decompile it...
20 Jan 2015 by Naser Hassan
Why is "feature envy" considered as a code smell? What problems does it create when we have feature envy in our code base?
20 Sep 2013 by codestar007
Hi allPlease can anyone tell me that is there any difference between Refactor options in VS 2010 and VS 2012I saw articles in CP with both the version.Is there any difference..??
22 Jan 2018 by arnold lans
Hi Can some one suggest me the Refactoring for the below code as I am looking for how to approach to fix this bad code as an exercise. public class OrderManager { private readonly IOrderStore orderStore; public OrderManager(IOrderStore orderStore) { ...
19 Dec 2021 by Zhobk
public classffdgd { public String osdfwnerName = “CzzIUsgdz"; public String szbrand; public int zsuzsrrentSzspeed; pritate vosid sdzgccgzdelezgrate(int speed) { ... } pritate void fsdfecelgdesrate(int speed) { ... } pritate void...
18 May 2013 by User 4923751
Many thanks to Sergey Alexandrovich for the ideas that helped me improve/refactor the crappy code.The main aspect is "not to use the designer" or "not to abuse the designer". I have manually created arrays of controls instead of using the designer and put them into containers. I also added...
11 Oct 2018 by Member 14015905
format = $format; } public function getBooksByAuthor($authorName, $limit = 10) { $return = []; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,...