Talk:Getter and setter policy
Line 7: | Line 7: | ||
If the object has to call its getters and settings to change its own variables then changes to the variables internally would be subjected to the same constraints as calls through the public interface. This also would mean that internal calls would always have the same constraints as public calls. Would you want this? I mean might there be exceptions to this rule? --[[User:BenMcDonald|BenMcDonald]] 06:44, 28 July 2009 (UTC) | If the object has to call its getters and settings to change its own variables then changes to the variables internally would be subjected to the same constraints as calls through the public interface. This also would mean that internal calls would always have the same constraints as public calls. Would you want this? I mean might there be exceptions to this rule? --[[User:BenMcDonald|BenMcDonald]] 06:44, 28 July 2009 (UTC) | ||
− | sure there would be exceptions for example dealing with a collection --[[User:AlexGee|AlexGee]] 09:45, 28 July 2009 (UTC) | + | sure there would be exceptions for example dealing with a collection. Thus I used 'ideally' --[[User:AlexGee|AlexGee]] 09:45, 28 July 2009 (UTC) |
Revision as of 09:48, 28 July 2009
Don't tell me everyone agrees where is the fun in that?
I just have to completely agree with the first paragraph. I also try to always use this->FunctionName() to make the difference between internal and external function calls clear. Python, for instance, enforces such a syntax ( self.FunctionName() ). --TobiW
Very nice little style guide there, I would back that 100% --AlexGee 02:09, 28 July 2009 (UTC)
If the object has to call its getters and settings to change its own variables then changes to the variables internally would be subjected to the same constraints as calls through the public interface. This also would mean that internal calls would always have the same constraints as public calls. Would you want this? I mean might there be exceptions to this rule? --BenMcDonald 06:44, 28 July 2009 (UTC)
sure there would be exceptions for example dealing with a collection. Thus I used 'ideally' --AlexGee 09:45, 28 July 2009 (UTC)