Refactoring

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Refactoring

Refactoring means cleaning up and reorganizing your code without changing its functionality.

Imagine your desk full of pens, paper, dirty coffee cups, you name it. You have all the tools you need to work productively, but they're scattered everywhere. It's hard to find the things you need and to understand what's going on.

Code can get in the same state.

Refactoring is taking the time to tidy everything up and put everything in the right place. It doesn't change what you have, but it makes everything easier to use and understand.

There are a few reasons you might want to refactor your code:

How refactoring is done

Refactoring can involve a large set of techniques and practices. Here are a few common ones:

Notice how some of these techniques involve breaking code apart, while others involve bringing it together. As with everything in code, the most appropriate approach depends on the context and takes practice to get right.

Become an Indie Gamedev with GDQuest!

Don't stop here. Step-by-step tutorials are fun but they only take you so far.

Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!