We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Your code is certainly shorter, but you also make a slight sacrifice in readability. Of course, the 'readability' of your code will depend on the experience level of the reader. But you won't always be working with talented programmers. For many, I think the following code is more readily understandable and its decrease in computational efficiency is marginal:
Write a function
You are viewing a single comment's thread. Return to all comments →
Your code is certainly shorter, but you also make a slight sacrifice in readability. Of course, the 'readability' of your code will depend on the experience level of the reader. But you won't always be working with talented programmers. For many, I think the following code is more readily understandable and its decrease in computational efficiency is marginal: