# Mod\_stat("stat", mod) vs. mod\_"stat"(mod)

**URL:** <https://discourse.cataclysmdda.org/t/mod-stat-stat-mod-vs-mod-stat-mod/10401>\
**Category:** The Toolbox\
**Created:** [August 26, 2015, 1:26am UTC](https://discourse.cataclysmdda.org/t/mod-stat-stat-mod-vs-mod-stat-mod/10401 "2015-08-26T01:26:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![i2amroy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/i2amroy/32/909_2.png) [@i2amroy](https://discourse.cataclysmdda.org/u/i2amroy)\
**Post date:** [August 26, 2015, 1:26am UTC](https://discourse.cataclysmdda.org/t/mod-stat-stat-mod-vs-mod-stat-mod/10401/1 "2015-08-26T01:26:25Z")

</div>

Basically right now we have two different ways to mod a lot of our stats, either through “mod\_fatigue(X)” or through “mod\_stat(“fatigue”, X)”. I was wondering if I should be working to compress everything down into just one or the other as I go (thus preventing duplication), and if so which one should I be working towards?

I mean having a single “mod\_stat(“stat”, X)”, “get\_stat(“stat”)”, and “set\_stat(“stat”, X)” rather than a billion different setter, getter, and mod functions certainly sounds attractive, but I personally haven’t worked with setters and getters enough to know which is the preferred code style in this case.

---

<div class="post-metadata">

**Author:** ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)\
**Post date:** [August 26, 2015, 5:54am UTC](https://discourse.cataclysmdda.org/t/mod-stat-stat-mod-vs-mod-stat-mod/10401/2 "2015-08-26T05:54:19Z")

</div>

mod\_stat( “string”, x ) is useful for json access, but I’d use the dedicated getters/setters for everything else.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [August 26, 2015, 5:56am UTC](https://discourse.cataclysmdda.org/t/mod-stat-stat-mod-vs-mod-stat-mod/10401/3 "2015-08-26T05:56:45Z")

</div>

Which is why we have both in the first place 😕

---

<div class="post-metadata">

**Author:** ![i2amroy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/i2amroy/32/909_2.png) [@i2amroy](https://discourse.cataclysmdda.org/u/i2amroy)\
**Post date:** [August 26, 2015, 8:54am UTC](https://discourse.cataclysmdda.org/t/mod-stat-stat-mod-vs-mod-stat-mod/10401/4 "2015-08-26T08:54:29Z")

</div>

Fair enough, it was one of those things that seemed kinda arbitrary. I’ll make sure to try to shift it to make sure we have both available for everything.
