exercism/elixir

Tuple Binary Search Exercise Inaccuracies

Closed this issue · 1 comments

Looking at the Elixir documentation at https://hexdocs.pm/elixir/1.12/Tuple.html, a Tuple consists of elements. The position of an element is referred to as the index. Neither "key", nor "value" are terms that you find in the Tuple documentation.

This exercise however talks about keys and values, which is inaccurate. This phrase in the starter code makes it even worse: "Searches for a key in the tuple using the binary search algorithm. It returns :not_found if the key is not in the tuple."

I'm not searching for a key, I'm searching for an element that has a certain value, and then return the key index of this element.

Practice exercise instructions come from a shared repository and each track on Exercism is required to have exactly the same instructions for each exercise. I can't change them here to be Elixir-specific. If you have suggestions on how to improve this particular introduction to make it more generic and more likely to fit all programming languages, you can create an issue or a pull request in the exercism/problem-specifications repository. The file in question is this one: https://github.com/exercism/problem-specifications/blob/main/exercises/binary-search/description.md

I'm not searching for a key, I'm searching for an element that has a certain value

The term "key" can mean many things in computer science, one of them is just a synonym for "unique identifier" which is what's mean in this context (see: https://cs.stackexchange.com/questions/107439/what-is-a-key-in-computer-science).