Tag

refactoring

1 views collected around this technical thread.

php中文网 Courses
php中文网 Courses
Jun 13, 2025 · Backend Development

How to Transform Legacy PHP Code into a Clean, Testable Architecture

Legacy PHP applications often suffer from spaghetti code, global state abuse, mixed concerns, and lack of tests; this guide outlines a step‑by‑step refactoring strategy—adding a testing safety net, introducing dependency injection, separating concerns with MVC/DDD, adopting repository patterns, and leveraging modern tools like Composer and PHPStan—to evolve them into maintainable, testable, and scalable backend systems.

DDDPHPbackend development
0 likes · 6 min read
How to Transform Legacy PHP Code into a Clean, Testable Architecture
Java Captain
Java Captain
Jun 12, 2025 · Backend Development

12 Toxic Coding Habits That Destroy Readability (And How to Avoid Them)

The article humorously chronicles twelve common anti‑patterns—such as over‑splitting microservices, writing massive methods, deep nesting, random naming, misleading comments, copy‑pasting code, ignoring design docs, and avoiding logging—that severely hurt code readability and maintainability, and explains why they should be avoided.

Code readabilityMicroservicesbad coding practices
0 likes · 10 min read
12 Toxic Coding Habits That Destroy Readability (And How to Avoid Them)
Top Architect
Top Architect
Jun 11, 2025 · Backend Development

How I Refactored a Bloated Open‑Source Admin into a Lean Backend Solution

The author shares a personal journey from early backend work to full‑stack responsibilities, critiques heavyweight admin frameworks, and explains how they rebuilt a lightweight enterprise admin using MyBatisPlus, Lombok, and streamlined architecture, while outlining future enhancements such as email, payment, multi‑tenant, and distributed scheduling.

JavaLombokMyBatisPlus
0 likes · 9 min read
How I Refactored a Bloated Open‑Source Admin into a Lean Backend Solution
Java Tech Enthusiast
Java Tech Enthusiast
May 26, 2025 · Fundamentals

Push Ifs Up, Push Fors Down: Improving Code Clarity and Performance

The article explains Alex Kladov’s two simple yet powerful rules—moving conditional checks out of functions and pushing loop bodies down—to reduce duplicated checks, simplify control flow, and boost performance, especially in batch‑processing scenarios.

Best PracticesPerformanceRust
0 likes · 7 min read
Push Ifs Up, Push Fors Down: Improving Code Clarity and Performance
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 18, 2025 · Fundamentals

Strategy Design Pattern in Java: Definition, Structure, Example, and Refactoring

This article explains the behavioral Strategy design pattern, describes its definition and structure, demonstrates a real‑world e‑commerce discount scenario with both a tangled if‑else implementation and a clean refactoring using Java interfaces, concrete strategy classes, a context, and a client, and finally discusses its advantages and drawbacks.

JavaStrategy Patterndesign patterns
0 likes · 9 min read
Strategy Design Pattern in Java: Definition, Structure, Example, and Refactoring
Code Mala Tang
Code Mala Tang
May 3, 2025 · Frontend Development

How Top Engineers Refactor Complex Conditional Logic for Cleaner Code

This article examines why developers often over‑nest and misuse conditional statements, then presents proven techniques—early returns, lookup objects, optional chaining, guard clauses, and state machines—to simplify, improve readability, and make conditional logic more maintainable and scalable.

Best PracticesCode readabilityJavaScript
0 likes · 8 min read
How Top Engineers Refactor Complex Conditional Logic for Cleaner Code
Selected Java Interview Questions
Selected Java Interview Questions
Apr 21, 2025 · Backend Development

Refactoring Long if...else Chains in Java Backend Services

This article explains why lengthy if...else statements in a Java payment service violate design principles and demonstrates several backend‑focused refactoring techniques—annotation binding, dynamic bean naming, template methods, strategy‑factory, and chain‑of‑responsibility—to replace the conditional logic with clean, extensible patterns.

JavaSpringbackend
0 likes · 14 min read
Refactoring Long if...else Chains in Java Backend Services
macrozheng
macrozheng
Apr 9, 2025 · Fundamentals

Why Clean Code Matters: Practical Tips for Naming, Classes, Functions & Testing

This article explains why clean code is essential for productivity and team collaboration, outlines concrete guidelines for meaningful naming, single‑responsibility classes, concise functions, and effective testing, and shows how tools and refactoring can help maintain high code quality.

Best PracticesNaming Conventionsclean code
0 likes · 14 min read
Why Clean Code Matters: Practical Tips for Naming, Classes, Functions & Testing
Selected Java Interview Questions
Selected Java Interview Questions
Apr 3, 2025 · Fundamentals

How to Write Clean and Maintainable Code: Naming, Classes, Functions, and Testing

This article explains why clean code is essential for team development and provides practical guidelines on naming, class design, function composition, and testing—including SOLID principles, meaningful identifiers, single‑responsibility classes, short functions, and test‑driven development—to improve readability, extensibility, and overall software quality.

Naming Conventionsclean coderefactoring
0 likes · 19 min read
How to Write Clean and Maintainable Code: Naming, Classes, Functions, and Testing
Efficient Ops
Efficient Ops
Feb 19, 2025 · Fundamentals

Why Do Some Messy Codebases Remain Surprisingly Stable?

The article explores how heavily indebted, poorly designed code—often called a “shit mountain”—can stay stable over time thanks to accumulated technical debt, rigorous testing processes, and continuous maintenance, while highlighting the risks of refactoring or adding new features.

Technical Debtcode stabilityrefactoring
0 likes · 6 min read
Why Do Some Messy Codebases Remain Surprisingly Stable?
JD Tech Talk
JD Tech Talk
Feb 19, 2025 · Frontend Development

