Robot name is ambiguous with regard to created vs booted

Open
#1,831 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript
Domain
documentation

Research direction

Start with exercises/robot-name/description.md, especially the wording about a robot coming off the factory floor and being turned on. Review the existing exercise expectations and determine whether the lifecycle needs an explicit state or clearer wording; done means the creation, name-query, and first-power-on behavior are unambiguous for implementers.

Written by the indexing model from the issue text.

Description

From the description:

When a robot comes off the factory floor, it has no name.
The first time you turn on a robot, a random name is generated

Yet most solutions / tests I've seen never make the "states"/timeline clear... what is the equivalent of "coming off the factory floor"? Most assume it's new Robot() or some such, ie the instantiation of the robot instances (in OOP languages), which makes sense. This might be a lot more literal if there was a RobotFactory though that created the robots instead of just a regular constructor (not that I'm arguing for that).

So, is the robot also ON at that time, or is that a step performed later? Many seem to think the robot isn't "on" until first queried for it's name and so therefore:

r = new Robot()
// r.name is null (but not always an easy way to query this)
r.name
// r.name has been assigned

I think this is ambiguous and unsatisfying though. One could obviously (via a direct access cable or some other method) query a robot name without powering on the robot, in case I would expect there to be no name - if it had not yet been turned on.

So I dislike the ambiguity regarding when a robot is "ON". I would suggest:

r = new Robot()
// r.name is null
r.name
// r.name is null
r.boot() // or r.turnOn(), etc
// r.name has been assigned

Ie:

  • A newly constructed robot has no name
  • Querying the name does not change the name
  • A robot's name is generated "The first time you turn on a robot", as the instructions say literally.
  • We make this on event explicit and part of the exercise

Thoughts?

Dominant language
Ruby
Stars
362
Forks
566
Avg merge
15h 13m
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from exercism/problem-specifications

All issues in exercism/problem-specifications

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.