I'd appreciate it if someone can help me out with two questions:

I think this function is not a type-stable function. This is because the 
type of out depends on the input A. If it is type-stable, why?
function myfunc(A)
out=similar(A)

#performs some computation that is then stored in out
return out
end


I think this function is a type-stable function. If it isn't, why?
function myfunc!(out,A)

#performs some computation that mutates out
return nothing
end

If my conclusions are correct, would you say it is better programming 
practice to use the second function as much as possible?


Reply via email to