<<One of the most important things in this “guess—compute consequences—compare with experiment” business is to know when you are right. It is possible to know when you are right way ahead of checking all the consequences. You can recognize truth by its beauty and simplicity. It is always easy when you have made a guess, and done two or three little calculations to make sure that it is not obviously wrong, to know that it is right. When you get it right, it is obvious that it is right—at least if you have any experience—because usually what happens is that more comes out than goes in. Your guess is, in fact, that something is very simple. If you cannot see immediately that it is wrong, and it is simpler than it was before, then it is right. The inexperienced, and crackpots, and people like that, make guesses that are simple, but you can immediately see that they are wrong, so that does not count. Others, the inexperienced students, make guesses that are very complicated, and it sort of looks as if it is all right, but I know it is not true because the truth always turns out to be simpler than you thought. What we need is imagination, but imagination in a terrible strait-jacket. We have to find a new view of the world that has to agree with everything that is known, but disagree in its predictions somewhere, otherwise it is not interesting. And in that disagreement it must agree with nature…>>
— Feynman, The Character of Physical Law, 1965, Chapter 7, “Seeking New Laws”.

C’est dit ! Si le code est joli, simple, claire, facile à comprendre, on peut penser qu’on a fait la chose correctement. Au contraire, si le code est compliqué, pas très claire, difficile à comprendre, on sait qu’il y a quelque chose qui ne va pas et il est nécessaire de prendre du recul pour améliorer le code.

Advertisements