Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is a similar [common][1] idiom with `using` in C#. When you need to create and later dispose several resources, to avoid excessive nesting you write

    using (var outFile = new StreamReader(outputFile.OpenRead()))
    using (var expFile = new StreamReader(expectedFile.OpenRead())) 
    {
        ///...
    }
[1]: http://stackoverflow.com/a/1329765/458193


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

Search: