I tend to make my code more readable by reducing the number of functions called per line of code.
It may be more compact to call several functions in one line, but it is more readable and easier to debug when you restrict the number of functions to one per line. And it's easier to insert additional lines when you don't have to deconstruct an pre-existing line to do so.
Yes, your compactly written line may run a mite faster. But you will be spending more time on maintenance and debugging than you have saved.
And yes, you may need to declare and use several extra variables to enable you to keep to the 'one function per line rule'.
I tend to make my code more readable by reducing the number of functions called per line of code.
It may be more compact to call several functions in one line, but it is more readable and easier to debug when you restrict the number of functions to one per line. And it's easier to insert additional lines when you don't have to deconstruct an pre-existing line to do so.
Yes, your compactly written line may run a mite faster. But you will be spending more time on maintenance and debugging than you have saved.
And yes, you may need to declare and use several extra variables to enable you to keep to the 'one function per line rule'.
And lastly, there is this old adage: https://blogs.msdn.microsoft.com/alfredth/2009/01/08/are-you...