So I have been on scripting helpers for under a month and have noticed that a lot of users asking questions have precreated functions for events like so:
function onTouch()
print("I was touched")
end
script.Parent.Touched:Connect(function(onTouch)
Whereas I am more used to using nested functions like so:
script.Parent.Touched:Connect(function()
print("I was touched")
end)
These are just minor examples but they show what I mean. Could someone tell me which method is better or more efficient? I cannot tell much of a difference other than I prefer nested functions. Thanks!

3 comments
The top one is wrong, you don't even finish the parentheses. And it really doesn't matter at all.
I wouldn't say it doesn't matter -- if there is a circumstance where you wish to reuse the code inside the body of function f, then creating a variable for it is certainly necessary.
I wasnt trying to get it right. Just giving an example