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:

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