Given the task of printing to the terminal, which code block is "best practice"?
string name = get_string("Whats your name? ");
printf("Hello, %s\n", name);
or
printf("Hello, %s\n", get_string("Whats your name? "));
This question has come up two times for me in interviews and seemed to be a sticking point of some kind.
Both times the ladder was held up as the "proper" way but no real explanation why besides taking up less space. Is it due to not taking up a namespace and/or passing functions being more efficient?