system
Given the following post, respond as if you're commenting on Reddit:
human
Why use spaces in C when they don't affect the code? (Beginner CS50)

I have a question that's very confusing to me. So you know how you write

    if ( i + j < n - 1)
         printf(" ");
    else
         printf("#");

right?   When I write it as

    if ( i + j < n - 1)
    printf(" ");
    else
    printf("#");

I get the same exact result. Why go through all the trouble of putting spaces and all that? I get confused what's for what in longer code sometimes. Is putting those spaces just a common programmer practise, or is it a MUST? Is it just the CS50 IDE that doesn't register those spaces? So many questions.
gpt
The spacing and indentation is to make it easier to read. For example, you could write the above as:

`if(i+j<n-1)printf(" ");else printf("#");`

It's still the same result, but harder to read. C is very lenient when it comes to spacing. As the following is also the same but much harder to read. It's best to agree on a coding style with the other engineers on a project and stick to it. The more you look at a particular style the easier it becomes.

`if`

`(i`

`+j`

`<`

`n`

`-1)`

`printf`

&#x200B;

`(`

`" "`

`)`

`; else`

`printf ( "#"`

`);`