I have always wondered about this, especially in C/Java style languages. For example, consider the first 3 lines of this C# code:
lock (serviceLock)
using (var client = new ServiceClient())
try
{
// Do something
client.DoSomething();
}
catch (System.ServiceModel.FaultException ex)
{
// Handle error
addLog(ex.ToString());
}
This usage has always seemed somewhat questionable to me. However, the alternative is not very pretty either (3+ levels deep of indentation for a service call). What is the best practice for Maximum Readability?