You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello world should be a very easy exercise. Its objectives:
Demonstrates to the student that theirexercism fetch and exercism submit are working (NB, this could be a language-agnostic exercise, but it is not clear where we would put it)
Explain to the student how to run the test suite in the language
this role doesn't have to be filled by hello-world, but some students prefer to have the separate exercise dedicated only to making sure this step is solid before moving on. Those who don't care can skip it.
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.
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?
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.
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.
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!
I learned from:
Hello world should be a very easy exercise. Its objectives:
exercism fetchandexercism submitare working (NB, this could be a language-agnostic exercise, but it is not clear where we would put it)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.
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.