-
-
Notifications
You must be signed in to change notification settings - Fork 557
Description
For those languages where the old hello world wasn't too complex, it would be nice to have an additional exercise that can fill the space between the new hello-world and other simple exercises.
There are a couple things that this exercise can help people discover if they get feedback on it, though one of them depends on the language.
falsiness (maybe JavaScript specific)
We see a lot of if (input == "") which means that we can suggest that people look into the concept of falsiness to find simplifications.
overly complex conditionals
There are at least six or seven ways that people make their conditionals more complicated than necessary, or make them contain a lot of duplication.
The second point leads nicely up to the Leap problem.
bonus: guard clauses
Sometimes they'll also do if (x) { return y } else { return z }, which means that we can talk about minimizing indentation and leaving off the else if the if is returning.
Anyway: I think that it would be useful to have a new exercise that implements a similar thing as the old hello world:
- optional and default input value
- combine that value with some extra string template-y stuff, conditionally