Several applications of function fields over finite fields, or equivalently, algebraic curves over finite fields, require computing bases for Riemann–Roch spaces. In this paper, we determine explicit bases for Riemann–Roch spaces of linearized function fields, and we give a lower bound for the minimum distance of generalized algebraic geometry codes. As a consequence, we construct generalized algebraic geometry codes with good parameters.