The paper is based on the plenary lecture given at the Seminar of the Mathematical Society of Serbia and contains several examples and suggestions about why and how computer programming can be used in teaching mathematics in primary and high schools.