Quick question. Is it anymore efficient, in terms of execution speed, to write a line of code like
versus breaking it up into multiple lines to something like this maybe
Obviously the latter would be easier to read but is it any slower? This is also just a small example because I don't have any other unreadable chunks of code to compare with but I would think the idea should still be the same. I'm curious for both compiled and scripted languages. Thanks.
Code:
answer = sanitizeInput(raw_input(wrapText(questionStr), lineWidth)).upper()
versus breaking it up into multiple lines to something like this maybe
Code:
answer = raw_input(wrapText(questionStr), lineWidth)
answer = sanitizeInput(answer)
answer = answer.upper()
Obviously the latter would be easier to read but is it any slower? This is also just a small example because I don't have any other unreadable chunks of code to compare with but I would think the idea should still be the same. I'm curious for both compiled and scripted languages. Thanks.