exercism / ruby

Exercism exercises in Ruby.
https://exercism.org/tracks/ruby
MIT License
556 stars 519 forks source link

linked list naming #9

Closed markijbema closed 9 years ago

markijbema commented 10 years ago

The link list exercise requires a file linked_list.rb, but a class Deque.

markijbema commented 10 years ago

The exercise also refers to another exercise in the readme, simple-linked-list, but that exercise actually is later, not earlier.

markijbema commented 10 years ago

Also, the tests aren't really TDD-ish. Each one requires a lot of implementation, whereas other exercises have tests which are more guiding. for instance, a first test having only one push, and one pop would allow you to create an simple first version, on which the current first test could expand.

markijbema commented 10 years ago

I'm also deeply unsatisfied by implementing a broken list. The tests provide way less coverage than most other exercises, partly to 'keep the implementation simple'. But simple is also wrong in this case. Maybe it would be better to make this a linked list instead of a doubly linked list? This kind of code is really tricky, so maybe a simpler exercise first would be better.

kytrinyx commented 10 years ago

I didn't write it and haven't solved it... which just means that I don't have a lot of context to have an opinion. From reading your comments, I'd say that if I did actually try it out I'd probably agree with you.

I'm seeing a number of suggestions here:

Am I missing something?

markijbema commented 10 years ago

Yeah, sorry, it turned a bit into a rant ;) For context, here is my submission, which doesn't fail, but is (imo) horribly broken: http://exercism.io/submissions/a9e1cd4040de6720a904c28a

I'm not sure about moving the simlpe linked list. It's at the end, so it might also be that it has been discarded? Personally, I wouldn't really appreciate two linked lists exercises either. I think there should be one, and it should be simpler than this one, or if it isn't, have a better build-up in the tests.

I think the most important thing about improving the tests is having a better buildup. When doing proper TDD, the idea is that you write code for a failing tests. Since there is a lot of branches and subtleties here, you need a lot of tests to guide you through them. I think this especially true for exercism, which is used (at least, this is my impression) by a lot of people without formal CS background. Then algorithms and datastructures are the more complex exercises, and the current tests don't guide the implementation, they're really more regression tests.

kytrinyx commented 10 years ago

Yeah, sorry, it turned a bit into a rant ;)

It's much appreciated!

It's at the end, so it might also be that it has been discarded?

Oh. Yeah, this is ringing a bell. I think I decided to deprecate it, but I wasn't sure if deprecating it would break things. I'll delete it.

I think you're right about the regression tests.

kotp commented 9 years ago

:fist: bump. Just to find out if this needs to still be open.

kytrinyx commented 9 years ago

This was fixed. Thanks.