exercism / v3

The work-in-progress project for developing v3 tracks
https://v3.exercism.io
Other
170 stars 162 forks source link

[C#] Implement new Concept Exercise: chars #960

Closed ErikSchierboom closed 4 years ago

ErikSchierboom commented 4 years ago

This issue describes how to implement the chars concept exercise for the C# track.

Getting started

Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:

Please also watch the following video:

Goal

The goal of this exercise is to teach the student the basics of the Concept of Chars in C#.

Learning objectives

Out of scope

Concepts

This Concepts Exercise's Concepts are:

Prequisites

This Concept Exercise's prerequisites Concepts are:

Resources to refer to

Hints

After

Representer

This exercise does not require any specific representation logic to be added to the representer.

Analyzer

This exercise does not require any specific analyzer logic to be added to the analyzer.

Implementing

To implement this exercise, please follow these instructions.

Help

If you have any questions while implementing the exercise, please post the questions as comments in this issue.

mikedamay commented 4 years ago

Can you say more about for loops. Am I blanking on some special relationship between for and char? Why are for loops not a pre-requisite?

mikedamay commented 4 years ago

Is boxing out of scope? I would think that after.md would be a good place for it.

ErikSchierboom commented 4 years ago

Can you say more about for loops. Am I blanking on some special relationship between for and char? Why are for loops not a pre-requisite?

I struggled a bit to come up with an exercise that was about chars but that was also in any way interesting. I then came up with the idea that we could have students iterate over the chars in a string using a for loop. Does that make sense or not? We could omit the for loop, but then the exercise might be very dull, so maybe then we should replace it with a different concept.

Thinking about it a bit more, it might make more sense to introduce the for loop in the arrays exercise, which already introduces the foreach loop. What do you think about that?

Is boxing out of scope? I would think that after.md would be a good place for it.

My gut feeling is that boxing would be probably best be discussed in another exercise, for example in the exercise that teaches about casting between different class types. What was your reasoning for wanting to include it here?

mikedamay commented 4 years ago

for-loops:

I had not considered the possibility of an exercise introducing disparate (albeit connected) concepts like chars and for loops. One disadvantage of this approach is when using the exercises as a reference resource (either as a student of a maintainer) it will make it much less obvious where to look for relevant material.

I had not thought beyond the idea that there would be a for exercise or, given that this is rather fine grained, perhaps a loops exercise.

I certainly have no objection to the char exercise including for as a pre-requisite. I think that your suggestion of array is a better place for for if we are going to use combinations in this way.

boxing:

I have frankly lost track of the significance of boxing. I know that whenever I revert to Java I can see what a headache it can be. I think that the experience has scarred me. It doesn’t seem that, in a world of reified generics, boxing is terribly important.

I was not thinking of introducing boxing as a “concept" rather when discussing a “simple” type, in the interests of a rounded account, the aliased type might be mentioned, in our case System.Char, together with a nod towards the role of “boxing”. If I pick this up I would propose putting something in after.md along these lines and perhaps it’s not important enough even to mention as being out of scope.

ErikSchierboom commented 4 years ago

I had not considered the possibility of an exercise introducing disparate (albeit connected) concepts like chars and for loops. One disadvantage of this approach is when using the exercises as a reference resource (either as a student of a maintainer) it will make it much less obvious where to look for relevant material.

In general we try to avoid introducing multiple (disparate) concepts in one exercise, but in some cases it does make sense:

I was not thinking of introducing boxing as a “concept" rather when discussing a “simple” type, in the interests of a rounded account, the aliased type might be mentioned, in our case System.Char, together with a nod towards the role of “boxing”. If I pick this up I would propose putting something in after.md along these lines and perhaps it’s not important enough even to mention as being out of scope.

Ah that sounds reasonable! I also don't think boxing is as much of an issue in C# as it is in Java (I frequently encountered its effects there), but let's see if it makes sense when referring to System.Char (which is an excellent point).

ErikSchierboom commented 4 years ago

I think that your suggestion of array is a better place for for if we are going to use combinations in this way.

Shall I create an issue for it?

ErikSchierboom commented 4 years ago

@mikedamay I've created a PR to introduce for-loops in the arrays exercise. Let me know what you think.

mikedamay commented 4 years ago

I will give "char" a go. To pick up on your idea - making identiers comply with naming conventions would seem to work.

ErikSchierboom commented 4 years ago

Great! Will be good to have a chars exercise. Could you start with a basic draft PR that has just the following three files:

The PR would then look something like this: https://github.com/exercism/v3/pull/1486/files (albeit in C#).

mikedamay commented 4 years ago

@ErikSchierboom

Could you start with a basic draft PR that has just the following three files:

Please let me know the reason for this request. If it is a question of spliting tasks into more manageable pieces and allowing for a measure of specialisation as discussed in last week's video call then I would suggest that some flexibility is in order. This approach does not fit my workflow (happy to provide detais).

If it's a question of getting some communal participation earlier in the process then I would suggest a fuller discussion on the concept creation issue.

Let me know what you think.

ErikSchierboom commented 4 years ago

The reason for this request is just to check if the PR is going in the right direction. We've had PR's where a fully-fleshed exercise was PR'ed that turned out to require quite some modification. It would have been easier if the PR started with just the basics, and getting that right first. I don't necessarily mind the bigger PR's, but there will likely be more churn and it makes reviewing a bit harder.

[...] I would suggest a fuller discussion on the concept creation issue.

I'm fine with that too. Did you have an idea on what you wanted the exercise to do? Which things will students be implementing?

ErikSchierboom commented 4 years ago

@mikedamay I don't know if it is any use for you, but Elixir is creating a charlist exercise. It is definitely not the same as working with regular chars, but you might find inspiration in the story.

mikedamay commented 4 years ago

@ErikSchierboom If you get a chance could you make a comment on PR 1556. I can then continue with that.

ErikSchierboom commented 4 years ago

@mikedamay Sure, I hadn't fully worked through my list of notifications :)

mikedamay commented 4 years ago

@ErikSchierboom Classic concurrency issue!

The elixir exercise would have done nicely. It's more realistic than mine but programmers and identifiers go together reasonably well so I'm inclined to leave it.

ErikSchierboom commented 4 years ago

Haha, yes! I think the identifiers theme does make sense and will resonate with students.

mikedamay commented 4 years ago

@ErikSchierboom

Could you start with a basic draft PR that has just the following three files: Example.cs .docs/instructions.md .meta/design.md or .docs/introduction.md (I prefer the former, but feel free to choose which of the two you prefer)

If you are formalsing this, maybe the following sort of idea/wording might be considered. I appreciate that in many cases the wizard will supersede this approach so it may not be worth it.

"To start with, please submit a draft containing at least the following files:

Intially only these files will be reviewed (in broad terms) so it might be adviseable to delay completion of the other files until the draft has been reviewed."

ErikSchierboom commented 4 years ago

@mikedamay That sounds like a nice way of wording it.

P.S. I'll be looking at this PR shortly, I had a day off yesterday (speaking at NDC Oslo on the C# analyzer/representer/test runner).

mikedamay commented 4 years ago

Closed by #1556