Why do arrows point towards the codomain in function diagrams? The definition of a function given in Kenneth Rosen's Discrete Math Book is

Let A and B be nonempty sets. A function from A to B is an assingment of exactly one element of B to each element of A. [Emphasis mine]

It seems the author wants us to think of the elements in the codomain being assigned to the elements in the domain, not the elements in the domain being assigned to the ones in the codomain. However, in this book and most others, functions are often illustrated with such diagrams:

If it is more useful to think of the elemnts in the codomain as assigned to the elements in the domain, is there a reason why the arrows are not pointing in the other direction?

I would say that this is more about conventions than mathematics. As long as the mathematical meaning is clear, what is the big deal? 
For instance, in literature, the open interval $(a,b)$ can be also denoted as $]a,b[$. Arguing which notation is more reasonable is really not a mathematical question. 
