Search
Close this search box.
Search
Close this search box.
Search
Close this search box.

Time To Reorg – An Intro to Refactoring

Facebook
Twitter
LinkedIn
Pinterest
WhatsApp

Organizations reorg all the time. And again. Why do they do that? Setting cynicism aside, organizations reorg to adapt to new realities, to new demands. A team of 5 people that grew to 20 people needs to split to smaller teams. A business group dealing with a fast-growing market needs to come up with a new strategy to cope with the demand. A startup of 20 people will need a different structure than that of a company of 100 people. As business demands change there is a need to adapt the organization’s structure.

Reorg is an expensive venture, yet organizations do it again and again. Because they have to do it – they have no choice.

In a similar manner, the codebase of a product needs to be reorganized again and again to adapt to changing circumstances. A class that has more and more methods needs to split into smaller classes, otherwise, it will be very difficult to maintain it. A conditional (If-Else statement) that grew up to a monster needs to be shrunk again, otherwise, it will be prone to defects. A once simple interface that grew and expanded needs to have some wrapper to make clients’ work bearable.

In fact, taking a hike on Conway’s Law it makes sense that refactoring will somehow be related to reorg, at least in the sense that a change in the organization structure is related to adaptations in the codebase.

We call the process of adapting the codebase “refactoring” – changing the structure of the code not to get new functionality but to make the code better adapted to our new demands, business and technical alike.

Unlike reorgs, refactoring is part of the ongoing work of every developer. Every time a developer is handling code she needs to think about whether she should change the structure of this code. Should the method be renamed? Should a new interface be extracted? Should she replace the conditional with subclasses?

Just like dev doesn’t work without test, dev and test don’t work without refactoring. There are many cases where refactoring is a key player in making the code testable (but I’ll write about it some other time).

I’ve never been in a scouts’ camp but I hear they’re supposed to leave it in better shape than they found it. In the same spirit, a developer should leave the code in a cleaner state than she found it.

Two issues immediately arise, though: First, refactoring takes time. Correct. Reorgs also take time, yet we do them. Refactoring takes less time and provides faster results.

The second issue is that constant refactoring will make the system change all the time. Changing names, changing structure. Won’t that be counterproductive? Won’t that inhibit maintenance? “I’m used to looking for method err4get and now someone renamed it”. The idea is that refactoring should make the system more maintainable. If it makes it less maintainable – don’t do it. Names should be clearer, the structure should be easier to understand, and easier to test and change. Getting into a state of mind that we’re not afraid to make changes in our code is a healthy thing.

Every time your organization goes through another reorg you should ask yourself when did you invest such efforts in your codebase. Codebase reorg should happen all the time, on small scale, getting the code ready for the coming business challenges.

Subscribe for Email Updates:

Categories:

Tags:

Agile Community
SAFe DevOps
Introduction to Test Driven Development
Scrum Master Role
Agile Techniques
Kaizen Workshop
RTE
Lean Budgeting
Product Management
Legacy Code
Slides
Continuous Improvement
Certified SAFe
ARTs
Jira Cloud
Agile
Continuous Delivery
Planning
Lean Agile Organization
lean agile change management
Built-In Quality
Self-organization
Rapid RTC
ART Success
BDD
Applying Agile Methodology
Portfolio for Jira
Continuous Integration
Keith Sawyer
speed at scale
QA
Scrum.org
Advanced Roadmaps
Presentation
Tools
Sprint Planning
Jira Plans
AI Artificial Intelligence
Agile Games
Lean and Agile Techniques
Agile Testing Practices
Business Agility
System Team
Kanban Game
Scaled Agile Framework
Nexus and Kanban
Lean Startup
User stories
Scrum and XP
LPM
Lean and Agile Principles and Practices
PI Objectives
Agile Basics
Legacy Enterprise
Agile and DevOps Journey
TDD
Agile Contracts Best Practices
Kanban Basics
Amdocs
Agile Games and Exercises
Operational Value Stream
Artificial Intelligence
Agile Israel
Sprint Iteration
Acceptance Test-Driven Development
Atlassian
Program Increment
Software Development Estimation
Process Improvement
Large Scale Scrum
ALM Tools
What Is Kanban
Agile Mindset
Coaching Agile Teams
ATDD vs. BDD
Principles of Lean-Agile Leadership
Spotify
Implementing SAFe
Webinar
LeSS
Agile Release Planning
Development Value Streams
Agile Risk Management
The Kanban Method
SAFe Release Planning
System Integration Environments
POPM
Nexus
Implementation of Lean and Agile
RTE Role
AI
Reading List
speed @ scale
Managing Risk on Agile Projects
Release Train Engineer
Continuous Planning
LAB
Scrum Primer
Scrum With Kanban
Agile Outsourcing
Elastic Leadership
Systems Thinking
transformation
PI Planning
Agile Marketing
Product Ownership
Agile Delivery
IT Operations
Lean Software Development
Enterprise DevOps
Team Flow
Releases Using Lean
Jira admin
Test Driven Development
Daily Scrum
Change Management
Frameworks
Risk Management in Kanban
Entrepreneurial Operating System®
Scrum Values
Agility
RSA
Lean-Agile Budgeting
predictability
The Agile Coach
ATDD
An Appreciative Retrospective
Retrospectives
Lean Agile Management
Accelerate Value Delivery At Scale
System Archetypes
Software Development
Risk Management on Agile Projects
Certification
Managing Projects
Agile Development
Effective Agile Retrospectives
Kaizen
ROI
Video
Agile in the Enterprise
Quality Assurance
Risk-aware Product Development
Agile Release Management
Lean-Agile Software Development
Scrum Master
Agile for Embedded Systems
Pomodoro Technique
Kanban
AgileSparks
Professional Scrum Master
Sprint Retrospectives
Agile Product Ownership
WIP
Engineering Practices
Introduction to ATDD
SAFe
Nexus Integration Team
Agile Project Management
Atlaassian
SPC
Story Slicing
Professional Scrum with Kanban
Continuous Deployment
Iterative Incremental Development
Code
EOS®
GanttBan
Covid19
Lean Agile Basics
Professional Scrum Product Owner
Agile India
ScrumMaster Tales
Tips
Agile Israel Events
NIT
chatgpt
Agile Program
Perfection Game
Value Streams
Nexus and SAFe
Scrum
Nexus vs SAFe
Manage Budget Creation
Agile Exercises
agileisrael
DevOps
Agile Project
Lean Risk Management
A Kanban System for Software Engineering
Agile Product Development
Hybrid Work
Agile Assembly Architecture
Achieve Business Agility
Lean Agile Leadership
Lean Agile
Scrum Guide
Limiting Work in Progress
Games and Exercises
Jira
Kanban 101
SA
AgileSparks
Logo
Enable registration in settings - general

Contact Us

Request for additional information and prices

AgileSparks Newsletter

Subscribe to our newsletter, and stay updated on the latest Agile news and events

This website uses Cookies to provide a better experience
Shopping cart