TOPIC: Formatting of Suneido Code?
#1568
Formatting of Suneido Code? 10 Months, 3 Weeks ago
I am having problems following the formatting of Suneido code. Is there a reason this very non-standard method was chosen?

Code:


rows = Object()
for (item in row)
    {
    if (font isnt false)
        {
        item = false is Object?(item) ? Object(item) : item.Copy()
        item.font = font
        }
    rows.Add(_report.Construct(item))
    }
.data.Add(rows)



vs:

Code:


rows = Object()
for (item in row) {
    if (font isnt false) {
        item = false is Object?(item) ? Object(item) : item.Copy()
        item.font = font
    }

    rows.Add(_report.Construct(item))
}

.data.Add(rows)



or:

Code:


rows = Object()
for (item in row)
{
    if (font isnt false)
    {
        item = false is Object?(item) ? Object(item) : item.Copy()
        item.font = font
    }

    rows.Add(_report.Construct(item))
}

.data.Add(rows)



I am just curious to the rationale.

Jeremy
 
 
#1572
Re:Formatting of Suneido Code? 10 Months, 3 Weeks ago
It is called the Whitesmiths style.

http://en.wikipedia.org/wiki/Indent_style#Whitesmiths_style

Whitesmiths C compiler was one of the first I used. That's where I picked up this style. And it was used in early Windows programming. Nowadays, it is not as common.

When I am programming in Java I use the standard Java indenting. I do not think it makes a lot of difference, but I think it is better if code is consistent.

Of course, you can use whatever indenting style you want in your Suneido code.

It would be nice to have tools in Suneido to re-format code to whatever style you wanted, although that's a trickier problem than you might think. Even Eclipse has glitches with its automatic formatting.
 
 
andrew