{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/brew/issues/2002","repository_url":"https://api.github.com/repos/Homebrew/brew","labels_url":"https://api.github.com/repos/Homebrew/brew/issues/2002/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/brew/issues/2002/comments","events_url":"https://api.github.com/repos/Homebrew/brew/issues/2002/events","html_url":"https://github.com/Homebrew/brew/issues/2002","id":207091293,"number":2002,"title":"Cleanup `Formula#installed_prefix` and `Formula#installed?`","user":{"login":"vladshablinsky","id":4408920,"avatar_url":"https://avatars.githubusercontent.com/u/4408920?v=3","gravatar_id":"","url":"https://api.github.com/users/vladshablinsky","html_url":"https://github.com/vladshablinsky","followers_url":"https://api.github.com/users/vladshablinsky/followers","following_url":"https://api.github.com/users/vladshablinsky/following{/other_user}","gists_url":"https://api.github.com/users/vladshablinsky/gists{/gist_id}","starred_url":"https://api.github.com/users/vladshablinsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladshablinsky/subscriptions","organizations_url":"https://api.github.com/users/vladshablinsky/orgs","repos_url":"https://api.github.com/users/vladshablinsky/repos","events_url":"https://api.github.com/users/vladshablinsky/events{/privacy}","received_events_url":"https://api.github.com/users/vladshablinsky/received_events","type":"User","site_admin":false},"labels":[{"id":351932343,"url":"https://api.github.com/repos/Homebrew/brew/labels/discussion","name":"discussion","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-12T23:25:37Z","updated_at":"2017-02-13T08:15:35Z","closed_at":null,"body":"I think we should update naming and logic for these methods:\r\n\r\n* `Formula#installed_prefix`\r\n* `Formula#installed?`\r\n\r\nIt seems it will make more and more confusion if we don't rename them. For example `installed_prefix` is a method that is used through `installed?` [to verify whether some dependency is satisfied or not](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dependency.rb#L41-L43) when we need dependency to be up-to-date. AFAIU this is a prior purpose of these methods, but their names can confuse, because `installed_prefix` can return a prefix that doesn't exist pretty often. So the name confuses. We have already faced some cases when `installed_prefix` was used to get latest prefix installed or any prefix installed, but not what it really returns. ([1. Seems to be related](https://github.com/Homebrew/brew/issues/1952),  [2.](https://github.com/Homebrew/brew/pull/1296)) Frankly, it again took me some time to understand what's going on in there even though I knew these methods.\r\n\r\n[Here](https://github.com/Homebrew/brew/pull/1296#issuecomment-255526802)  @MikeMcQuaid suggested that we rename `installed?` to `latest_installed?`. It's a good point. I think we should reconsider our `*prefix` methods in terms of naming and probably logic as well. So we'll have something like these left:\r\n\r\n* `latest_prefix`\r\n* `installed_prefix`\r\n* `latest_installed_prefix`\r\n* probably do some renamings in similar `HEAD` methods as well.\r\n\r\nHow does this sound @Homebrew/maintainers ? "},"comment":{"url":"https://api.github.com/repos/Homebrew/brew/issues/comments/279320086","html_url":"https://github.com/Homebrew/brew/issues/2002#issuecomment-279320086","issue_url":"https://api.github.com/repos/Homebrew/brew/issues/2002","id":279320086,"user":{"login":"MikeMcQuaid","id":125011,"avatar_url":"https://avatars.githubusercontent.com/u/125011?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeMcQuaid","html_url":"https://github.com/MikeMcQuaid","followers_url":"https://api.github.com/users/MikeMcQuaid/followers","following_url":"https://api.github.com/users/MikeMcQuaid/following{/other_user}","gists_url":"https://api.github.com/users/MikeMcQuaid/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeMcQuaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeMcQuaid/subscriptions","organizations_url":"https://api.github.com/users/MikeMcQuaid/orgs","repos_url":"https://api.github.com/users/MikeMcQuaid/repos","events_url":"https://api.github.com/users/MikeMcQuaid/events{/privacy}","received_events_url":"https://api.github.com/users/MikeMcQuaid/received_events","type":"User","site_admin":true},"created_at":"2017-02-13T08:15:35Z","updated_at":"2017-02-13T08:15:35Z","body":"I agree with renaming but we'll need to maintain a compatibility layer for the old names for those that are public APIs."}}
{"actor":{"display_login":"MikeMcQuaid"}}