Refactoring 003 - Extract Constant
You need to use some values explaining their meaning and origin

I’m a senior software engineer loving clean code, and declarative designs. S.O.L.I.D. and agile methodologies fan.
Search for a command to run...
You need to use some values explaining their meaning and origin

I’m a senior software engineer loving clean code, and declarative designs. S.O.L.I.D. and agile methodologies fan.
Excellent article!
Nice one Maxi Contieri
Different stages need different brains.

One Second Brain doesn't scale past one skull.

Style errors double when nobody enforces them.

Know who speaks before the skill runs TL;DR: Always define a clear role at the top of every skill file so you know whose perspective drives the execution. Common Mistake ❌ You write a skill full of

Everyone is talking about Loop Engineering. Apparently, you don't need to program anymore. TL;DR: Loop Engineering is the hottest AI workflow pattern of 2026. But it hides a dirty secret. The Tweet

TL;DR: Name all your magic numbers
Readability
Complexity
Code Reuse
Move the constant code fragment to a constant declaration
Replace the values with a reference to the constant.
double energy(double mass) {
return mass * 300.000 ^ 2;
}
// 1. Move the constant code fragment to a constant declaration
final double LIGHT_SPEED = 300.000;
double energy(double mass) {
// 2. Replace the old code with a reference to the constant.
return mass * LIGHT_SPEED ^ 2;
}
[X] Automatic
Many IDEs support this safe refactoring
Constant names add meaning to our code.
Magic numbers are difficult to understand and change.
Code must be as declarative as possible.
This article is part of the Refactoring Series.