
Refactoring: clean your code
Refactoring is the controllable process of systematically improving your code without writing new functionality. The goal of refactoring is to pay off technical debt. The mantra of refactoring is clean code and simple design.
Refactoring and Design Patterns
Refactoring is a controllable process of improving code without creating new functionality. Design Patterns are typical solutions to the commonly occurring problems in software design.
Clean code - Refactoring.Guru
The main purpose of refactoring is to fight technical debt. It transforms a mess into clean code and simple design. Nice! But what’s clean code, anyway? Here are some of its features: Clean code is obvious for other programmers. And I’m not talking about super sophisticated algorithms.
How to refactor
Refactoring should be done as a series of small changes, each of which makes the existing code slightly better while still leaving the program in working order. Checklist of refactoring done right way
Refactoring Techniques
These refactoring techniques show how to safely move functionality between classes, create new classes, and hide implementation details from public access.
Replace Type Code with State/Strategy - SourceMaking
This refactoring technique is a way out of situations when a field with a coded type changes its value during the object’s lifetime. In this case, replacement of the value is made via replacement of the state object to which the original class refers.
Design Patterns - refactoring.guru
Check out our ebook on design patterns and principles. It's available in PDF/ePUB/MOBI formats and includes the archive with code examples in Java, C#, C++, PHP, Python, Ruby, Go, Swift, & TypeScript.
Inline Class - Refactoring.Guru
Try our interactive course on refactoring. It offers a less tedious approach to learning new stuff. Let's see…
Decorator - refactoring.guru
The Component declares the common interface for both wrappers and wrapped objects.. Concrete Component is a class of objects being wrapped. It defines the basic behavior, which can be altered by decorators. The Base Decorator class has a field for referencing a wrapped object. The field’s type should be declared as the component interface so it can contain both concrete …
Does the Singleton really violate the Single Responsibility Principle ...
On the Singleton page, it says:The Singleton pattern solves two problems at the same time, violating the Single Responsibility PrincipleThis view is echoed by the article Why Singletons are Evil, which writes: 2) Singletons allow you to limit creation of your objects.This is true, but now you are mixing two different responsibilities into the same class, which is a violation of the Single ...