Both the question and the answers could be improved by providing concrete examples and use cases.
I was misled by the word "recommended" in the title to think it was an opinion-based question (and I voted to close for this reason).
Reading this question and re-reading the original one made me realize it's not bad because it's subjective.
It's bad because it lacks context and applicability. (I stand by my judgment that it's a bad question, sorry)
"Would you recommend to drink Coke or beer?" sounds a lot like a subjective question until I tell you that I know a guy with diabetes who drinks a lot of beer but would not touch any soda.
If you're going to drive home, on the other hand...
It's the context that turns it into an answerable question.
There's a lot of very good advice in the software world based on seemingly random statements.
Like that a function should not have more than three lines (Clean Code by Robert C. Martin) or five lines (Five Lines of Code by Christian Clausen - disclaimer: I haven't read that one but based on the title, I'd guess it's about functions having five lines of code).
Obviously, you can't apply both.
The question should be rephrased as: "in this very specific case is it recommended to use commands or functions?"
That would mean it would lose (harmful) generality.
Even if the question is not, it does not preclude the answers from doing so: "in this case I'd prefer a function over a command because ..." or the opposite.
Include code snippets from VIMRUNTIME
.
Do they use commands or functions?
In what case? Why?
Search through the code of popular plugins. What do they do? If tpope writes commands over two screens long (I'm making this up), who am I to argue?
And don't forget to listen to your gut feeling.
I recently wrote a command of seven lines and it made me feel uneasy.
I wanted to use a function.
I'm not very experienced writing Vimscript.
Maybe the seasoned Vimmers can put a finger on it.
Trust your developer instincts!
And don't forget there are objective differences between commands and functions.
A good answer should elaborate on their implications and consequences.
Functions have a conventional interface but are insanely hard to :call
.
For commands, it's quite the opposite.
It's all about using the right tool for the job.
What is the job?
We don't know because neither the question nor the answers tell us.