| ▲ | mort96 2 hours ago | |||||||
That approach doesn't allow you to move the file into some long lived object or return it in the happy path though, does it? | ||||||||
| ▲ | actionfromafar 2 hours ago | parent [-] | |||||||
As someone coming from RAII to C#, you get used to it, I'd say. You "just" have to think differently. Lean into records and immutable objects whenever you can and IDisposable interface ("using") when you can't. It's not perfect but neither is RAII. I'm on a learning path but I'd say I'm more productive in C# than I ever was in C++. | ||||||||
| ||||||||