Quantcast
Channel: refactoring Archives - XP123
Browsing latest articles
Browse All 36 View Live

Image may be NSFW.
Clik here to view.

Wrapping a Type, All the Way

Sometimes you want to change from using a basic type (such as Int or String) to a type that contains the basic type as a value. (See Refactoring in the References.) The change itself isn’t hard, but...

View Article


Image may be NSFW.
Clik here to view.

Nested Loops to Functional Pipeline

Nested structures are challenging to read; a pipeline is usually easier to read and think about. Nested structures have that “arrow of doom” feeling, where you work your way in multiple levels then...

View Article


Image may be NSFW.
Clik here to view.

Refactoring: Forcing the Right Extract Method

Automated refactoring tools are great, but sometimes the tool doesn’t make the best choice. We can often nudge the tool to a better choice. Why Bother? Why bother nudging? Couldn’t you do the...

View Article

Extracting Parameterized Unit Tests

Duplication across tests may not be as harmful as duplication in production code, but a parameterized unit test can reduce duplication and help us create better tests. Judging Tests – The Pause...

View Article

Image may be NSFW.
Clik here to view.

Lambda for Control Structures, a Refactoring

Several mainstream languages have added better support for lambda expressions (including lighter syntax) in the last few years. This can let you define new forms of control structures, and reduce...

View Article


Image may be NSFW.
Clik here to view.

Lambda to Reduce Coupling

Coupling occurs when one part of a system depends on another part. That is, if one part changes, the other must be adjusted too. Lambda expressions can reduce coupling by needing to refer to fewer...

View Article

Image may be NSFW.
Clik here to view.

Refactoring and Programming Language Semantics

Refactoring improves the design of code without changing its observable behavior. But what is observable behavior? We’ll look at how language semantics affect that. When you devise new refactorings,...

View Article

Loop Unrolling: While ⇒ If-While

Loop unrolling is a performance optimization where you repeat the inside of a loop to reduce the looping overhead. It’s also a way to get rid of loops, and we’ll look at an example from a test. While...

View Article


Image may be NSFW.
Clik here to view.

2021 Articles in Review

Here are the the articles and videos I made last year. Key topics: user stories, refactoring, TDD, functional languages, and design. I’ve grouped them into these areas: User...

View Article


Refactoring, a Whole-Team Guide

A one-page summary of Refactoring is available in PDF. Refactoring is…? Changing the design of existing code without changing its observable behavior (per Martin Fowler). These changes include...

View Article
Browsing latest articles
Browse All 36 View Live