We present a computer model of opinion changes in a scientific community. The study takes into account two mechanisms of opinion formation for individual scientists: influence of coworkers with whom there is direct interaction and cumulative influence of the subject literature. We analyze the evolution of relative popularity of different competing theories, depending on their accuracy in describing observed phenomena and on current social support of the theory. We include such aspects as finite lifetime of publication impact and tendency to 'defend' one's own opinions, especially if they were already published. A special class of publications, delivering crucial observational or experimental data, which may revolutionize the scientific worldview is considered. The goal of the model is to discover which conditions lead to quick domination of one theory over others, or, conversely, in which situations one may expect several explanations to co-exist.