That code should be as few lines as possible. There's an element of refactoring that is important so that it's efficient, but it should also be understandable.
I believe you shouldn't write code as if you're going to be the one dealing with it, but someone underneath your level of understanding.
Dan has more than 22 years of software design, development, and architecture experience. He is also a husband, father, carpenter, and runs obstacle races like Tough Mudder.
That code should be as few lines as possible. There's an element of refactoring that is important so that it's efficient, but it should also be understandable.
I believe you shouldn't write code as if you're going to be the one dealing with it, but someone underneath your level of understanding.
“I didn't have time to write a short function, so I wrote a long one instead.” - Mark Twain :)