CARVIEW |
Select Language
HTTP/2 200
date: Wed, 30 Jul 2025 23:19:03 GMT
content-type: text/html; charset=utf-8
cf-ray: 967894223939c462-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=957ef536-1595-4fd7-b40c-377143cfb9de; expires=Thu, 30 Jul 2026 23:19:02 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: f0c681c6-d1fc-44a9-a3ed-7a7e2a5794a9
x-worker-origin-response-time: 478000000
x-dns-prefetch-control: off
set-cookie: prov=957ef536-1595-4fd7-b40c-377143cfb9de; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=VL7wnoMumO87zQqFCiZzqLCZds8zOicjAF5cQygOqfg-1753917543-1.0.1.1-tg0unfPj.ykdcjbE3tivcYBzHiH7Pr6M2505F95et.7VHBP9FAVPn1ukRdWGYI4SG38yHljlDrBuAziFk01estLoKtPeG2WVrre1PrvWfJs; path=/; expires=Wed, 30-Jul-25 23:49:03 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=_8C9KNUyrBtGCn1116ce8Ccu.bW9G.hrMqWE0tii9Os-1753917543250-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'refactoring' Questions - Software Engineering Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more.
View results.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions tagged [refactoring]
Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.
755 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
8
votes
5
answers
1k
views
Is there a reason "replace conditional with table" isn't a standard refactoring?
I'm preparing a lecture where I will start with a many-branched conditional statement and replace it with a table. For example, I could start with:
function getMonthName(monthNumber) {
if (...
1
vote
1
answer
116
views
I have a system that's part of an event-driven architecture. Need some advice on refactoring
I have a system that was built 5 years ago. It's part of a multi-system event driven architecture. And each system is owned by a different team with varied responsibility.
When the system was ...
2
votes
2
answers
2k
views
Refactoring a legacy codebase with a god Repository and incomplete Clean Architecture
I'm currently working on a large legacy project that tried to implement Clean Architecture combined with MVVM, but unfortunately didn't fully adhere to the principles.
One major problem:
The ...
12
votes
7
answers
963
views
Techniques to do continuous refactoring
I've come to believe that continuous refactoring is a good way to maintain the health of a system that is in continuous development. That is, a system for which new features are always in the pipeline....
4
votes
1
answer
272
views
Refactoring a codebase from manual memory management to RAII
Edit: @Ben Cottrell's comment said this was similar to a question about spaghetti code. While both questions involve large codebases, mine addresses a specific technical pattern: manual memory ...
2
votes
5
answers
2k
views
Rewrite or Transpiler - How to move away from a proprietary SAAS solution
We are using a Software as a Service platform that allows to create custom code which integrates in the platform and all its features (dialogues for common objects like Account, Customer, Address, and ...
3
votes
5
answers
1k
views
What is the root cause of a proliferation of "null checks"?
I work with a lot of Groovy code. One feature of the language is the "safe navigation operator" (?), which I think of as an inline null check. There are many things about Groovy that I like, ...
2
votes
3
answers
2k
views
Is refactoring scattered functions into a class always a good idea?
Straight to the point, here's the original code:
integer = input(...)
size = len(integer)
# Created three dicts for matching numbers as keys to corresponding words
dic_ones = {...}
dic_tens = {...}
...
0
votes
4
answers
253
views
Refactoring the application with correct SemVer approach
Suppose I have an application with version 1.2.3.
If I refactor my application to remove deprecated calls while maintaining the same functionality and API as in version 1.2.3, what version number ...
-1
votes
1
answer
524
views
ReactJS hook vs utility function
Should we use utility functions in react or should everything be components and hooks?
I had this scenario:
Utility function for formatting money.
const formatMoney = (value) => value == null ? '' :...
2
votes
3
answers
212
views
Is it still "feature envy" if the state to make decision or the action to take after asking the state involves other classes to participate?
According to https://softwareengineering.stackexchange.com/a/212130/432039, if a class asks another class for the state, and then call methods of that class, it is called "feature envy", eg:
...
-4
votes
2
answers
112
views
Refactoring the testing code inside a big switch code block
The main logic of my function is a switch case, with the default case being the abnormal case.
function main(input) {
let result = process(input)
switch (result): {
//normal cases
case ...
2
votes
1
answer
150
views
Refactoring Processor classes
I am writing some python 3 bioinformatics software and was wondering about the best way to write it in an OOP format. I am pretty sure a lot of my classes are violating the SRP principle, but I'm not ...
0
votes
1
answer
199
views
Our php codes base has 6 different ways to do INSERT … ON DUPLICATE KEY UPDATE, how do I fix it?
Our php codes base has 6 different ways to do INSERT … ON DUPLICATE KEY UPDATE. It happened over years because the php framework is evolving and my team members come and go, although I won't say we ...
2
votes
1
answer
271
views
To hide side effects or not?
Only loosely related to the title.
In my code I often encounter functions such as this one (e.g. from a pet project – a Discord bot written in Python – but seemingly a ubiquitous and reoccurring issue)...
- The Overflow Blog
-
-
- Upcoming Events
-
2025 Community Moderator Electionends August 13
- Featured on Meta
-
-
-
Related Tags
design × 96
design-patterns × 79
c# × 77
object-oriented × 74
java × 46
unit-testing × 44
c++ × 37
clean-code × 37
architecture × 36
code-quality × 30
php × 30
tdd × 26
maintenance × 25
python × 22
legacy-code × 20
coding-style × 19
legacy × 18
rewrite × 18
testing × 18
project-management × 17
maintainability × 16
code-smell × 15
inheritance × 15
more related tags
Hot Network Questions
- How many possible MD5 hashes are there, 16³²? Or do MD5 checksums have error correction (in which case <16³² possible hashes)?
- Stepping down voltage from Li-ion to simulate 2x AAA batteries
- When using Da Capo, does that normally include a pick up?
- Uniqueness of multiple unnamed namespaces within translation unit
- "One can" in technical writing--good, bad, indifferent?
- Is Samson referred to/mentioned in the siddur/liturgy?
- CCZ magic state teleportation
- Can I bring mycelium pellets into Greenland?
- Shakespearean grammar: "hath" and "has" in the same sentence
- Finite projective plane with trivial automorphism group
- Advantage of launching a rocket from the Equator
- Rim brakes and drop bar brifters
- Puzzlin’ Puzzle
- What are these orange and green solid circles painted on a taxiway?
- An SF novel where a very young child escapes being murdered by hiding in the water tank of a toilet
- How loud were the top-of-the-range propeller aircrafts like the Lockheed Constellation when commercial jet travel appeared?
- Visa Free Transit Facility (VFTF): Indian passport but resident in Saudi Arabia
- Right size rim tape when converting MTB to tubeless
- What does Paul’s mention of 'they that are of Caesar’s household' in Philippians 4:22 reveal about the spread of the gospel within the Roman Empire?
- Taking small amounts till there's nothing left
- Many people, when faced with a statement, exclaim: “PROVE IT!” But are they truly aware of what they’re saying? What is a proof? What does it mean?
- Eye-shaped arrow tip
- Is it commonplace/acceptable for university professors to not teach Evolutionary Biology based on their religious beliefs?
- Finding one non-negative solution to a system of linear equations