Study with me for Code Refactoring ( Story1 — Introduction)

Refactoring the design ( crd image to Al Power™)

Refactoring is the process of restructuring code, not changing its original functionality. The primary purpose is

  • To improve Software design, structure, and code readability

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” — Martin Fowler (1999)

I am a fool but now I try to be a good developer. We already know this about already but we miss and forget to apply it to refactor the codes when facing business pressure, strict project timelines, etc...

Refactoring is not adding a new feature.

Refactoring is not fixing a bug.

Refactoring is not optimization.

Refactoring is making a series of small structural changes to improve the readability and maintainability of software without modifying existing behavior.

Let’s study with me from Refactoring Guru about Refactoring code

Clean Code

Every developer was talking about clean code. So, what is Clean Code? Clean-Code can be understood easily — by everyone on the team and then

With understandability comes readability, changeability, extensibility, and maintainability. Some of its features are —

  1. Clean code is easy to see other Developers

Technical Debt

Cause of technical debt are

  1. Business pressure

When to refactor

He said it is time to refactor when getting the rule of three

  1. First time — get it done don’t think about it

and then

  1. When adding features — Please refactor when you just finished the checkpoint. This is my bad habit and I am doing right now refactoring when I finish my implementation code like after implementing end to end UI screen

Checklist of refactoring right away

  • Ensure the code should become cleaner, and more readable when after refactoring

This is the end of the study with me for refactoring the introduction. Next time we will study for code smell. Please give feedback or opinions and tell me when I was wrong.

See you next time bye bye👋

--

--

Mobile Developer- Android @ Seven peaks Company

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store