Hacker News new | ask | show | jobs
by shhsshs 1894 days ago
C#’s new syntax for `using` also helps:

Old:

    using (var file = OpenFile())
    {
        // use file
    }
New:

    using var file = OpenFile();
    // file will be disposed when it goes out of scope