1 / 6

Refactoring Towards Sanity

Refactoring is essential for maintaining and improving code quality, enabling faster feature addition and bug fixing. This guide delves into when and what to refactor, addressing both minimal and maximal approaches. It discusses the challenges of large rewrites versus incremental improvements, emphasizing practical strategies like sprouting and wrapping code. Real-world examples, particularly in real estate conveyancing, illustrate these concepts, highlighting the need for standardization across various requirements. For deeper insights, explore the recommended readings by Joshua Kerievsky and Michael Feathers.

kizzy
Télécharger la présentation

Refactoring Towards Sanity

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Refactoring Towards Sanity Robert Reppel ( Sample code is at http://robertblogs.wordpress.com/ )

  2. Why Refactor? • To get better at fixing bugs • To be able to add new features faster. • (Arguably) there is no other reason …. ( Sample code is at http://robertblogs.wordpress.com/ )

  3. What to Refactor • The minimum we can get away with. • The maximum we can sell to The Man. (???) • “The Big Re-Write” is: • Frustrating (for the business) • Not always better than the original (???)

  4. What We’ll Do • Sprout • Wrap • Refactor “When you need to add a new feature to a system and it can be formulated completely as new code, write it in a new method …. At least write tests for the new code … ” -- Michael Feathers … and writing tests, of course …

  5. Real – World Sprout: • Real Estate Conveyancing • Letters for lawyers, etc. need to contain standard phrases for deposit trust amounts, etc. • Different provinces, different conveyancing methods, different requirements. • Letters as Crystal Reports fed by Stored Procedures. (… which contain the business rules … )

  6. Sources / Reading • “Refactoring To Patterns” – Joshua Kerievsky • “Working Effectively With Legacy Code” – Michael Feathers @robertreppel robertblogs.wordpress.com

More Related