I never said it's bad to use a property. I said:
* That if you do it for optimization reasons when there is no need for optimization, you're doing it wrong and should focus on code quality.
* That if this optimization is driven by the belief that GamePlayer() consumes CPU power like crazy rather than the facts (it just delays your script by one frame), you're doing it even more wrong.
* That if you tell others they absolutely need and always have to use a property, you're even more wrong.
* That if you do it because you think a property is cleaner and more elegant than GetPlayer(), then fine. I do not share this opinion but it's mostly subjective.
Now, regarding the general topic of premature/preemptive optimization, there are times where preemptive optimization is fine. Indeed and for example, if you repeatdly do something expensive, it
may be a good idea to cache the result right off the bat. I am not an ayatollah of code, quite the contrary I am very pragmatic and I sometimes had to design architectures with performances in mind from the ground up because of very challenging constrains. But most of the time "preemptive optimization" is just straight premature optimization and in my career I saw many horrors produced by young developers because of this behavior, horrors in terms of code quality, stability and, ironically, performances. The fact is that the consensus in the software industry is that you should first and foremost write a clean code, and the industry is damn right on that point. And the fact you claim that preemptive optimization is now a second nature for you makes me think you're wasting your time and your code and that your code is unlikely to be efficient anyway. I understand this opinion can be offensive and I apologize for this, I am just voicing my opinion honestly.
Finally, I think it would be interesting to (re-)read a few things:
* http://en.wikipedia.org/wiki/KISS_principle.
* http://c2.com/xp/YouArentGonnaNeedIt.html.
Even if you're totally, totally, totally sure that you'll need a feature later on, don't implement it now. Usually, it'll turn out either:
* You don't need it after all
* What you actually need is quite different from what you foresaw needing earlier.
This doesn't mean you should avoid building flexibility into your code. It means you shouldn't overengineer something based on what you think you might need later on. You save time, because you avoid writing code that you turn out not to need. Your code is better, because you avoid polluting it with 'guesses' that turn out to be more or less wrong but stick around anyway.
(replace "feature" with "optimization").
* http://c2.com/cgi/wiki?StructuredProgrammingWithGoToStatements.
This study focuses largely on two issues:
* Improved syntax for iterations and error exits, making it possible to write a larger class of programs clearly and efficiently without goto statements;
* A methodology of program design, beginning with readable and correct, but possibly inefficient programs that are systematically transformed if necessary into efficient and correct, but possibly less readable code.
Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.
A good programmer will not be lulled into complacency by such reasoning, he will be wise to look carefully at the critical code; but only after that code has been identified. It is often a mistake to make a priori judgments about what parts of a program are really critical, since the universal experience of programmers who have been using measurement tools has been that their intuitive guesses fail.
Yeah, goto statements. The article is old, "for" and "while" loops were still a new thing, the CPU power was very small and goto statements were sometimes a way to improve speed and sometimes just a bad habit. Knuth was advocating for the abolishing of goto statements as often as possible, claiming that code quality should come first and that optimization should almost always be reserved for the later stages.