Ruby/Javascript: Linked Lists -- Make clear the structure of the Node class
Checks
- [X] This is not a duplicate of an existing issue (please have a look through our open issues list to make sure)
- [X] I have thoroughly read and understand The Odin Project Contributing Guide
- [X] Would you like to work on this issue?
Describe your suggestion
I have seen people in discord (ruby-help channel) express some confusion over the structure of the Node class in the Linked List project. For reference, the node class is described as:
(Ruby)
"Node class, containing a #value method and a link to the #next_node, set both as nil by default."
(Javascript)
"Node class / factory, containing a value property and a link to the nextNode, set both as null by default."
I propose we change the descriptions to this:
(Ruby)
"Node class, conatining two instance variables, value and next_node, set both as nil by default."
(Javascript)
"Node class / factory, containing a value property and a nextNode property, set both as null by default."
Admittedly, the Ruby description is more confusing than the JS description: it specifies #value and #next_node as instance methods, with #next_node somehow "linking" to the next node in the list. But what is really to be inferred from this is something like "The node class should have 2 instance variable, @value and @next_node, with getters and setters for both of them. The @next_node variable will store a reference to the next node in the list".
My intention with my proposed changes is to make explicit the structure of the class without explicitly explaining exactly how the nodes of the LL will be linked to each other.
Path
Ruby / Rails, Node / JS
Lesson Url
https://www.theodinproject.com/lessons/ruby-linked-lists#assignment
(Optional) Discord Name
No response
(Optional) Additional Comments
No response
Seems like mostly a good idea to me. I think the Ruby one would be clearer if learners were exposed to more interface behavior type instructions, but that's not the case with the current OOP lessons and other projects.
Anyways, since your descriptions seem good to me. I'll assign you.