DZone
Agile Zone
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
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Agile Zone > Temporary Refactoring and Improving Your Code Reading Skills

Temporary Refactoring and Improving Your Code Reading Skills

A developer discusses technique he learned from a colleague in which he temporarily refactors code in order to better understand what another dev has done.

A N M Bazlur Rahman user avatar by
A N M Bazlur Rahman
·
Oct. 01, 17 · Agile Zone · Opinion
Like (5)
Save
Tweet
5.44K Views

Join the DZone community and get the full member experience.

Join For Free

I was talking to a friend of mine, Scott, over Slack about reading code! Specifically, how to improve your code reading skills.

I asked him what he usually does when he reads source code. What he said is interesting:

He does a temporary refactoring. That’s it.

He usually takes a long method that can be separated out and then he turns it into a separate method.

For example-  readEmployeeDataFromDatabase()

This method can be broken into multiple methods and he does that. He keeps doing that until he gets a sense for what the intent of the larger method is about. Then he takes a few notes on what the method does and rolls back the changes.

He also mentioned that he does not do any unit testing because this refactoring is only temporary, and used just to understand the code!

I believe this could be a great way towards improving code reading skills. Although what he suggested isn’t really true refactoring, it can help you to understand the code you are reading.

Published at DZone with permission of A N M Bazlur Rahman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How to Determine if Microservices Architecture Is Right for Your Business
  • Refactoring Java Application: Object-Oriented And Functional Approaches
  • How to Leverage Method Chaining To Add Smart Message Routing in Java
  • Modern REST API Design Principles and Rules

Comments

Agile Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • 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:

DZone.com is powered by 

AnswerHub logo