  Let $A$ be a ring with identity, $\sigma$ a ring endomorphism of $A$ that
maps the identity to itself, $\delta$ a $\sigma$-derivation of $A$, and
consider the skew-polynomial ring $A[X;\sigma,\delta]$. When $A$ is a finite
field, a Galois ring, or a general ring, some fairly recent literature used
$A[X;\sigma,\delta]$ to construct new interesting codes (e.g. skew-cyclic and
skew-constacyclic codes) that generalize their classical counterparts over
finite fields (e.g. cyclic and constacyclic linear codes). This paper presents
results concerning {\it principal} $(f, \sigma, \delta)$-codes over a ring $A$,
where $f\in A[X;\sigma,\delta]$ is monic. We provide recursive formulas that
compute the entries of both a generating matrix and a control matrix of such a
code $\mathcal{C}$. When $A$ is a finite commutative ring with identity and
$\sigma$ is a ring automorphism of $A$, we also give recursive formulas for the
entries of a parity-check matrix of $\mathcal{C}$. Also in this case, with
$\delta=0$, we give a generating matrix of the dual $\mathcal{C}^\perp$,
present a characterization of principal $\sigma$-codes whose duals are also
principal $\sigma$-codes, and deduce a characterization of self-dual principal
$\sigma$-codes. Some corollaries concerning principal $\sigma$-constacyclic
codes are also given, and some highlighting examples are provided.
