{"action":"created","issue":{"url":"https://api.github.com/repos/exercism/xerlang/issues/123","repository_url":"https://api.github.com/repos/exercism/xerlang","labels_url":"https://api.github.com/repos/exercism/xerlang/issues/123/labels{/name}","comments_url":"https://api.github.com/repos/exercism/xerlang/issues/123/comments","events_url":"https://api.github.com/repos/exercism/xerlang/issues/123/events","html_url":"https://github.com/exercism/xerlang/issues/123","id":186914799,"number":123,"title":"robot-simulator requires global state","user":{"login":"katsel","id":6429934,"avatar_url":"https://avatars.githubusercontent.com/u/6429934?v=3","gravatar_id":"","url":"https://api.github.com/users/katsel","html_url":"https://github.com/katsel","followers_url":"https://api.github.com/users/katsel/followers","following_url":"https://api.github.com/users/katsel/following{/other_user}","gists_url":"https://api.github.com/users/katsel/gists{/gist_id}","starred_url":"https://api.github.com/users/katsel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katsel/subscriptions","organizations_url":"https://api.github.com/users/katsel/orgs","repos_url":"https://api.github.com/users/katsel/repos","events_url":"https://api.github.com/users/katsel/events{/privacy}","received_events_url":"https://api.github.com/users/katsel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-02T20:43:40Z","updated_at":"2016-11-15T12:25:02Z","closed_at":null,"body":"I tried to do the robot-simulator exercise today and found it very difficult. It seems like one has to use global state for the example - functions to manipulate the robot [don't have a return value](https://github.com/exercism/xerlang/blob/master/exercises/robot-simulator/robot_simulator_tests.erl#L12), so the current state of the robot needs to be kept somewhere else. I found that very confusing.\r\n\r\nAs far as I could see, people doing this exercise have come up with 3 different solutions for this:\r\n* a) use a FSM with either message passing/receiving or the `gen_fsm` pattern\r\n* b) store state in an `ets` table\r\n* c) modify the tests to return a new robot each time there is a change in state.\r\n\r\na) is rather complicated and requires advanced knowledge of Erlang-specific patterns that I wouldn't assume most beginners have. Even if beginners manage to find out about these patterns, all these things distracts from the actual exercise (which is difficult enough on its own). \r\n\r\nb) is more simple to implement (once you know what you are looking for), but it's actively discouraging people from using functional programming style like you'd usually do as an Erlang beginner, and as the other exercises have shown.\r\n\r\nc) Seems to be the most natural way to do this in Erlang - generate a robot, and each time you manipulate it, return a new robot object with a new, appropriate state and continue working with that object. Currently that'd be a hack.\r\n\r\nLong story short, I'd suggest to change the exercise so one doesn't need to worry about global state and/or fsm patterns to solve it. Making the robot behave as expected is challenging enough on its own - worries about 'where do I store the state of my robot' should not be such a large part of the exercise."},"comment":{"url":"https://api.github.com/repos/exercism/xerlang/issues/comments/260627752","html_url":"https://github.com/exercism/xerlang/issues/123#issuecomment-260627752","issue_url":"https://api.github.com/repos/exercism/xerlang/issues/123","id":260627752,"user":{"login":"NobbZ","id":58951,"avatar_url":"https://avatars.githubusercontent.com/u/58951?v=3","gravatar_id":"","url":"https://api.github.com/users/NobbZ","html_url":"https://github.com/NobbZ","followers_url":"https://api.github.com/users/NobbZ/followers","following_url":"https://api.github.com/users/NobbZ/following{/other_user}","gists_url":"https://api.github.com/users/NobbZ/gists{/gist_id}","starred_url":"https://api.github.com/users/NobbZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NobbZ/subscriptions","organizations_url":"https://api.github.com/users/NobbZ/orgs","repos_url":"https://api.github.com/users/NobbZ/repos","events_url":"https://api.github.com/users/NobbZ/events{/privacy}","received_events_url":"https://api.github.com/users/NobbZ/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T12:25:02Z","updated_at":"2016-11-15T12:25:02Z","body":"If the difficulty were easily measurable in an objective way I had done it already and sorted accordingly, but a difficulty is a very subjective thing.\r\n\r\nEg. I do program (as a hobby and self taught) since about 1990, I started studying CS 3 years ago. I just used processes to solve the robot exercise without even thinking about it. Others do find this aspect of the exercise very hard to come around as I do understand your issue.\r\n\r\nBut yes, the range you guessed is correct, it is from 1 (easiest) to 10 (hardest). This correlates to the specification of the JSON.\r\n\r\nAnother thing is, that I do not have any possibility to alter the README of an exercise. It is assembled from a central README for that exercise, roughly describing the task as well as a generic part for the language which should explain how to run a test, but this part is specific to the hole track.\r\n\r\nIt is common though through the tracks to have an HINTS.md or hints folder, which contains additional information or stuff to help out with the exercise. Adding those is on my TODO.\r\n\r\nBut I have to admit, my 2016 overhaul will probably not be finished before February or March 2017 :("}}
{"actor":{"display_login":"NobbZ"}}