I run into this situation constantly: there is some property that I need to access frequently, and accessing that property requires an obnoxious amount of syntax, so my code ends up being 10x bulkier (and less readable) than in needs to be.
For example, let's say there is a property, called "property1", that can be accessed using the following syntax:
"exampleDictionary[exampleKey].exampleObject.exampleArray[exampleIndex].property1"
...so any time I want to access this property I have to write this extremely long syntax. It would be so so great if there were I way to define an alias for this property, something like this:
propertyalias prop = exampleDictionary[exampleKey].exampleObject.exampleArray[exampleIndex].property1
that way if I wanted to multiply property1 by 2, for example, instead of having to write all this:
exampleDictionary[exampleKey].exampleObject.exampleArray[exampleIndex].property1 = exampleDictionary[exampleKey].exampleObject.exampleArray[exampleIndex].property * 2
I could just write this:
prop = prop * 2
which is WAY more readable.
Is there a way to do this?