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

Make up a new exercise equivalent to old hello-world #548

Closed
kytrinyx opened this issue Feb 12, 2017 · 13 comments
Closed

Make up a new exercise equivalent to old hello-world #548

kytrinyx opened this issue Feb 12, 2017 · 13 comments

Comments

@kytrinyx
Copy link
Member

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
@NobbZ
Copy link
Member

NobbZ commented Feb 13, 2017

To rename the former hello-world into greeter and keep everything as before was already discussed in the original proposal. I'd vote for keeping that old hello-world as well but don't care for naming though ;)


Re falsiness:

Falsiness is not specific to JS, it's a concept known to ruby and elixir as well, maybe the interpretation of some values might differ between languages. For ruby and elixir "" is a truthy value though. Also even in JS one might to consider returning "Hello, World!" while raising on anything thats not "real" string, so I like the explicit equality check here, but I'm not an JS expert (or would even us it voluntarily), so I don't know (or care for) idioms of the language.


re overly complex conditionals

Wait? Six ways? which ones?


re guard clauses/statements

I'm not sure if this is necessary. For go it seems to be idiomatic to omit that else branch in these cases, while in ruby one does keep it to avoid an explicit return while in haskell you can't even omit that else branch!


Besides of these 3 items, I'd go for another one that could be valuable for this exercise, the default value for a missing argument of a function if it is an available feature of a language.

It should be a track driven idiom through the tracks though, as I've heard idioms are different across languages.

e.g.:

  • For elixir it is idiomatic to use the exact value that you want to use as a default value anyway
  • For python I was told it were idiomatic to set the default to Nil (or whatever they call it again), and have an extra if that adjusts the real to use value to the wanted default value.

@kytrinyx
Copy link
Member Author

It should be a track driven idiom through the tracks though

Yes, absolutely. My main point is that I think that this exercise fills a useful niche. The lessons it makes possible will be different in the various tracks, I was mainly pointing out that there are lessons.

@ErikSchierboom
Copy link
Member

Agreed. Dealing with optional/null values is an important skill and perfectly suited to its own exercise I think.

@kytrinyx
Copy link
Member Author

Ok, so how about the following?

slug: business-buzzwords
name: Business Buzzwords

Template: People, in the next year we need to X. It is what it is.

Some examples of X:

  • enhance dynamic web-readiness
  • cultivate leading-edge systems
  • repurpose e-business markets

We can have any default that we care to, of course.

For inspiration, google "catch phrase generator" or "buzzword generator".

@ErikSchierboom
Copy link
Member

I like it! Tongue-in cheek and all.

@kotp
Copy link
Member

kotp commented Feb 21, 2017

Wait, is this entire issue about "reintermediate bleeding-edge Programs"? (From the buzzword generator, already handy).

The proposal for business-buzzwords sounds like a "Mad Libs" type engine.

@kytrinyx
Copy link
Member Author

@rpottsoh pointed out that we have an open issue #290 that is no longer relevant to the old hello world. It may be relevant here.

The proposal for business-buzzwords sounds like a "Mad Libs" type engine.

I think that it could be a Mad Libs type engine, but I'd like to have it be a very straight-forward replacement to Hello World.

If we want to use buzzwords as a mad libs exercise, then we should come up with something else for this one.

How about:

Title: Two Fer
Slug: two-fer

Template: "One for X, one for me."
Where X is either a name, or it defaults to "you".

@NobbZ
Copy link
Member

NobbZ commented Feb 21, 2017

Sorry I have to ask, but what's a "mad libs" exercise?

@kotp
Copy link
Member

kotp commented Feb 21, 2017

I like the two-fer idea, straight forward, and flexible simplicity.

@kotp
Copy link
Member

kotp commented Feb 21, 2017

@NobbZ.

Pick a noun, another noun, a color, a verb, a living thing.

But pick those without looking at the story that follows...

One day there was a ___ that was ___. It was a ___ and ___ ___.

The result can be pretty hilarious/silly/fun. Often a party game with quite a few people... but can be played with kids on long road trips.

@rpottsoh
Copy link
Member

@NobbZ here is a quick wikipedia write up on mad labs, a follow on to what @kotp stated.

@kytrinyx
Copy link
Member Author

kytrinyx commented Mar 7, 2017

The discussion seems to have wound down on this one. It sounds like two-fer is the better suggestion as a replacement for hello-world.

@kytrinyx
Copy link
Member Author

I've extracted the TODOs from this into new issues.

tejasbubane added a commit to tejasbubane/problem-specifications that referenced this issue Apr 17, 2017
This is meant to be right after hello-world introducing users to basic
programming constructs as well as TDD which will be used in all later
exercises.

Discussion regarding this is [here](exercism#548).

Closes exercism#757.
tejasbubane added a commit to tejasbubane/problem-specifications that referenced this issue Apr 18, 2017
This is meant to be right after hello-world introducing users to basic
programming constructs as well as TDD which will be used in all later
exercises.

Discussion regarding this is [here](exercism#548).

Closes exercism#757.
tejasbubane added a commit to tejasbubane/problem-specifications that referenced this issue Apr 23, 2017
This is meant to be right after hello-world introducing users to basic
programming constructs as well as TDD which will be used in all later
exercises.

Discussion regarding this is [here](exercism#548).

Closes exercism#757.
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

6 participants