I disagree, at least regarding the question in the title.
A ref is always preferable unless one _needs_ a pointer. And the heap vs. stack is not Nim specific.
I disagree, at least regarding the question in the title.
A ref is always preferable unless one _needs_ a pointer. And the heap vs. stack is not Nim specific.