Hacker News new | past | comments | ask | show | jobs | submit login

You can omit them too (at the risk of legibility in some conditions).

All these are configurable (and not enforced by default but you can definitely do so with .editorconfig).

It is also fairly popular in C# to use expression-bodied members where they have just a single expression/statement e.g.

    class Test {
        public int Property => 42;
        public void Method() => Console.WriteLine(42);
    }



Yeah, I think OP's point is that nobody should be omitting braces in this day and age. Maybe there's a setting to force the use of braces too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: