exercism / problem-specifications

Shared metadata for exercism exercises.
MIT License
326 stars 540 forks source link

Identify computer science algorithm exercises #761

Open kytrinyx opened 7 years ago

kytrinyx commented 7 years ago

We currently have at least one, maybe several exercises that asks the learner to implement a specific algorithm.

We discussed whether this type of exercise is a good fit for Exercism, in https://github.com/exercism/discussions/issues/124 and concluded that:

Instead of asking "Write a program that implements erastosthenes sieve." we should ask "Write a program which returns a list of prime numbers, there are a couple of efficient algorithms: erastostenes sive, wheel sieve, etc", perhaps even with links.

We need to identify which exercises target an algorithm rather than targeting what the algorithm does.

The one that started the discussion in sieve, but I'm not sure if that's the only one.

Once we've identified them, we need to open a new issue to implement the new exercise and deprecate the old one.

Exercises identified as too specific

petertseng commented 7 years ago

binary-search asks for a specific algorithm.

ErikSchierboom commented 7 years ago

The diffie-hellman exercise is all about a specific algorithm.

tejasbubane commented 7 years ago

luhn is another specific algorithm. Although I am not aware of any similar ones like the sieve example above. Maybe rename luhn to credit-card-validator to remove the specificity?

Insti commented 7 years ago

Are there other algorithms that will pass the tests for diffie-hellman and luhn? With sieve and binary-search there are.

Is that the difference between a "good" and a "bad" specfic algorithm question?

ErikSchierboom commented 7 years ago

@Insti I think that's it!

petertseng commented 7 years ago

Oh. In that case, it's time to suggest parallel-letter-frequency... because I imagine most tracks' parallel-letter-frequency test suites don't specifically enforce that the implementation is indeed parallel, so a serial solution (whether it is intentionally or unintentionally serial) could pass the tests, right?

