Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I posit that hello-world is too complex for a first exercise. How do we deal with it? #520

Closed
petertseng opened this issue Jan 30, 2017 · 33 comments

Comments

@petertseng
Copy link
Member

petertseng commented Jan 30, 2017

I learned from:

Hello world should be a very easy exercise. Its objectives:

I am here to argue that the current hello-world ("Alice" -> "Hello, Alice!", "Bob" -> "Hello, Bob!", no input -> "Hello, World!") does not serve this purpose well, since it also requires the student to know enough about the language to handle the no-input case.

This effect is especially pronounced in languages that do not allow function overloading or default arguments. Some languages resort to passing an empty string, defining two functions, or others discussed in #290. Elm, F#, Haskell, Kotlin, OCaml, Purescript, and Rust are all using their Option/Maybe type, which I argue is not suitable for hello-world (In Learn You A Haskell, Maybe is not mentioned until chapter 7 of 14). But even in languages with function overloading or default arguments, I suggest that these two features are too much for hello-world.

I would say that the best way to achieve the goal of hello-world is to have the function-under-test take zero arguments and return "Hello, World!" unconditionally.

But what can we do? The current hello-world is already out there, and several languages have it.

  1. If we change the hello-world README to unequivocally state that the function should return "Hello, World!" unconditionally, then all languages that currently have hello-world will be inconsistent with the README. Is that okay?
  2. If we change the hello-world README to be so vague that either interpretation is possible (the current interpretation, or unconditional "Hello, world"), languages can do as they wish, but it is a delicate balance to strike - we have seen before in Go: Specifications confusing exercism#2746, an underspecified problem is also undesirable.
  3. What if we left hello-world as-is, and made a new exercise, the-answer, whose only function-under-test should return 42 unconditionally. Then, languages can do whichever of the two they please. The only disadvantage is that it will be confusing to track maintainers and exercise porters to have two starter exercises.
  4. Maybe you disagree with my proposal: Maybe you think students can be expected to have some minimum level of knowledge upon starting the track. Or you think my proposal is rather too simple. Let me know about it!
@rbasso
Copy link
Contributor

rbasso commented Jan 30, 2017

👍 for option 1: Change it to just "Hello, World!!

The purpose of a Hello, World! exercise seems to be, IMHO, just testing the tool-chain. Anything beyond returning/outputting the string makes it less suitable to that purpose.

Also, the hello-world name is so clear in explaining its purpose that it would be a shame to create another exercise as the first one.

@Insti
Copy link
Contributor

Insti commented Jan 30, 2017

Hello world should be a very easy exercise. Its objectives:
...
Introduce the student to how TDD works

I think this is out of scope for hello world, leaving just the first two.

the best way to achieve the goal of hello-world is to have the function-under-test take zero arguments and return "Hello, World!" unconditionally.

💯

What to do:

  1. Rename the current hello-world to greeter add a new hello-world that just says "Hello world." (There will be some challenges around this, but they are not insurmountable.)

  2. Create a new first exercise called exercism-works that returns "Exercism works!" (This is similar to suggestion 3, but non-optional.)

@petertseng
Copy link
Member Author

petertseng commented Jan 30, 2017

I would find it so great if I could change the existing hello-world README and let the various tracks converge on it, maybe emblazon them. Avoids any confusing operations with having a second starter exercise, or moving hello-world -> greeter (now if I look at a track that has hello-world, how can I tell whether it is the new or old hello world?)

We've done this process once or twice before. We discussed how to handle it in exercism/discussions#2. Maybe it's time to revisit this. I asked tracks to change their sum-of-multiples last April. I marked in the README that there's a change in flight, and let all readers know, if you see a track is using the old version, help us fix it. That was done in #236.

If we get agreement that hello-world should be simplified (I confess, I was thinking I would get more opposition!), how about taking that plan?

On the other hand, hello-world is a bit of a special case since it's the very first experience of a track. If the first experience seems weird and inconsistent in this manner, it may confuse a student who is just trying to get started. We would have to be very careful in applying this plan.


One thing that gives me pause is - I may be getting ahead of myself.

