# Motoko indendation: 2 spaces or 4 spaces?

**URL:** <https://forum.dfinity.org/t/motoko-indendation-2-spaces-or-4-spaces/10318>\
**Category:** Developers\
**Created:** [January 17, 2022, 12:22am UTC](https://forum.dfinity.org/t/motoko-indendation-2-spaces-or-4-spaces/10318 "2022-01-17T00:22:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bioerrorlog](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bioerrorlog/32/4410_2.png) [@bioerrorlog](https://forum.dfinity.org/u/bioerrorlog)\
**Post date:** [January 17, 2022, 12:22am UTC](https://forum.dfinity.org/t/motoko-indendation-2-spaces-or-4-spaces/10318/1 "2022-01-17T00:22:26Z")

</div>

Hi devs, I have a question about Motoko indentation.

“dfx new” cmd generates the default greet Motoko codes with 4 spaces indentation.  
But, [the Motoko style guideline](https://smartcontracts.org/docs/language-guide/style.html) recommends 2 spaces.

What do you think about this diff?

I agree with the rationale written in the Motoko style guideline because nested switch-case expression is often used in Motoko codes.

> “Rationale: There may be a lot of nesting. Using only 2 spaces avoids wasting screen estate.”

So IMO, “dfx new” should also generate the default codes with 2 spaces indentation to avoid confusion.

Thanks.

---

<div class="post-metadata">

**Author:** ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)\
**Post date:** [January 17, 2022, 8:21am UTC](https://forum.dfinity.org/t/motoko-indendation-2-spaces-or-4-spaces/10318/2 "2022-01-17T08:21:11Z")

</div>

Tracked here [Motoko template project should follow motoko style guidlines. · Issue #1986 · dfinity/sdk · GitHub](https://github.com/dfinity/sdk/issues/1986)
