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