I just finished my Master degree, and I had a really technical teacher which always told us:
The oracle should always be at the left of equalities and comparisons
As I am French, the exact sentence would be:
L'oracle doit toujours être à gauche des égalités et comparaisons
The word 'oracle' refers here to the constant, so instead of writing:
mystring.equals("foo");
we should write
"foo".equals(mystring);
I never had the cleverness to ask him why, as I just listened to him about technical advices. I feel quite dumb right now, so there is my question:
Aside for a style point of view, is there any technical reason, such as optimization or performance or anything like that, to write the constants at the left of equalities/comparisons ?
Thank you in advance !