In this article we investigate agent-oriented programming both from a theoretical and a practical view. We propose an abstract agent programming language with a clear and formally defined semantics. The semantics of our language is defined in terms of a transition system. Our language combines features of both logic programming, i.e. it is rule-based, and imperative programming, i.e. it includes the full range of conventional programming constructs. These features are well-understood and provide a solid basis for a structured agent programming language. On the more practical side we investigate the different properties of agents usually attributed to them, i.e. agents have a complex mental state, act pro-actively and reactively, and have reflective capabilites. We illustrate how these properties of agents are implemented in our programming language. In particalur, we propose general rules, called practical reasoning rules, which are used to define the reflective capabilities of agents and provide a mechanism for goal revision. The combination of the theoretical and practical perspective contributes, we hope, to filling the gap between theory and practice.