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:

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