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:

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