From Monolith to Micro‑Frontend: The Evolution and Refactoring of the Xingyun Frontend Platform

This article recounts the architectural challenges of the Xingyun 2.0 frontend platform, explains why its monolithic codebase and build process became unsustainable, and details the step‑by‑step migration to a modular monorepo with micro‑frontend, Nx, pnpm, and Tailwind to improve scalability, maintainability, and developer productivity.

MonorepoNxVue
0 likes · 17 min read
From Monolith to Micro‑Frontend: The Evolution and Refactoring of the Xingyun Frontend Platform
Code Mala Tang
Code Mala Tang
Jan 27, 2025 · Fundamentals

How to Refactor Flag‑Heavy Python Functions for Cleaner, Scalable Code

This article examines a Python function overloaded with flags, explains why such design harms readability, testability, and extensibility, and demonstrates step‑by‑step refactoring using descriptive helper functions, a pipeline approach, flexible step lists, and type annotations to produce clean, maintainable code.

Pythoncode qualitypipeline
0 likes · 5 min read
How to Refactor Flag‑Heavy Python Functions for Cleaner, Scalable Code
Architect
Architect
Jan 22, 2025 · Frontend Development

Refactoring the External Product Detail Page: SSR Migration, Request Interceptor and Tracking Hook Redesign

This article details the complete redesign of the external product detail page, replacing the uni‑app SPA with a source‑build SSR solution, introducing a split‑first‑screen data strategy, multi‑environment support, risk‑controlled fallback mechanisms, and targeted refactors of request interceptors and tracking hooks, resulting in significant performance and business metric improvements.

PerformanceSSRfrontend
0 likes · 17 min read
Refactoring the External Product Detail Page: SSR Migration, Request Interceptor and Tracking Hook Redesign
DaTaobao Tech
DaTaobao Tech
Jan 20, 2025 · Fundamentals

Cyclomatic Complexity Management via Function Extraction

The article explains that cyclomatic complexity harms code quality and testability, and shows how using IDEA’s CodeMetrics plugin together with purposeful function extraction—splitting long, complex, or duplicated code into well‑named, reusable methods—reduces complexity, improves readability, and supports maintainable, testable software.

code qualitycyclomatic complexityfunction extraction
0 likes · 10 min read
Cyclomatic Complexity Management via Function Extraction
JD Retail Technology
JD Retail Technology
Jan 10, 2025 · Fundamentals

Clean Code: Principles and Practices for Writing Maintainable Software

The article argues that clean code—characterized by readable naming, minimal comments, short single‑purpose functions, simple control flow, and well‑encapsulated classes—is essential for maintainable software, contrasting it with design patterns and architecture, and demonstrates its benefits through practical refactoring examples and a real‑world case study.

Best Practicesclean codecode quality
0 likes · 20 min read
Clean Code: Principles and Practices for Writing Maintainable Software
Tencent Cloud Developer
Tencent Cloud Developer
Jan 2, 2025 · Backend Development

Rewriting the News Plugin Integration Layer: Design, Benefits, and Refactoring Timing

The article details a nine‑month rewrite of a fragmented 23‑interface news‑plugin integration layer into a single trpc‑go service, showing how unified architecture cut development effort by half, boosted stability above 99.99 %, slashed resource costs, raised test coverage to 66 %, and provides practical criteria for deciding when to refactor.

Case StudyDevOpsPerformance
0 likes · 15 min read
Rewriting the News Plugin Integration Layer: Design, Benefits, and Refactoring Timing
Zhuanzhuan Tech
Zhuanzhuan Tech
Dec 20, 2024 · Backend Development

State Machine Selection and Refactoring Strategies for Complex Business Scenarios

This article analyzes the problem of exploding state‑branch logic in merchant onboarding and exit flows, presents decoupling, design‑pattern, and state‑machine solutions, compares three Java state‑machine implementations (Zhuozhou, Cola, Spring Statemachine), and offers practical selection guidance for simple to highly complex B2B use cases.

JavaState Machinebackend
0 likes · 21 min read
State Machine Selection and Refactoring Strategies for Complex Business Scenarios
Tencent Cloud Developer
Tencent Cloud Developer
Dec 17, 2024 · Fundamentals

38 Practices for Managing Technical Debt and Improving Software Development

The article outlines 38 actionable practices—ranging from treating technical debt like a loan and emphasizing simple, well‑named code to rigorous code reviews, systematic refactoring, comprehensive testing, automation, clear documentation, continuous learning, professional conduct, and solid design principles—to help teams reduce debt, improve quality, and sustain long‑term software health.

Best Practicescode qualitydesign principles
0 likes · 37 min read
38 Practices for Managing Technical Debt and Improving Software Development
JD Tech
JD Tech
Nov 28, 2024 · Fundamentals

Comprehensive Guide to Unit Testing Strategies and Tools for Java Projects

This article presents a detailed, step‑by‑step guide on improving unit test coverage in large Java codebases, covering strategies such as mocking, divide‑and‑conquer, tool‑assisted test generation, reflection‑based coverage, Maven configuration, and practical tips for handling static methods, final classes, and test data replay.

Code CoverageJavaJunit
0 likes · 27 min read
Comprehensive Guide to Unit Testing Strategies and Tools for Java Projects
Zhuanzhuan Tech
Zhuanzhuan Tech
Nov 22, 2024 · Backend Development

Refactoring Practices and Tools for Java Code

This article explains the concept of code refactoring, its goals, timing, challenges, common scenarios, and practical techniques—including parameter extraction, guard clauses, strategy patterns, and IDE tools—providing Java examples and recommendations for improving code quality.

code qualitydesign patternside
0 likes · 23 min read
Refactoring Practices and Tools for Java Code