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:

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