xp1632 / DFKI_working_log

0 stars 0 forks source link

All about Refactoring #39

Open xp1632 opened 3 months ago

xp1632 commented 3 months ago

Basic definition in Refactoring

Clean Code:

xp1632 commented 3 months ago

Technical debt:


Cause and Harm

- Hard to divide and conqure

- Lack of tests before launching - Lack of documentation

- Long-term simultaneous development in several branches

xp1632 commented 3 months ago

When to refactor:


How to refactor- Checklist

xp1632 commented 3 months ago

Smell bad code:



How to extract method:

image


xp1632 commented 3 months ago
xp1632 commented 3 months ago

Creational Patterns:


!!! Structural Design Patterns:

!!! very important

image

image

image


Adapter/Wrapper:

image

image

xp1632 commented 3 months ago

Refactoring Methods

image


image https://refactoring.guru/pull-up-field


image

https://refactoring.guru/substitute-algorithm


image https://refactoring.guru/consolidate-conditional-expression

xp1632 commented 3 months ago

Problematic Code:

image https://refactoring.guru/smells/dead-code


image https://refactoring.guru/smells/duplicate-code image


image https://refactoring.guru/smells/divergent-change image


image https://refactoring.guru/smells/inappropriate-intimacy

image


image https://refactoring.guru/smells/speculative-generality