  We define a metric on $\mathbb{F}_q^n$ using the linear complexity of finite
sequences. We will then develop a coding theory for this metric. We will give a
Singleton-like bound and we will give constructions of subspaces of
$\mathbb{F}_q^n$ achieving this bound. We will compute the size of balls with
respect to this metric. In other words we will count how many finite sequences
have linear complexity bounded by some integer $r$. The paper is motivated in
part by the desire to design new code based cryptographic systems.
