Currently I have something like the following
def writeThis(fileHandle, name): fileHandle.write('Hello ' + name) writeThis(fh, 'Alice')
Something about this doesn't feel right however, it feels like I should try to minimize side effects and have something like the following
def foo(name): return 'Hello ' + name fh.write(foo('Alice'))
Is the second option considered better practice? Does it matter?