I agree. I changed from “var” to “let”. Thanks for pointing that out.
Bob Lee
2

Bob – a lot of formatting rules are highly subjective – for instance people disagree about how many spaces one should indent code blocks – 2 or 4 spaces. Their also lots of discussions about the problem of using tab indents.

To me one basic test of the value of a particular formatting ‘rule’ is how much work are the eyes are made to do while scanning code – e.g. Scanning for blocks of code.

For the case of blocks of code my feeling is that braces that line up vertically are easiest for the eyes to scan for a block – block start, block end.

Apple’s recommended method requires one to scan horizontally and vertically or if one uses func, if, switch etc then the block scanning start indicator changes based on block context requiring a scan for multiple start block indicators.

Apple personnel who establish guidelines are not to be followed religiously – most of the time they offer good advice – not infrequently Apple guidelines are not helpful and should be challenged or not adhered to.

My two cents …

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.