Slope is a geometric concept; it is a property of a line in a coordinate plane. So, a line can have slope. But a function is not a geometric object, so it can’t really have a slope. When people talk about the slope of a linear function, they really mean the slope of its graph, a geometric object which is attached to the function. And if the linear function relates quantities with units, for example distance versus time, then makes more sense to talk about the rate of change rather than the slope.