Why we are allowed to have spaces in scene names but not for

…objects?

Because objects can be used in expressions as identifiers (MyObject.X()) and identifiers with spaces can not be parsed properly.
Scenes names are always used as strings (so you refer at it with quotes: “My scene”) and are not identifiers, so spaces are authorized.

Hmm, while I understand reasons behind this, why not just function SceneObjects(“name”), like we do for variables?

It could be a solution, but it would be also more verbose and less performant because having a string expression needs to evaluate it instead of directly calling the object method.
I prefer to only have one clear syntax for accessing objects properties/methods : MyObject.method, as in any programming language :slight_smile:

Doesn’t C++ have key-value dictionaries? If so, you could just make “dictionary” for objects, where name is a key and value is actual object. It shouldn’t be much slower than current system. Because now it is confusing for newcomers. Either allow it in neither or in both.