# SnootWIki ### _Coding Guidelines (& Standards & Quirks)_ * in the context of dialogue, ideally there should be 1 line between each `say` statement. * bad: ```py $ sd = Character('schizodev') sd "hmmm today i will be a useless piece of shit..." sd "...and not properly space my dialogue" show sd seething sd "do not follow my example" ``` * good: ```py $ sd = Character('schizodev') sd "there" show sd happy sd "much better" ``` * spaces, not tabs. any good/modern IDE should have a function to replace tabs with spaces automagically. * indents should be in a ratio of 4:1 (4 spaces to 1 indent) * try to keep a newline between each "different" type of code type (`say` statements, `boolean`/`if elif else` blocks, character movements, etc.) * bad: ```py scene party van with fade show schizodev confused at sleft sd "where am i oh god this code is a blob" if barfoo: sd "foobar" elif foobar: sd "barfoo" else: sd "help me" stop music fadeout 1.0 ``` * good: ```py scene party van with fade show schizodev confused at sleft sd "finally some space" if barfoo: sd "foobar" elif foobar: sd "barfoo" else: sd "help me" stop music fadeout 1.0 ``` * don't leave trailing/leading whitespace shitlord * try to keep the line length under (???) characters. if they are greater than that amount, chunk them out WITHOUT newline * bad: ``` sd "wasdfhasdfjkhadfksafjksdhafjkdshafjkdshguhavniuaenrfipunaeriufnaiusdniuadsvniunviuansdjasfkadfskhnadfksnagsdjklnadsjklfnadjk" ``` * good: ``` sd "wasdfhasdfjkhadfksafjksdhafjkdshafjkdshguhavniuaenrfip unaeriufnaiusdniuadsvniunviuansdjasfkadfskhnadfksnagsdjkln adsjklfnadjk" ``` * for chapter jumps (described more in detail below), do not indent the whole file!!! it's a huge waste of code space with no noticable benefit. * bad: ```py label chapter_1: # chapter start sd "good morning vietnam" ``` * good: ```py label chapter_1: pass # chapter start sd "good morning vietnam" ``` * the **FIRST** and **LAST** line of every script file should be a `label chapter_n` and a `jump chapter_n+1` respectively. * the only exceptions to this rule are "branch chapters" and non chapter scripts. * prefer `boolean` variables when doing `boolean` checks * bad: ```py define idort = 1 if idort == 1: sd "lol idort" sd "hehe" ``` * good: ```py define idort = True if idort: sd "lol idort" sd "hehe" ```