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:

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