# Why so little code comment in Discourse Codebase? (Github)

**URL:** https://meta.discourse.org/t/why-so-little-code-comment-in-discourse-codebase-github/85710
**Category:** Development
**Created:** [April 19, 2018, 10:37am UTC](https://meta.discourse.org/t/why-so-little-code-comment-in-discourse-codebase-github/85710 "2018-04-19T10:37:34Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![1c7](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/1c7/32/94822_2.png) [@1c7](https://meta.discourse.org/u/1c7)
#### Post date: [April 19, 2018, 10:37am UTC](https://meta.discourse.org/t/why-so-little-code-comment-in-discourse-codebase-github/85710/1 "2018-04-19T10:37:35Z")

</div>

[https://github.com/discourse/discourse](https://github.com/discourse/discourse)

### Background

I was trying to customize Discourse.  
(deep customization, theme/plugin is not enough, not a simple facelift change(logo, color, image etc))

I `git clone ` to my laptop and start reading the code.  
(I am Ruby on Rails dev & newbie Ember.js dev)

### Question

1. Why there are so little code comment in codebase?  
(controller / model / view / etc, both Rails and Ember)

I get the phrase “good code itself is comment” (or something like that)  
But why so little?

Thanks.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 19, 2018, 10:41am UTC](https://meta.discourse.org/t/why-so-little-code-comment-in-discourse-codebase-github/85710/2 "2018-04-19T10:41:40Z")

</div>

Because comments tend to rot and deprecate which makes them useless (and sometimes counter intuitive) over time.

---

<div class="post-metadata">

### Author: ![1c7](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/1c7/32/94822_2.png) [@1c7](https://meta.discourse.org/u/1c7)
#### Post date: [April 19, 2018, 10:43am UTC](https://meta.discourse.org/t/why-so-little-code-comment-in-discourse-codebase-github/85710/3 "2018-04-19T10:43:39Z")

</div>

Thanks for reply

But 1-4 line comment per-controller/view/template/etc seem like reasonable number.  
not too much, not too little

:smile:

---

<div class="post-metadata">

### Author: ![1c7](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/1c7/32/94822_2.png) [@1c7](https://meta.discourse.org/u/1c7)
#### Post date: [April 19, 2018, 10:46am UTC](https://meta.discourse.org/t/why-so-little-code-comment-in-discourse-codebase-github/85710/4 "2018-04-19T10:46:47Z")

</div>

I hope you guys(Discourse core team) can write few post about the  
**big picture view** on Discourse codebase..  
(not like “why chose Ember.js” I already read that one. deeper than that)

like:

1. Why this folder structure(Ruby on Rails & Ember.js put together)  
I guess if you guys make Discourse from scratch in 2018,  
would decide separated Rails&Ember into 2 repo?  
or different folder structure

2. What’s the different between GlobalSetting & SiteSetting?

3. What’s the core model of Discourse? (Users&Post&Topic)?

4. why preload\_script is needed? example `<%= preload_script 'break_string' %>`  
preload\_script return

```plaintext
# ... some other code
<link rel='preload' href='#{path}' as='script'/>
<script src='#{path}'></script>".html_safe

```

so it’s for SEO or some other reason?

1. and few other question I couldn’t recall right now

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [April 19, 2018, 10:52am UTC](https://meta.discourse.org/t/why-so-little-code-comment-in-discourse-codebase-github/85710/5 "2018-04-19T10:52:03Z")

</div>

> [@1c7](#):
>
> deep customization, theme/plugin is not enough

> [@Creating a gender limited forum?](https://meta.discourse.org/t/creating-a-gender-limited-forum/76192/2):
>
> In Discourse a plugin can do almost anything :sparkles:

You can/should use plugin.

---

<div class="post-metadata">

### Author: ![1c7](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/1c7/32/94822_2.png) [@1c7](https://meta.discourse.org/u/1c7)
#### Post date: [April 19, 2018, 10:52am UTC](https://meta.discourse.org/t/why-so-little-code-comment-in-discourse-codebase-github/85710/6 "2018-04-19T10:52:29Z")

</div>

OK, I would read more into plugin.  
Thanks for the suggestion [Vinoth Kannan](https://meta.discourse.org/u/vinothkannans)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 19, 2018, 12:36pm UTC](https://meta.discourse.org/t/why-so-little-code-comment-in-discourse-codebase-github/85710/7 "2018-04-19T12:36:42Z")

</div>

Unless you have a team of full time programmers or want never to take advantage of future upgrades to discourse, you want a plugin. Those who have forked are all sorry.

Almost anything can be accomplished with a plugin.

---

<div class="post-metadata">

### Author: ![1c7](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/1c7/32/94822_2.png) [@1c7](https://meta.discourse.org/u/1c7)
#### Post date: [April 19, 2018, 12:51pm UTC](https://meta.discourse.org/t/why-so-little-code-comment-in-discourse-codebase-github/85710/8 "2018-04-19T12:51:28Z")

</div>

Got it, Thanks!  
we do want future upgrade, would look into Theme and Plugin.  
Thanks for reply!
