Page 1 of 1

On the matter of singleton instances and constructors

Posted: Sun Feb 20, 2011 9:24 am
by JensAyton
1.75 warns when you access properties on System or Player instead of system or player. However, these are not the only cases of this problem. The others are, in approximate order of obscurity:
  • Manifest: use player.ship.manifest (preferred), or manifest.
  • PlayerShip: use player.ship.
  • Mission: use mission.
  • Oolite: use oolite.
  • Clock: use clock.
  • MissionVariables: use missionVariables.
  • Global: use global, although in general you should just use foo instead of global.foo.
  • Console: use console.
There are some others, but you shouldn’t even know about them.

I could add warnings for some of these in 1.75.1, if they are known to be widespread problems, but I suspect the most-abused are the first two, and they have complications that make warnings impractical.