Post Closed as "primarily opinion-based" by GlenH7, user40980, user22815, durron597, Ixrec
2 made more clear that I'm not asking about *deleting* the lines
source | link

Is there any good reason why lines with only whitespace should be avoidedtruncated?

Typically, when you hit Enter in a smart editor, it copies the indentation of the last line by inserting the same amount of spaces, so if you don't delete them, the code looks like this:

sub sum {
    my @numbers = @_;
    
    my $sum = 0;
    foreach (@_) {
         $sum += $_;
    }
    
    return $sum;
}

(Yes, the example is silly; that sub could be written in two or three lines. :))

To be honest, these lines make my cursor feel dizzy, so I tend to clear them out. (I admit, that this behavior generates commit noise + inconsistency.) Plus, the whitespace are unnecessary bytes. Well, probably none of these does matter, at least in most obvious ways. So I wonder if there is any better (i.e. less subjective and less over-pedantic) reason why the lines should be blanked (by s/^\s+$//).

Note: And please try not to point me to the style guide. Imagine I'm the one writing the style guide: should I inherit rule "delete them"the extra spaces" or just bravely fight my intuition and leave those peaceful \t's and 's alone?. Or I just want to improve my "own" guide, which I can use where "official" guide is silent or missing.

Is there any good reason why lines with only whitespace should be avoided?

Typically, when you hit Enter in a smart editor, it copies the indentation of the last line by inserting the same amount of spaces, so if you don't delete them, the code looks like this:

sub sum {
    my @numbers = @_;
    
    my $sum = 0;
    foreach (@_) {
         $sum += $_;
    }
    
    return $sum;
}

(Yes, the example is silly; that sub could be written in two or three lines. :))

To be honest, these lines make my cursor feel dizzy, so I tend to clear them out. (I admit, that this behavior generates commit noise + inconsistency.) Plus, the whitespace are unnecessary bytes. Well, probably none of these does matter, at least in most obvious ways. So I wonder if there is any better (i.e. less subjective and less over-pedantic) reason why the lines should be blanked.

Note: And please try not to point me to the style guide. Imagine I'm the one writing the style guide: should I inherit rule "delete them" or just bravely fight my intuition and leave those peaceful \t's and 's alone?. Or I just want to improve my "own" guide, which I can use where "official" guide is silent or missing.

Is there any good reason why lines with only whitespace should be truncated?

Typically, when you hit Enter in a smart editor, it copies the indentation of the last line by inserting the same amount of spaces, so if you don't delete them, the code looks like this:

sub sum {
    my @numbers = @_;
    
    my $sum = 0;
    foreach (@_) {
         $sum += $_;
    }
    
    return $sum;
}

(Yes, the example is silly; that sub could be written in two or three lines. :))

To be honest, these lines make my cursor feel dizzy, so I tend to clear them out. (I admit, that this behavior generates commit noise + inconsistency.) Plus, the whitespace are unnecessary bytes. Well, probably none of these does matter, at least in most obvious ways. So I wonder if there is any better (i.e. less subjective and less over-pedantic) reason why the lines should be blanked (by s/^\s+$//).

Note: And please try not to point me to the style guide. Imagine I'm the one writing the style guide: should I inherit rule "delete the extra spaces" or just bravely fight my intuition and leave those peaceful \t's and 's alone?. Or I just want to improve my "own" guide, which I can use where "official" guide is silent or missing.

1
source | link

Is there any good reason why lines with only whitespace should be avoided?

Typically, when you hit Enter in a smart editor, it copies the indentation of the last line by inserting the same amount of spaces, so if you don't delete them, the code looks like this:

sub sum {
    my @numbers = @_;
    
    my $sum = 0;
    foreach (@_) {
         $sum += $_;
    }
    
    return $sum;
}

(Yes, the example is silly; that sub could be written in two or three lines. :))

To be honest, these lines make my cursor feel dizzy, so I tend to clear them out. (I admit, that this behavior generates commit noise + inconsistency.) Plus, the whitespace are unnecessary bytes. Well, probably none of these does matter, at least in most obvious ways. So I wonder if there is any better (i.e. less subjective and less over-pedantic) reason why the lines should be blanked.

Note: And please try not to point me to the style guide. Imagine I'm the one writing the style guide: should I inherit rule "delete them" or just bravely fight my intuition and leave those peaceful \t's and 's alone?. Or I just want to improve my "own" guide, which I can use where "official" guide is silent or missing.