Hi in Pharo 50 I would like to improve the AST API. often we do not know if an instance variable holds a position or a node and this should be clear. For example I propose to have leftPosition instead of left. Does anybody has a better suggestion? This is really annoying to have to look at the users of an instance variable to understand its role. Stef
I agree. Cheers, Doru On Tue, Mar 31, 2015 at 11:04 AM, stepharo <stepharo@free.fr> wrote:
Hi
in Pharo 50 I would like to improve the AST API. often we do not know if an instance variable holds a position or a node and this should be clear. For example I propose to have leftPosition instead of left. Does anybody has a better suggestion? This is really annoying to have to look at the users of an instance variable to understand its role.
Stef
-- www.tudorgirba.com "Every thing has its own flow"
Le 31/03/2015 11:04, stepharo a écrit :
Hi
in Pharo 50 I would like to improve the AST API. often we do not know if an instance variable holds a position or a node and this should be clear. For example I propose to have leftPosition instead of left.
If you like.
Does anybody has a better suggestion?
Well, I'm allways under the assumption that an instance variable is internal only and that, when querying an AST node, I should allways use its API (is that usually #startPosition and #stopPosition?).
This is really annoying to have to look at the users of an instance variable to understand its role.
Or have a well commented class to understand its role? It is not allways possible to have instantaneously understandable instance variable names. Thierry
what about leftIndex? it's shorter On Tue, Mar 31, 2015 at 12:53 PM, Thierry Goubier <thierry.goubier@gmail.com> wrote:
Le 31/03/2015 11:04, stepharo a écrit :
Hi
in Pharo 50 I would like to improve the AST API. often we do not know if an instance variable holds a position or a node and this should be clear. For example I propose to have leftPosition instead of left.
If you like.
Does anybody has a better suggestion?
Well, I'm allways under the assumption that an instance variable is internal only and that, when querying an AST node, I should allways use its API (is that usually #startPosition and #stopPosition?).
This is really annoying to have to look at the users of an instance variable to understand its role.
Or have a well commented class to understand its role? It is not allways possible to have instantaneously understandable instance variable names.
Thierry
-- Bernardo E.C. Sent from a cheap desktop computer in South America.
I do not know. personally shorter is not a good measure to me. When I spend time understanding code I prefer simpler to understand than cryptic. Now I will have to check what is stored exactly and its meaning. Stef
what about leftIndex? it's shorter
On Tue, Mar 31, 2015 at 12:53 PM, Thierry Goubier <thierry.goubier@gmail.com> wrote:
Le 31/03/2015 11:04, stepharo a écrit :
Hi
in Pharo 50 I would like to improve the AST API. often we do not know if an instance variable holds a position or a node and this should be clear. For example I propose to have leftPosition instead of left.
If you like.
Does anybody has a better suggestion?
Well, I'm allways under the assumption that an instance variable is internal only and that, when querying an AST node, I should allways use its API (is that usually #startPosition and #stopPosition?).
This is really annoying to have to look at the users of an instance variable to understand its role.
Or have a well commented class to understand its role? It is not allways possible to have instantaneously understandable instance variable names.
Thierry
Well, I'm allways under the assumption that an instance variable is internal only and that, when querying an AST node, I should allways use its API (is that usually #startPosition and #stopPosition?).
Me too The implication of my proposal is to also rename all the accessors so that the get proper names... which of course they do not have. Stef
This is really annoying to have to look at the users of an instance variable to understand its role.
Or have a well commented class to understand its role? It is not allways possible to have instantaneously understandable instance variable names.
Thierry
Le 01/04/2015 22:34, stepharo a écrit :
Well, I'm allways under the assumption that an instance variable is internal only and that, when querying an AST node, I should allways use its API (is that usually #startPosition and #stopPosition?).
Me too The implication of my proposal is to also rename all the accessors so that the get proper names... which of course they do not have.
Fair enough. Still, Proper name is proper in a context. I allways try to follow a simple guideline which is: choose a memorable name, adapted to the code it is in use in, and as much as possible understandable. But understandable comes second. And if a long term name is used consistently everywhere, I'll keep it as it is (respecting existing documentation, memory, other developper knowledge and work, etc...) instead of changing it. Thierry
participants (4)
-
Bernardo Ezequiel Contreras -
stepharo -
Thierry Goubier -
Tudor Girba