News for hackers. Stuff that matters.
Re:The Performance Impact of C++'s `final` Keyword by neonsunset on Monday April 22, 2024 @03:39PM (#40118218)
C# has switch statements which are C/C++ style switches and switch expressions which are like Rust's match except no control flow statements inside:

    var len = slice switch
    {
        null => 0,
        "Hello" or "World" => 1,
        ['@', ..var tags] => tags.Length,
        ['{', ..var body, '}'] => body.Length,
        _ => slice.Length,
    };
(it supports a lot more patterns but that wouldn't fit)

There are no comments on this comment yet.