Skip to content

Are Computer Science exercises a good fit the exercism platfom. #124

Closed
@remcopeereboom

Description

@remcopeereboom

I am noticing that a lot of the exercisms that ask users to implement a data structure or classical algorithm are not a very good fit on exercism. We've had some discussion about this on the xruby repository (e.g. #495 #513 on xruby) and I was wondering if other people have noticed the same thing in other language tracks.

Some issues:

  1. No freedom to explore
    As it stands many of the tests force a very distinct implementation. This may be important didactically, but is kind of counter to exploring the problem. I've also found that many of the implementations forced by the tests are imho just not very good. But clearly other people disagree so I feel there should be more leeway
  2. No discussion about use cases
    Many of the data structures are used for very particular thing. There are reasons why in some cases you might want to use a linked list and in others you might want to use an array (to name but one example), but the problems do not make this clear.
  3. No discussion about performance
    A lot of the data structures and classic algorithms require knowledge about basic algorithmic analysis. There is a binary search exercism on xruby that requires people to check that the input is sorted. But such a check always takes time O(n), which means that the algorithm overall is going to take O(n) time, while the whole point of doing binary search in the first place is to do so in O(lg n).

Is exercism really the best place to teach people these kinds of things? Clearly I am skeptical that it is. There are a lot of places online where people can learn about algorithms and data structures and I feel that they do a much better job of it. But I am also aware that I am often overly skeptical. I can see some possible solutions.

  1. Instead of asking users to implement algorithms like binary search, we should consider asking users to implement general search (possibly with the given constraint that the input will be sorted).
  2. Instead of testing for data structure implementation details, we could implement stress tests to check that the input indeed subscribes to the desired asymptotic performance. If nothing else we could add large input tests to make sure that "wrong" implementations also "feel wrong" to clients. Possible downside: I can see how not testing for implementation details makes it harder for people unfamiliar with the data structures to "get it".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions