This book provides a self-contained introduction to the theory of error-correcting codes and related topics in number theory, Algebraic Geometry and the theory of Sphere Packings. The material is presented in an easily understandable form. This book is devoted to geometric Goppa codes; the recently discovered areas which combines Coding Theory, Algebraic Geometry, Number Theory, and Theory of Sphere Packings. It has an interdisciplinary nature and demonstrates the close interconnection of Coding Theory with various classical areas of mathematics. There are four main themes in the book. The first is a brief exposition of the basic concepts and facts of error-correcting code theory. The second is a complete presentation of the theory of algebraic curves; especially the curves defined over finite fields. The third is a detailed description of the theory of elliptic and modular codes, and their reductions modulo a prime number. The fourth is a construction of geometric Gappa codes producing rather long linear codes with very good parameters coming from algebraic curves, and with a lot of rational points. The aim of the book is to present these themes in a simple, easily understandable manner, and explain their close interconnection. At the same time the book introduces the reader to topics which are at the forefront of current research.