{"action":"created","issue":{"url":"https://api.github.com/repos/nteract/hydrogen/issues/199","repository_url":"https://api.github.com/repos/nteract/hydrogen","labels_url":"https://api.github.com/repos/nteract/hydrogen/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/nteract/hydrogen/issues/199/comments","events_url":"https://api.github.com/repos/nteract/hydrogen/issues/199/events","html_url":"https://github.com/nteract/hydrogen/issues/199","id":140996244,"number":199,"title":"[DISCUSSION] Avoid \"Java getters\"","user":{"login":"n-riesco","id":6199391,"avatar_url":"https://avatars.githubusercontent.com/u/6199391?v=3","gravatar_id":"","url":"https://api.github.com/users/n-riesco","html_url":"https://github.com/n-riesco","followers_url":"https://api.github.com/users/n-riesco/followers","following_url":"https://api.github.com/users/n-riesco/following{/other_user}","gists_url":"https://api.github.com/users/n-riesco/gists{/gist_id}","starred_url":"https://api.github.com/users/n-riesco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n-riesco/subscriptions","organizations_url":"https://api.github.com/users/n-riesco/orgs","repos_url":"https://api.github.com/users/n-riesco/repos","events_url":"https://api.github.com/users/n-riesco/events{/privacy}","received_events_url":"https://api.github.com/users/n-riesco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-15T14:55:00Z","updated_at":"2016-06-13T09:43:23Z","closed_at":null,"body":"I've been reading through more of Hydrogen's code and I've noticed an inconsistent use of what I call here \"Java getters\" (sometimes, we use the method, `getElement`; sometimes, we access the property `element` directly).\r\n\r\nFor example, if I grep the code for `getElement` and `.element`:\r\n\r\n```sh\r\n$ grep -nr getElement lib\r\nlib/main.coffee:86:            @setStatusBarElement kernel.statusView.getElement()\r\nlib/main.coffee:131:            @setStatusBarElement kernel.statusView.getElement()\r\nlib/main.coffee:153:        element = view.getElement()\r\nlib/result-view.coffee:210:    getElement: ->\r\nlib/status-view.coffee:24:    getElement: ->\r\n$ grep -nr \"\\.element\" lib\r\nlib/watch-view.coffee:14:        @inputElement.element.classList.add('watch-input')\r\nlib/watch-view.coffee:25:        @element.appendChild(@inputElement.element)\r\nlib/watch-view.coffee:26:        @element.appendChild(@resultView.element)\r\nlib/watch-view.coffee:106:            @element.removeChild(@resultView.element)\r\nlib/watch-view.coffee:113:        @element.appendChild(@resultView.element)\r\nlib/main.coffee:127:            else if @watchSidebar.element.contains document.activeElement\r\nlib/watch-sidebar.coffee:47:            @watchesContainer.appendChild(watch.element)\r\nlib/watch-sidebar.coffee:84:            @watchesContainer.appendChild watch.element\r\nlib/watch-sidebar.coffee:88:        @createWatch().inputElement.element.focus()\r\n```\r\n\r\nThere is no need for \"Java getters\" like `getElement`, we can always define them in Javascript like [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get).\r\n\r\nUnless there is a usage that I'm missing, I would like to remove all the \"Java getters\" in Hydrogen."},"comment":{"url":"https://api.github.com/repos/nteract/hydrogen/issues/comments/225535013","html_url":"https://github.com/nteract/hydrogen/issues/199#issuecomment-225535013","issue_url":"https://api.github.com/repos/nteract/hydrogen/issues/199","id":225535013,"user":{"login":"n-riesco","id":6199391,"avatar_url":"https://avatars.githubusercontent.com/u/6199391?v=3","gravatar_id":"","url":"https://api.github.com/users/n-riesco","html_url":"https://github.com/n-riesco","followers_url":"https://api.github.com/users/n-riesco/followers","following_url":"https://api.github.com/users/n-riesco/following{/other_user}","gists_url":"https://api.github.com/users/n-riesco/gists{/gist_id}","starred_url":"https://api.github.com/users/n-riesco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n-riesco/subscriptions","organizations_url":"https://api.github.com/users/n-riesco/orgs","repos_url":"https://api.github.com/users/n-riesco/repos","events_url":"https://api.github.com/users/n-riesco/events{/privacy}","received_events_url":"https://api.github.com/users/n-riesco/received_events","type":"User","site_admin":false},"created_at":"2016-06-13T09:43:23Z","updated_at":"2016-06-13T09:43:23Z","body":"This would do:\r\n```coffeescript\r\nclass SignalListView extends SelectListView\r\n    initialize: (@kernels)->\r\n```"}}
{"actor":{"display_login":"n-riesco"}}