I can't remember start from when and why, i always add
function! .. ... endfunction command! ...
:h E122 says:
When a function by this name already exists and [!] is not used an error message is given. There is one exception: When sourcing a script again, a function that was previously defined in that script will be silently replaced. When [!] is used, an existing function is silently replaced. Unless it is currently being executed, that is an error. NOTE: Use ! wisely. If used without care it can cause an existing function to be replaced unexpectedly, which is hard to debug.
In short, one should use
! only when one need to replace an existing function defined in other scripts. But nothing good would happen if such replace happens, right? So it should be avoided?
I went through a few popular plugins on my machine, all of them use
!, even for a script scope function, does that make sense? am i missing something?