Skip to main content
2 of 6
deleted 9 characters in body

Stacking keywords on top of each other - poor style?

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?