(Or should the tests enforce parallelism, and how? Like https://github.com/exercism/xhaskell/pull/542 ?)

Insti commented 7 years ago

hangman?

Insti commented 7 years ago

binary? (although it is deprecated.)

emilianbold commented 7 years ago

The core of the matter for me is not about implementing a specific algorithm. It's that the algorithm does not help me improve for that particular language and that sometimes I spend more time on the algorithm than on the language.

Also, I'm not learning how to program, I'm just practicing a new language. Do I really need that many exercises teaching me recursion in this new language? I know it helps to repeat some concepts, but at some point, it's just one exercise after another teaching you nothing new.

One good exercise, "Saddle Points" on Haskell, it's pretty hard to solve with the given method signature. I took it as a challenge and solved it. And I learned a few things about the related APIs. Here the algorithm was easy, it was the hunting for the useful hooks that was educational.

"Parallel Letter Frequency" was hard because you are given no hint on what to use. I read a lot of (some, dubious) articles until I decided to use the simplest function I could use. And it worked.

Right now, after "Robot Name" which was good as I used a MVar I'm offered "Pig Latin" which is pointless, then "Say" which is not much at this point, then "Spiral Matrix" which is just algorithm writing.

I feel like the following exercises are missing a chance to teach me some new language concept or very common language module / function / pattern.

kytrinyx commented 7 years ago

Thanks @emilianbold this makes a lot of sense, and I think you're right.

We definitely need to retire exercises that are not teaching anything.

I don't know whether we know which ones feel like they're not teaching anything though, and this is likely different from language to language.

/cc @iHiD @nicolechalmers not directly related to the redesign, but a question we might want to discuss in order to have some ideas about how to figure out which exercises are not helping.

stkent commented 7 years ago

I would imagine whether or not an exercise teaches anything can also vary from person to person.

iHiD commented 7 years ago

Let's rephrase it to "exercises that are teaching things aligned with the goal of exercism, which is to increase fluency in a language - not to develop computer science skills"

On Mon, 3 Jul 2017, 23:40 Stuart Kent, notifications@github.com wrote:

I would imagine whether or not an exercise teaches anything can also vary from person to person.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/exercism/problem-specifications/issues/761#issuecomment-312744954, or mute the thread https://github.com/notifications/unsubscribe-auth/AARfDDeaKK0NGjfmG5uzEUkFcMlBRqZmks5sKW3DgaJpZM4NAsPD .

masters3d commented 6 years ago

To clarify: This is not saying that we can not use traditional cs ideas to solve the problems right?

Can we still have a custom stable sorting problem where a user is pretty much being asked to sort an array and just suggest the many different ways this can be done?

Another example that comes to mind is Priority Queues. There are many different ways this can be done with out having to specify to the user to use a Heap. Etc.

iHiD commented 6 years ago

If the aim so to teach the user about the 10 different ways Ruby lets you sort, then great. If the aim is to teach 10 different ways to sort and the choice of Ruby is coincidental, then less great. In my understanding.

On Thu, 25 Jan 2018, 19:52 Cheyo Jimenez, notifications@github.com wrote:

To clarify: This is not saying that we can not use traditional cs ideas to solve the problems right?

Can we still have a custom stable sorting problem where a user is pretty much being asked to sort an array and just suggest the many different ways this can be done?

Another example that comes to mind is Priority Queues. There are many different ways this can be done with out having to specify to the user to use a Heap. Etc.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/exercism/problem-specifications/issues/761#issuecomment-360580666, or mute the thread https://github.com/notifications/unsubscribe-auth/AARfDKMHH86FAEihkGJm5H0QqBvxUHowks5tONtzgaJpZM4NAsPD .

coriolinus commented 6 years ago

I feel the opposite: there's value in knowing various sort algorithms, learning their performance characteristics, implementing them. Even if 98% of the time in the real world you'll just use the sort function from the standard library, there's that one time in 50 when you need to specify the particular algorithm used in order to get the performance characteristics you need.

In my opinion, there aren't many better problems than sorting for demonstrating in a visceral way that different algorithms have different performance characteristics. Any given sort algorithm is simple enough to implement quickly on your own, but with well-chosen test cases you can feel the performance difference for yourself. If you just use standard library sort all the time, you don't get that knowledge.

On Fri, Jan 26, 2018 at 1:16 AM, Jeremy Walker notifications@github.com wrote:

If the aim so to teach the user about the 10 different ways Ruby lets you sort, then great. If the aim is to teach 10 different ways to sort and the choice of Ruby is coincidental, then less great. In my understanding.

On Thu, 25 Jan 2018, 19:52 Cheyo Jimenez, notifications@github.com wrote:

To clarify: This is not saying that we can not use traditional cs ideas to solve the problems right?

Can we still have a custom stable sorting problem where a user is pretty much being asked to sort an array and just suggest the many different ways this can be done?

Another example that comes to mind is Priority Queues. There are many different ways this can be done with out having to specify to the user to use a Heap. Etc.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/exercism/problem-specifications/issues/ 761#issuecomment-360580666, or mute the thread https://github.com/notifications/unsubscribe-auth/ AARfDKMHH86FAEihkGJm5H0QqBvxUHowks5tONtzgaJpZM4NAsPD

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/exercism/problem-specifications/issues/761#issuecomment-360644509, or mute the thread https://github.com/notifications/unsubscribe-auth/AHdeTkB5M01RuuBxg4_e5yh_fSggnW0Nks5tORl0gaJpZM4NAsPD .

kytrinyx commented 6 years ago

I feel the opposite: there's value in knowing various sort algorithms, learning their performance characteristics, implementing them.

Yes, there is value in this, however that is not—directly—what Exercism is about.

In my opinion, there aren't many better problems than sorting for demonstrating in a visceral way that different algorithms have different performance characteristics.

This is a good point. I would be open to a sorting-based exercise, provided that it is framed in terms of a problem to solve that isn't directly saying "learn to sort". Just as two-fer is not framed as "optional default values" or some other theoretical concept.

If we can have an interesting exercise that has the possibility for people to get a visceral experience with algorithm performance characteristics, that is fine.