{"action":"reopened","issue":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/5679","repository_url":"https://api.github.com/repos/ARMmbed/mbed-os","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/5679/labels{/name}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/5679/comments","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/5679/events","html_url":"https://github.com/ARMmbed/mbed-os/issues/5679","id":280649109,"node_id":"MDU6SXNzdWUyODA2NDkxMDk=","number":5679,"title":"header files should not have `using` statements (namespaces)","user":{"login":"bmcdonnell-ionx","id":34172339,"node_id":"MDQ6VXNlcjM0MTcyMzM5","avatar_url":"https://avatars2.githubusercontent.com/u/34172339?v=4","gravatar_id":"","url":"https://api.github.com/users/bmcdonnell-ionx","html_url":"https://github.com/bmcdonnell-ionx","followers_url":"https://api.github.com/users/bmcdonnell-ionx/followers","following_url":"https://api.github.com/users/bmcdonnell-ionx/following{/other_user}","gists_url":"https://api.github.com/users/bmcdonnell-ionx/gists{/gist_id}","starred_url":"https://api.github.com/users/bmcdonnell-ionx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmcdonnell-ionx/subscriptions","organizations_url":"https://api.github.com/users/bmcdonnell-ionx/orgs","repos_url":"https://api.github.com/users/bmcdonnell-ionx/repos","events_url":"https://api.github.com/users/bmcdonnell-ionx/events{/privacy}","received_events_url":"https://api.github.com/users/bmcdonnell-ionx/received_events","type":"User","site_admin":false},"labels":[{"id":431602819,"node_id":"MDU6TGFiZWw0MzE2MDI4MTk=","url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/closed_in_jira","name":"closed_in_jira","color":"ededed","default":false},{"id":515345182,"node_id":"MDU6TGFiZWw1MTUzNDUxODI=","url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/component:%20drivers","name":"component: drivers","color":"5319e7","default":false},{"id":427713129,"node_id":"MDU6TGFiZWw0Mjc3MTMxMjk=","url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/mirrored","name":"mirrored","color":"ededed","default":false},{"id":28847981,"node_id":"MDU6TGFiZWwyODg0Nzk4MQ==","url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/type:%20enhancement","name":"type: enhancement","color":"cccccc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2017-12-08T23:40:14Z","updated_at":"2018-08-03T15:53:07Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Description\r\n- Type: Bug | Enhancement\r\n\r\nSeveral mbed-os header files have `using` statements in them. Most notably in `mbed.h`:\r\n\r\n```\r\nusing namespace mbed;\r\nusing namespace std;\r\n```\r\n\r\n---------------------------------------------------------------\r\n**Reason to enhance or problem with existing solution**\r\n\r\nThere are [plenty](http://www.lonecpluspluscoder.com/2012/09/22/i-dont-want-to-see-another-using-namespace-xxx-in-a-header-file-ever-again/) of [online](http://umich.edu/~eecs381/handouts/NamespaceGuide.pdf) references [explaining](https://stackoverflow.com/questions/4872373/why-is-including-using-namespace-into-a-header-file-a-bad-idea-in-c) why having `using` statements in header files is bad practice. In brief, it pollutes the global namespace for your users.\r\n\r\n**Suggested enhancement**\r\n\r\nAll `using` statements should be removed from all header files.\r\n\r\n**Pros**\r\n\r\nDon't pollute your users' namespaces, forcing them to change their module names or create namespaces to avoid name collisions with your stuff.\r\n\r\nAlso, this gives users the option of always having namespace prefixes on things if they want it - and having the compiler enforce that - if they find that useful, in whatever situations.\r\n\r\n**Cons**\r\n\r\nGranted, it is a painful change for users who relied on it, so a migration plan is appropriate. e.g. Maybe explain the change in the release notes in mbed-os 5.7 or 5.8 or 6.0 that these `using` statements have been removed, and users can add the statements to their source files if they wish to minimize code changes."}}
{"actor":{"display_login":"deepikabhavnani"}}