# Code organization, class division and design

**URL:** https://discourse.cataclysmdda.org/t/code-organization-class-division-and-design/301
**Category:** The Drawing Board
**Created:** [March 1, 2013, 5:02pm UTC](https://discourse.cataclysmdda.org/t/code-organization-class-division-and-design/301 "2013-03-01T17:02:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/tase/32/867_2.png) [@Tase](https://discourse.cataclysmdda.org/u/Tase)
#### Post date: [March 1, 2013, 5:02pm UTC](https://discourse.cataclysmdda.org/t/code-organization-class-division-and-design/301/1 "2013-03-01T17:02:40Z")

</div>

This might be an iffy topic, but I really feel the code needs a tune up. It’s quite hard to read off the bat, and the classes like game need to be split up (it’s 8000 lines long damnit) into coherent classes like MainMenu or ActionProcessor and ideally reduce coupling.

And I think anyone interested should check out [http://astyle.sourceforge.net/](http://astyle.sourceforge.net/) and/or [http://geosoft.no/development/cppstyle.html](http://geosoft.no/development/cppstyle.html)

I want to see the source increase in readability, increase in maintanability and if that means the game runs a hertz or two slower, then so be it.

I don’t want to bash the code anyone has done, let’s just treat this as a meta-bug and start by agreeing a 8000 line class is a problem 🙂

PS: Folders. Here are some that would be welcomed: Item, Monster, Mission, NPC, Vehicle, Engine (or GUI, Screen, whatever)

---

<div class="post-metadata">

### Author: ![GlyphGryph](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/glyphgryph/32/847_2.png) [@GlyphGryph](https://discourse.cataclysmdda.org/u/GlyphGryph)
#### Post date: [March 1, 2013, 6:06pm UTC](https://discourse.cataclysmdda.org/t/code-organization-class-division-and-design/301/2 "2013-03-01T18:06:50Z")

</div>

Feel free to do these things and request your branch be pulled. People have made some progress on this front, but extra hands overhauling code and writing it in a better and more modular form would certainly be appreciated.

---

<div class="post-metadata">

### Author: ![Tase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/tase/32/867_2.png) [@Tase](https://discourse.cataclysmdda.org/u/Tase)
#### Post date: [March 1, 2013, 6:50pm UTC](https://discourse.cataclysmdda.org/t/code-organization-class-division-and-design/301/3 "2013-03-01T18:50:53Z")

</div>

Ok, good to know you guys are open minded on these types of changes, ill start doing some basic stuff sometime tonight.
