# Sorce code - why don't you increase comment lines ?

**URL:** <https://forums.synfig.org/t/sorce-code-why-dont-you-increase-comment-lines/3527>\
**Category:** Coding synfig\
**Created:** [August 11, 2015, 7:43am UTC](https://forums.synfig.org/t/sorce-code-why-dont-you-increase-comment-lines/3527 "2015-08-11T07:43:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiber](https://forums.synfig.org/letter_avatar_proxy/v4/letter/t/f14d63/32.png) [@Tiber](https://forums.synfig.org/u/Tiber)\
**Post date:** [August 11, 2015, 7:43am UTC](https://forums.synfig.org/t/sorce-code-why-dont-you-increase-comment-lines/3527/1 "2015-08-11T07:43:06Z")

</div>

Hallo to all Synfig fans, users and especially developers,

I have seen the current Synfig’s sorce code. And in the next weeks I will start to study it.  
I think that collaborators in develpoment could better understand the inner structure and the underlying algorythms just increasing the number of comment lines. It seems to me there is a lack of comment in the source code.  
The more commented is code, the better understood it will be.  
I think it would be better than write down more wiki pages for developers.  
“Open” source means visible code, anyway there are not just professional developers here, but even hobbyist.

My two cents  
Best wishes  
Tiber

---

<div class="post-metadata">

**Author:** ![d.j.a.y](https://forums.synfig.org/user_avatar/forums.synfig.org/d.j.a.y/32/113_2.png) [@d.j.a.y](https://forums.synfig.org/u/d.j.a.y)\
**Post date:** [September 3, 2015, 8:13am UTC](https://forums.synfig.org/t/sorce-code-why-dont-you-increase-comment-lines/3527/2 "2015-09-03T08:13:51Z")

</div>

Hello

> [@Tiber](#):
>
> I have seen the current Synfig’s sorce code. And in the next weeks I will start to study it.

> [@Tiber](#):
>
> “Open” source means visible code, anyway there are not just professional developers here, but even hobbyist.

Has you said … it’s mostly hobbyist coders who do the daily job… welcome to your 2cents comments when you will study the code 😉 … also you can [note](https://www.openhub.net/p/synfig/analyses/latest/languages_summary) that the number of comment increase each month …slowly, but increase 😉

---

<div class="post-metadata">

**Author:** ![eldruin](https://forums.synfig.org/user_avatar/forums.synfig.org/eldruin/32/58_2.png) [@eldruin](https://forums.synfig.org/u/eldruin)\
**Post date:** [September 22, 2015, 12:48pm UTC](https://forums.synfig.org/t/sorce-code-why-dont-you-increase-comment-lines/3527/3 "2015-09-22T12:48:30Z")

</div>

Hi Tiber,  
I’m sorry but I have to say that the best comment is the one you don’t need to write. The code should be clear enough to be read. If it is not, the code should be refactored, not documented. Comments also get outdated and make the whole thing more difficult to understand.

There is really a lot of code that needs to be refactored in synfig. If you will start studying and improving the code, I would recommend that once you understand some part that you think it is not very readable, create some unit tests and refactor it. It may be only a variable name change or a method extraction but it is valuable if it improves the code readability.  
I have a branch where I started creating some unit tests to the core. You are very welcome to add more. [Branch on GitHub](https://github.com/eldruin/synfig/tree/core_unittests) [Issue in bug tracker](http://www.synfig.org/issues/thebuggenie/synfig/issues/878)

Anyway welcome to the development. I do not mean to be unwelcoming at all, just you know, I have other two cents 🙂

Best regards,  
eldruin.

---

<div class="post-metadata">

**Author:** ![BobSynfig](https://forums.synfig.org/user_avatar/forums.synfig.org/bobsynfig/32/175_2.png) [@BobSynfig](https://forums.synfig.org/u/BobSynfig)\
**Post date:** [September 22, 2015, 6:56pm UTC](https://forums.synfig.org/t/sorce-code-why-dont-you-increase-comment-lines/3527/4 "2015-09-22T18:56:49Z")

</div>

You are both right, but…

A project always need comments.  
Refactoring is good to improve readability, but it is mostly focused in implementation.  
The comments in the code should be mostly used for generation of automatic documentation ([Here](http://download.tuxfamily.org/synfig/api/index.html))  
But this is only the “coding part”.  
What is the most important is the concept, the description and the reason of the choice for some algorithm.  
Drawings of overviews, with more and more details when focusing on specific parts.  
This [page](http://wiki.synfig.org/index.php?title=Dev:How_Synfig_Works) is a perfect example.  
Always go from the global to the specific.  
You are coders/developers (I am too IRL), you always need documentation.  
Even non-coders could suggest improvements if they know where to “insert” some concepts.

Source code should be readable like musical parts, proper indentation, alignment, constants and with use of spaces between the terms.  
Unless you have to pay taxes for these spaces 😈
