Manu wrote:
That's no less ugly though, in fact, it's considerably more ugly. more
brace spam + indentation levels for nothing.

I actually like the bracket+indentation as a section separator indicator. Usually I'll "group" fields/methods by common attribute:

    class Window
    {
        private {
            string _title;
            int _x, _y;
            // etc...
        }

        @property {
            auto title() { return _title; }
            auto x() { return _x; }
            auto y() { return _y; }
            // etc...
        }
    }

    // Or...

    struct Vector2(T)
    {
        T x, y;

        @property {
            auto xy() { return this; }
            auto yx() { return Vector2(y, x); }
        }

        @property static {
            auto zero() { return Vector2(0, 0); }
            auto one()  { return Vector2(1, 1); }
            // etc...
        }
    }

But I'm also use to C# code which is usually indented twice before you even get to functions (namespace -> class -> method).

Reply via email to