As users, computers, data and processes become increasingly mobile and the diversity of interacting devices increases, pervasive computing tasks are difficult to predict and to understand due to the spontaneity of interactions and the complexity and the fluidity of the surrounding contexts. This paper presents a context oriented-programming approach to pervasive computation. The resulting programming method relieves programmers from explicitly specifying and managing context awareness and the associated adaptation mechanisms.