{"action":"created","issue":{"url":"https://api.github.com/repos/WasabiFan/ev3dev-lang-js/issues/8","repository_url":"https://api.github.com/repos/WasabiFan/ev3dev-lang-js","labels_url":"https://api.github.com/repos/WasabiFan/ev3dev-lang-js/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/WasabiFan/ev3dev-lang-js/issues/8/comments","events_url":"https://api.github.com/repos/WasabiFan/ev3dev-lang-js/issues/8/events","html_url":"https://github.com/WasabiFan/ev3dev-lang-js/issues/8","id":143302744,"number":8,"title":"Commands are verbs and should map to functions","user":{"login":"nathanboktae","id":1989335,"avatar_url":"https://avatars.githubusercontent.com/u/1989335?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanboktae","html_url":"https://github.com/nathanboktae","followers_url":"https://api.github.com/users/nathanboktae/followers","following_url":"https://api.github.com/users/nathanboktae/following{/other_user}","gists_url":"https://api.github.com/users/nathanboktae/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanboktae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanboktae/subscriptions","organizations_url":"https://api.github.com/users/nathanboktae/orgs","repos_url":"https://api.github.com/users/nathanboktae/repos","events_url":"https://api.github.com/users/nathanboktae/events{/privacy}","received_events_url":"https://api.github.com/users/nathanboktae/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-24T17:00:44Z","updated_at":"2016-03-24T18:00:06Z","closed_at":null,"body":"Let's look at the sentence \"Rotate 90 degrees at half power and then stop\":\r\n\r\n```\r\n(S (S (VP Rotate\r\n          (NP 90 degrees)\r\n          (PP at\r\n              (NP half))))\r\n   power and\r\n   (S (VP (ADVP then)\r\n          stop)))\r\n```\r\n\r\nIt starts out with verbs, with are associated with noun phrases and verb phrases. It's an action; a command to something, like a tacho-motor. It's not an object, or noun.\r\n\r\nYet your example for this is to [set a bunch of properties on an object](https://github.com/WasabiFan/ev3dev-lang-js/blob/679078632fb8424d41f74ace523a9151dff3c47a/examples/run-specific-motor.js#L9-L13):\r\n\r\n```javascript\r\nmotor.positionSp = 180;\r\nmotor.speedSp = 500;\r\nmotor.stopCommand = 'brake';\r\nmotor.command = \"run-to-rel-pos\";\r\n```\r\n\r\nrather than calling a function (method) like this:\r\n\r\n```javascript\r\nmotor.runToRelativePosition(180, 500, 'brake')\r\n```\r\n\r\nPlease let's use functions here. It's the cleaner, sane way to interact with the motors and sensors. "},"comment":{"url":"https://api.github.com/repos/WasabiFan/ev3dev-lang-js/issues/comments/200950968","html_url":"https://github.com/WasabiFan/ev3dev-lang-js/issues/8#issuecomment-200950968","issue_url":"https://api.github.com/repos/WasabiFan/ev3dev-lang-js/issues/8","id":200950968,"user":{"login":"WasabiFan","id":3310349,"avatar_url":"https://avatars.githubusercontent.com/u/3310349?v=3","gravatar_id":"","url":"https://api.github.com/users/WasabiFan","html_url":"https://github.com/WasabiFan","followers_url":"https://api.github.com/users/WasabiFan/followers","following_url":"https://api.github.com/users/WasabiFan/following{/other_user}","gists_url":"https://api.github.com/users/WasabiFan/gists{/gist_id}","starred_url":"https://api.github.com/users/WasabiFan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WasabiFan/subscriptions","organizations_url":"https://api.github.com/users/WasabiFan/orgs","repos_url":"https://api.github.com/users/WasabiFan/repos","events_url":"https://api.github.com/users/WasabiFan/events{/privacy}","received_events_url":"https://api.github.com/users/WasabiFan/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T18:00:06Z","updated_at":"2016-03-24T18:00:06Z","body":"Although I agree that these commands _should_ be invoke-able as functions for optimal usability, in practice I simply haven't had time to do much to improve this library recently. I am very busy with \"real life\", so without seeing any signs that people were using my code I didn't see a reason to push up the priority and get it done soon. I already have a note in #4 that this is a feature that I need to add.\r\n\r\nAs it stands, this library is a direct wrapper of ev3dev's file-system APIs, hence the peculiar `command = ...` idioms. The enhanced usability makes it much easier to use but you can still access all functionality through the setter interfaces that already exist.\r\n\r\nI already have some of these methods implemented for motors [here](https://github.com/WasabiFan/ev3dev-lang-js/blob/develop/src/motors.ts#L456-L512) -- I suspect that that's mainly what you are looking for. So yes, it's a feature that I plan to add; but that requires time that I don't have at the moment. I'll see if I can get this done in a few days/weeks, but as always PRs are welcome!\r\n\r\nP.S. The tone of your post makes me think that something else has frustrated you with this code -- are the docs for existing functionality lacking, or is it something else that's making it difficult?"}}