Exercise Idea: Bob and Friends

Open
#1,585 5 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
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
haskell, rust
Domain
content

Research direction

Start by reviewing the existing bob exercise and the linked Haskell solution to understand the proposed separation between message classification and replies. Done would require community agreement on the exercise concept followed by a concrete pull request defining the new exercise.

Written by the indexing model from the issue text.

Description

new exercise idea

Hey, so I am thinking of a new exercise. It is inspired by bob, but it might be better if it is just called reply.

Basically, I am a big proponent of decoupling the logic for classifying messages to Bob from the reply logic. Typically this results in using some sort of Algebraic Data Type or enum variants.

An example of my over-engineered solution in Haskell can be found here.

The benefit, as I see it, is that there is clear separation of logic and responsibilities. A wonderful side effect of that is how easy it becomes to implement reply functions for people other than Bob.

Across paradigms there are many ways that this can be handled. In rust for instance one could use a Reply trait that takes a &str and returns a &str, but it can use an enum named Locution or MsgClass to do the work that isn't related to the struct Bob or Carol or John.

In OOP languages people could use class composition or use interfaces.

Anyway, I made this issue, so I could guage community enthusiasm for this exercise idea.
I think it is still worth it to have the bob exercise (sort of like how the resistor-color exercises keep uping their game at each step).

It seems to me like most students experience bob as an annoying burden. I didn't realize how much I liked the exercise, until I realized there was a massive opportunity to decouple that logic of message classification from response generation thereby making well-compartmentalized code that was general enough to make new responders trivial to write.

Okay, I am always too verbose :/ Please let me know your thoughts about this. If there seems to be some excitement for this proposal, then I will make a PR for this new exercise ;)

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.