[Swift-devel] Code style

Mihael Hategan hategan at mcs.anl.gov
Tue May 14 14:26:49 CDT 2013


On Tue, 2013-05-14 at 13:33 -0500, Michael Wilde wrote:
> The internals/code-style page mentioned below is rather vague.
> 
> Im in favor of 3 things:
> 
> - code format inspired by K&R (more compact than {} on separate lines, while quite readable). The Oracle page cited by David is fine in that regard.

I don't have a good reason for the opposite. I think I prefer the
aesthetics of being similar to <letters> <brackets> which is mandated by
method/class definitions and pretty much everything else. Also, most of
the code already uses this, and I'd prefer that for consistency reasons.

> 
> - spaces instead of hard tabs. I feel adamant about this.

Eclipse has some options where you can do both "keep as is" (for
existing lines) and "use spaces for new stuff".

> 
> - Ideally, a format for which some auto-formatter exists that would enable us to clean up our source.
> 
> Somehow the PBS provider files got very badly un-tabbed, so they are
> hard to read.

I think an easy solution is setting the tab size to 4 in your favorite
editor and that makes the problem magically go away.

Mihael




More information about the Swift-devel mailing list