Refactoring

Refactor code to improve maintainability by consolidating redundant logic and applying DRY principles

majiayu000 1e8c543 2 files · 1.1 KB Updated 567 repo stars

File contents

Refactoring

冗長なロジックや重複している箇所を集約したりすることで保守性を上げる。

Stragegy

  • Check whether the logic can be erased by consolidating into Schema
  • Test first. Before starting implementation, check the current tests for the target method cover the all pattern.

Points of view

The following rules are listed by the order of priorities.

  • Is the code in the right place from a DDD perspective?
  • Is it possible to remove the logic by changing the schema itself?
  • Isn't it against DRY?
  • Is it possible to write code with better visibility by cutting it out into a separate method?
  • Can loop be improved more? (O(n) > O(n^2) > O(2^n) > O(n!))

majiayu000/claude-skill-registry-data/tree/main/development/refactoring-uuta-dotfiles commit 1e8c543f50

Frequently asked questions

npx skillmds add majiayu000/refactoring-3