  In this text we develop some aspects of Harder-Narasimhan theory, slopes,
semistability and canonical filtration, in the setting of combinatorial
lattices. Of noticeable importance is the Harder-Narasimhan structure
associated to a Galois connection between two lattices. It applies, in
particular, to matroids.
  We then specialize this to linear codes. This could be done from at least
three different approaches: using the sphere-packing analogy, or the geometric
view, or the Galois connection construction just introduced. A remarkable fact
is that these all lead to the same notion of semistability and canonical
filtration. Relations to previous propositions towards a classification of
codes, and to Wei's generalized Hamming weight hierarchy, are also discussed.
  Last, we study the important question of the preservation of semistability
(or more generally the behaviour of slopes) under duality, and under tensor
product. The former essentially follows from Wei's duality theorem for higher
weights---and its matroid version---which we revisit in an appendix, developing
analogues of the Riemann-Roch, Serre duality, Clifford, and gap and gonality
sequence theorems for codes. Likewise the latter is closely related to the
bound on higher weights of a tensor product, conjectured by Wei and Yang, and
proved by Schaathun in the geometric language, which we reformulate directly in
terms of codes. From this material we then derive semistability of tensor
product.
