<?xml version="1.0" encoding="windows-1252"?>
<node id="996733" title="Re: Mr. BlindNewB question regarding spacing" created="2012-10-01 16:07:19" updated="2012-10-01 16:07:19">
<type id="11">
note</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
&lt;p&gt;While I cannot see the changes you made in your example (a problem with node formatting), the answer is yes, you can use whitespace. In fact, &lt;em&gt;please&lt;/em&gt; add (a reasonable amount of) whitespace. Separate any logical blocks of code you have with an extra linebreak. I generally sprinkle one after (a group of) variable declarations, too. (But I hate "double-spaced" code.)&lt;/p&gt;

&lt;p&gt;Also, use tabs to indent your code. Configure your editor to show them as n spaces, where n is a comfortable value (for you). I generally use a value of two spaces, but whenever I'm reading code I'm unfamiliar with, I'll increase it temporarily to four. It helps me understand the flow better.&lt;/p&gt;

&lt;p&gt;You might also like the &lt;c&gt;/x&lt;/c&gt; modifier if you're working with regular expressions. And if you don't have a syntax-colouring editor yet, get one immediately! It will help tremendously.&lt;/p&gt;

&lt;p&gt;Here's what my code looks like, to give you a rough idea on what I consider OK spacing:&lt;/p&gt;

&lt;code&gt;
sub lint {
	my ($fn) = $_;

	$fn = decode_utf8($fn);

	if ($fn ne (my $new_fn = compose($fn))) {
		print STDERR "Decomposed unicode: $new_fn\n";
		if (!DRY_RUN) {
			die if -e $new_fn;
			rename($fn, $new_fn) or warn "Failed rename for file $fn";
		}
	}

	if (-f $fn) {
&lt;/code&gt;</field>
<field name="root_node">
996700</field>
<field name="parent_node">
996700</field>
<field name="reputation">
6</field>
</data>
</node>
