Pick the refactoring move
Map common code symptoms to small refactoring moves.
Long method: Extract Function or rewrite? Compare Extract one concept before attempting a larger redesign. Which move fits a repeated parameter cluster? Introduce Parameter Object. Use it when the parameters form a cohesive concept, not a vague options bag. Recall A boolean flag is simpler than two functions. Use when doThing(x, true) hides behavior. Your line The flag is compact, but the call site hides intent. Two named functions make the behavior visible where it is used. Do not multiply functions unless the modes are real behaviors. It explains Remove Flag Argument through reader value. Which move fits a meaningful…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in