How To Approach Refactoring @ YouTube
Nice presentation for refactoring and agile development. Many of the topics may have been discussed in somewhere, but this type of passionate and insightful presentation works well.
Refactoring or any types of refinements involves certain efforts. As discussed in the presentation, small iterative steps of code improvement would be required, rather than a large “refactoring” which can be taken as “throwing away” the chunk of codes without adding new features.
Good programmers follow decent habits on a daily basis. It’s not about the fancy techniques or “clever” codes. Simple and clean designs are good for any kinds of artifacts. Software, hardware, documents and any kind of them requires artistic sense for refining them. Especially, software development is often described as an art, and simple and beautiful codes are advocated. An artifact becomes complete when nothing can be taken further out of it. It’s not when everything is added. Redundancy or duplication can ruin its beauty.
- Agile: Code quality matters, in order to be agile, and in order to quickly respond to the change.
- Clever Code: Don’t write a clever code. It causes troubles. Make the code simple and clear. Your code should do just one thing well. One important indicator is having the single level of abstraction in one method.
- Dependency: Remove dependency before trying to invert the dependency, etc. Instead of mocking, knockout the dependency.
- Comments: Good code is self documenting. Try to avoid using comments. Commenting is redundant and it’s like explaining a joke. Working tests (examples) worth 1000 comments.
- Code Smell: One good metaphor of “code-smell is evil” is coming from the physical smell. After certain time, you can easily get accustomed to it, and becomes unable to feel it anymore.