It is absolutely true that hello-world in its current form would not be a good first exercise for Haskell (and, I argue, every other option/maybe track, but I couldn't know for sure!). For Haskell, the unconditional hello world is the right thing to do.

But then I wonder, is it too presumptuous to claim that it's the right thing for all tracks? Maybe they're perfectly happy with their hello-world in its current form, and do not want a change.

This is actually a time when I wish we could survey students to see what they think. Would they have appreciated this new simple hello world? Any patterns among the tracks that have harder hello-world exercises?

I try to advocate for changes that I have very good reason to think are better, but especially given that this change tries to better an onboarding experience, wouldn't it be great if there was any data at all to back it up?

@Theodus
Copy link
Contributor

Theodus commented Jan 30, 2017

I agree that the current hello-world is too complicated in some languages considering its purpose. However, this is not the case for all languages. I can say for certain that the exercise in its current form is solved fairly easily with the use of default arguments in languages such as Pony and Kotlin.

@rbasso
Copy link
Contributor

rbasso commented Jan 30, 2017

(...) I can say for certain that the exercise in its current form is solved fairly easily with the use of default arguments in languages such as Pony and Kotlin.

I believe that the question is not "Is is too hard?", @Theodus, but "Could it be easier?"

In my view, it should be ridiculously easy to solve it, and I would even supply a stub solution like this:

module HelloWorld (hello) where

hello :: String
hello = "Goodbye, World!"

But then I wonder, is it too presumptuous to claim that it's the right thing for all tracks? Maybe they're perfectly happy with their hello-world in its current form, and do not want a change.

This discussion may have started because it is hard for beginners to deal with optional argument in Haskell, @petertseng, and certainly changes are temporary inconveniences for tracks that already have it implemented, but the rationale is sound and there is still no one defending the usefulness of having it more difficult than it needs to be.

If someone comes with a good reason to keep the optional argument, of course we could leave it the way it is. Anyone?

@ErikSchierboom
Copy link
Member

I'm also firmly in favor op option 1. The exercise should not be about specific language features in my opinion (no matter how simple), but only about getting to know the track's setup. How do I run the test? What is a red test? How do I get it to pass?

Sure, some languages have easy ways to do optional values, but is that really the first thing you expect people to learn? I don't think so.

@ijanos
Copy link
Contributor

ijanos commented Jan 31, 2017

I prefer option 1. Hello World should be as simple as it gets. I think languages with easy option types could have a "Hello World+" language specific exercise with option types baked in.

@petertseng
Copy link
Member Author

There was more support for option 1 than I thought there would be! I will leave for a while longer before I take action in x-common, but I think I will prepare a few PRs those tracks on which I'm a maintainer.

@rpottsoh
Copy link
Member

rpottsoh commented Feb 1, 2017

Why not keep the exercise as is except call it something else? Is there nothing that can't be learned from the exercise in its present form? At the same time I am also for having hello-world be more of test/confirmation exercise to help the student realize that they have setup the tools correctly for a particular track.

@petertseng
Copy link
Member Author

Why not keep the exercise as is except call it something else?
Is there nothing that can't be learned from the exercise in its present form?

Indeed, the current hello-world could become greeter, or maybe the niche is already filled by any other problem wherein a function may optionally take an argument - can we get a check on whether there is any other exercise that does the same?

@rbasso
Copy link
Contributor

rbasso commented Feb 1, 2017

greeter would be a good introduction to Maybe in Haskell, before its use in a more complex context.

@ErikSchierboom
Copy link
Member

Keeping the existing exercise as a new exercise does have its advantages, as it gently introduces optional values. But if our new hello-world exercise would simply return "Hello, World!", wouldn't the greeter exercise be a bit too similar?

@rbasso
Copy link
Contributor

rbasso commented Feb 1, 2017

You're right, @ErikSchierboom. It would be better to have something less repetitive. 👍

@ErikSchierboom
Copy link
Member

Perhaps we can come up with another exercise which sole focus is optional values?

@rbasso
Copy link
Contributor

rbasso commented Feb 1, 2017

It would be nice, but I usually prefer to tweak a existing one and avoid the proliferation of language-specific exercises. We could easily write dozens of exercises to cover Haskell topics, but I'm not sure if this would be good for Exercism as a whole.

@ErikSchierboom
Copy link
Member

Well, actually I do think that this would be a good subject, as many languages have their own concept of optional values and how to deal with it.

@petertseng
Copy link
Member Author

petertseng commented Feb 8, 2017

Hmm. Those tracks that use hello-world as an intro to TDD (as well as exercism), such as exercism/kotlin#31 and https://github.com/exercism/xjava/blob/master/exercises/hello-world/TUTORIAL.md (exercism/java#139), are going to be in for a rude awakening. I wonder how to reconcile the differences between those tracks that want to use the directed introduction and those that want something dead simple.

@ErikSchierboom
Copy link
Member

I think that our message to them would be to perhaps see if they can move the TDD intro to the next exercise (which I would suggest would be leap). The leap exercise is well-suited for a TDD intro I believe, as you can start with a simple base test case, and then subsequently start adding the corner conditions. As such, it's even better suited to a TDD intro than hello-world IMHO.

@rbasso
Copy link
Contributor

rbasso commented Feb 10, 2017

So...are we settled about changing the hello-world's description.md file?

To proceed, I think we should, ideally...

  • Agree that this should be done.
  • Write the PR.
  • Decide on a date/time for merging. 2016-02-20 00:00 UTC?
  • Notify all the maintainers about the change and the date.

With that, the tracks could approximately sync their changes if they want to.

Makes sense?

@ErikSchierboom
Copy link
Member

Absolutely!

@rbasso
Copy link
Contributor

rbasso commented Feb 10, 2017

I just opened the PR and mentioned all the track maintainers there to raise awareness. This will probably allow us to discover if there is anyone against it soon.

I temporarily set the date to 2016-02-20, but we can change it or suspend the process anytime.

petertseng added a commit to exercism/go that referenced this issue Feb 20, 2017
The introductory exercise should require as little Go knowledge as
necessary. We'd like to introduce `go test` and `testVersion` here. We
skip introducing the empty string as no string, as this is more specific
knowledge.

exercism/problem-specifications#520
petertseng added a commit to exercism/rust that referenced this issue Feb 20, 2017
The introductory exercise should require as little Rust knowledge as
necessary. We'd like to introduce `cargo test` here since it will be
used for all exercises, but introducing Option is too much.

We add a stub in case it is not clear how to return a string. That way,
the student only has to change the string provided.

exercism/problem-specifications#520
behrtam added a commit to behrtam/python that referenced this issue Mar 15, 2017
behrtam added a commit to exercism/python that referenced this issue Mar 16, 2017
kotp added a commit to exercism/ruby that referenced this issue Mar 17, 2017
Insti pushed a commit to exercism/ruby that referenced this issue Apr 16, 2017
re: exercism/problem-specifications#520

Hello world exercise updated to only return 'Hello world!' without the name substitution that was present in the previous version.
devonestes pushed a commit to exercism/elixir that referenced this issue Oct 9, 2017
benreyn added a commit to benreyn/elisp that referenced this issue Apr 29, 2018
It was determined [upstream] that the hello world excercise should be simplified
to always expect a return value of "Hello, World!".

[upstream]: exercism/problem-specifications#520
benreyn added a commit to benreyn/elisp that referenced this issue May 8, 2018
It was determined [upstream] that the hello world excercise should be simplified
to always expect a return value of "Hello, World!".

[upstream]: exercism/problem-specifications#520
benreyn added a commit to benreyn/elisp that referenced this issue May 16, 2018
It was determined [upstream] that the hello world excercise should be simplified
to always expect a return value of "Hello, World!".

[upstream]: exercism/problem-specifications#520
benreyn added a commit to exercism/emacs-lisp that referenced this issue May 16, 2018
It was determined [upstream] that the hello world excercise should be simplified
to always expect a return value of "Hello, World!".

[upstream]: exercism/problem-specifications#520
emcoding pushed a commit that referenced this issue Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants