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

Modern C# version,

    using var sr = new StreamReader(filename);

    txt = sr.ReadToEnd();
And for the "what about forgeting to call using?",

https://devblogs.microsoft.com/dotnet/infer-interprocedural-...

No different from using all those static analisers in C and C++ to keep the code free of memory corruptions and UB issues.




Does it behave identically without the braces?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: