Making A Modular Design

Eric Philippot
Jul 11, 2022

--

The importance of a modular design for your applications

Cubes spinning on screen to show hypothetical modules for game input and collisions
Modules

There are a lot of things that help when coding your next project, but none seem as important as readability and modularity. You don’t want to throw all you logic into one place. Being able to create reusable modules throughout your project allows for rapid expansion and easier maintainability.

Methods in C# to demonstrate code modularity.
Modular Code

Obviously the code above can be pushed even further to create a more modular design. But in the player class itself, you can see there is a modular design that is being implemented and other classes can interact with it as well.

Creating a bunch of smaller components rather than stuffing all functions into one containing code block is much more efficient and readable.

--

--

Eric Philippot

Game and Web Developer with a joined experience of 6 years.