I have generously used prefix for methods 'get' without any 'set'. I think there is no convention and my code readability is generally dictated by common sense and ease of understanding.
Another point is that functions/methods sgould always be verbs as long as possible. So pointPositions() to me does not feel like a natural function that 'does' something. I would definitely use descriptor protocol (@property) wherever I can. It makes code beautiful, plus readonly attrs are easily managed by absence of a @setter.attr. So overall, I would not stay away from get_ prefix in absence of a set_ On Tue, May 11, 2021, 22:34 Rudi Hammad <rudiham...@gmail.com> wrote: > > So, I get the feeling that there isn't a clear naming convenction when it > comes to use "get" as a prefix. I am not refering to the python @property, > nor getter/setter methods. I am talking about normal methods. > > My criteria is: > when ever I prefix a method with "get" it is because I am implying there > is a "set". By doing that, just by this naming it hints the reader if it is > a getter or normal method. > For instance, I do ~.pointsPositions() not ~.getPointsPositions(). > Reading that I am trying to hint the reader that there is no > setPointsPositions(). > > Reading different apis, it seems there isn't a clear convention for this. > Even within the same api you can find the prefix "get" almost randomly. > Sometimes it might even be a getter that is not prefixed with get, but has > its corresponding setter with the prefix "set". > > thoughts? > > R > > > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to python_inside_maya+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/d1ebae5b-3343-4e94-8829-4879b11a6e68n%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/d1ebae5b-3343-4e94-8829-4879b11a6e68n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMSWzT9nTkvj6K5Cjo98b46YtFQXC8orA-kP8xs4fTmBwg%40mail.gmail.com.