Did the developers of Java conciously abandon RAII?
- by JoelFan
As a long-time C# programmer, I have recently come to learn more about the advantages of Resource Acquisition Is Initialization (RAII). In particular, I have discovered that the C# idiom:
using (my dbConn = new DbConnection(connStr) {
// do stuff with dbConn
}
has the C++ equivalent:
{
DbConnection dbConn(connStr);
// do stuff with…