JordanMartinez / learn-halogen

Learn purescript-halogen using a bottom-up apporach via this "clone-and-play" repository
188 stars 28 forks source link

Add exercises for each example #60

Open milesfrain opened 4 years ago

milesfrain commented 4 years ago

How do you feel about adding a section with one or more exercises to each example? I'm happy to contribute exercises as I work through each section.

It may also be helpful to have exercise solutions. To include those, should I just shift the numbering prefixes?

src/01-Static-HTML/01-Static-HTML.md
src/01-Static-HTML/02-Static-HTML.purs
src/01-Static-HTML/03-Static-HTML-solutions.purs  <--- New file
src/01-Static-HTML/04-Adding-Properties.md
etc.
JordanMartinez commented 4 years ago

I'm fine with adding exercises to this repo and their recommended solutions. There's a few concerns to keep in mind:

So, perhaps this is the route we should take?

Exercise / Solution Format

src/ -- folder for storing normal tutorial stuff
exercises/ -- folder for storing exercises
  section/ -- name corresponds to section it covers
    exercise-name/
      problem.purs
      solution.purs
      ReadMe.md -- overviews the problem and the goal the learner has

Thoughts?

milesfrain commented 4 years ago

The exercises will certainly be opt-in for readers of the guide. I'm envisioning that the exercises will only be suggested things to add to each example, so there's no risk of incomplete exercises failing to compile. The additional maintenance burden is a major concern. So now I'm thinking that it may be best to track the solutions as a separate branch, where the changes are made directly to the existing example files. (See sample exercises and solutions-branch).

Pros and Cons of the solutions-as-branch strategy are:

Pros:

Cons:

JordanMartinez commented 4 years ago

I'm against the solutions-as-a-branch strategy.

I like the "suggestions of what to add to a pre-existing example as an exercise" idea.

milesfrain commented 4 years ago

How about we just stick to the "suggested additions" approach for now, since that only involves a small change to each readme, and closely matches the solution-less strategy of the official purescript book.

A decision on if and where to track solutions can be made later, with no solutions being the choice for now.

One solution-management possibility is to encourage readers to fork this repo and fill in their own solutions. When all of their solutions are complete, they could add an entry to a readme table in this repo that points to their fork along with the release tag that their solutions were made against.

JordanMartinez commented 4 years ago

That sounds good to me!

milesfrain commented 4 years ago

Progress update: Here are some exercises along with solutions for sections 01/01 - 02/05. Future additions will be applied to those branches. Will file a PR once all the exercises are complete.

JordanMartinez commented 4 years ago

Nice!