{"action":"created","issue":{"url":"https://api.github.com/repos/IENT/YUView/issues/66","repository_url":"https://api.github.com/repos/IENT/YUView","labels_url":"https://api.github.com/repos/IENT/YUView/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/IENT/YUView/issues/66/comments","events_url":"https://api.github.com/repos/IENT/YUView/issues/66/events","html_url":"https://github.com/IENT/YUView/issues/66","id":190604523,"number":66,"title":"Class member variable prefixes have a place. ","user":{"login":"KubaO","id":5444571,"avatar_url":"https://avatars.githubusercontent.com/u/5444571?v=3","gravatar_id":"","url":"https://api.github.com/users/KubaO","html_url":"https://github.com/KubaO","followers_url":"https://api.github.com/users/KubaO/followers","following_url":"https://api.github.com/users/KubaO/following{/other_user}","gists_url":"https://api.github.com/users/KubaO/gists{/gist_id}","starred_url":"https://api.github.com/users/KubaO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KubaO/subscriptions","organizations_url":"https://api.github.com/users/KubaO/orgs","repos_url":"https://api.github.com/users/KubaO/repos","events_url":"https://api.github.com/users/KubaO/events{/privacy}","received_events_url":"https://api.github.com/users/KubaO/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-21T02:26:38Z","updated_at":"2016-11-22T06:43:28Z","closed_at":null,"body":"Currently, we don't want to use class member prefixes for variables. It is suggested that \"modern IDEs\" remove the need for that.\r\n\r\nYet the reason for them usually isn't to do with IDEs. The major and primary reason is that it makes certain method names impossible to use:\r\n\r\n    private:\r\n      int foo;\r\n    public:\r\n      int foo() const; // won't compile\r\n      int getFoo() const; // will compile, but forces a `get` prefix on a public API\r\n\r\nWhen using the `get` prefix on getters, we're making the prefix a part of the API, yet the only need for the prefix is an implementation detail. In Qt, as in the standard library, getters have no prefix. We say `pixmap.size()` or `vector.size()`, not `pixmap.getSize()`.\r\n\r\nIt's better to have e.g. a private 'm_' member prefix to allow sane member names than to force convoluted public names in the API or member names to avoid clashes. Thus, I suggest we should perhaps prefer this:\r\n\r\n    private:\r\n      int m_foo; // private m_prefix\r\n    public:\r\n      int foo() const { return m_foo; }\r\n\r\nThis issue is a call for discussion only. "},"comment":{"url":"https://api.github.com/repos/IENT/YUView/issues/comments/262160715","html_url":"https://github.com/IENT/YUView/issues/66#issuecomment-262160715","issue_url":"https://api.github.com/repos/IENT/YUView/issues/66","id":262160715,"user":{"login":"JensAc","id":17930863,"avatar_url":"https://avatars.githubusercontent.com/u/17930863?v=3","gravatar_id":"","url":"https://api.github.com/users/JensAc","html_url":"https://github.com/JensAc","followers_url":"https://api.github.com/users/JensAc/followers","following_url":"https://api.github.com/users/JensAc/following{/other_user}","gists_url":"https://api.github.com/users/JensAc/gists{/gist_id}","starred_url":"https://api.github.com/users/JensAc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JensAc/subscriptions","organizations_url":"https://api.github.com/users/JensAc/orgs","repos_url":"https://api.github.com/users/JensAc/repos","events_url":"https://api.github.com/users/JensAc/events{/privacy}","received_events_url":"https://api.github.com/users/JensAc/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T06:43:28Z","updated_at":"2016-11-22T06:43:28Z","body":"I think it is a good idea to have the get prefix, as it is still more conventional to search for getters, if you are new to the code. However modern IDE's will remove the need for that, if it is done by colors, that would not help a colorblind. By the way, the same holds for local variables and members. So, if you ask me, we should stick to the current naming convention and should also use ` this->` in order to make sure that everyone gets the scope of a variable directly."}}
{"actor":{"display_login":"JensAc"}}