DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
11 Monitoring and Observability Tools for 2023
Learn more
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Refactoring Spikes as a Learning Tool and How a Scheduled Git Reset Can Help

Refactoring Spikes as a Learning Tool and How a Scheduled Git Reset Can Help

Jakub Holý user avatar by
Jakub Holý
·
Nov. 25, 11 · Interview
Like (0)
Save
Tweet
Share
3.86K Views

Join the DZone community and get the full member experience.

Join For Free

to learn how complex your code base really is and how much effort a particular refactoring might require compared to the initial expectations, follow these steps:

  1. schedule git reset --hard; git clean -fd to run in 1 hour (e.g. via cron)
  2. do the refactoring
  3. “ wt*?! all my changes disappeared?! ” – this experience indicates the end of the refactoring :-)
  4. go for a walk or something and think about what you have learned about the code, its complexity, the refactoring
  5. repeat regularly, f. ex. once every week or two – thus you’ll improve your ability to direct the refactoring so that you learn as much as possible during the short time

the exercise has been recommended by kent beck, i’ve just added the scheduled reset because my discipline is not strong enough to resist the likely urge to continue “just little further” and to keep the code if it looks any good. (if i become absorbed in the refactoring so much that i’ll forget to stop on time then i’ll surely also forget about the reset and thus the tendency to just cancel it won’t stand a chance.)

notice that if you do any larger-scale refactoring, it might be pretty wise to apply the mikado method to help you keep track of where you are going and where you are while also keeping your buildable.

when i get to try this out i might write about my experiences here as well.

from http://theholyjava.wordpress.com/2011/11/21/refactoring-spikes-as-a-learning-tool-and-how-a-scheduled-git-reset-can-help/

Reset (computing) Git

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • gRPC on the Client Side
  • Build an Automated Testing Pipeline With GitLab CI/CD and Selenium Grid
  • Fixing Bottlenecks in Your Microservices App Flows
  • How To Create a Failover Client Using the Hazelcast Viridian Serverless

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: