-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
Use default file #138
Comments
I think it would help, I thought this was how they all worked as I've otherwise done python, elixir, and elm. I was just coming to report on this, and to volunteer to generally make this easier for linux users such as myself. I completed the hello world exercise using dotnet core, and added nunit to a project file I created such that 'dotnet test' ran the tests. I'd like to investigate having that work for others, but I need to ramp up on both csharp and exercism a bit more first. |
@ckhrysze I am currently waiting on the .NET Core CLI to be finalized. Once that is released, I will be converting all exercises to run on .NET Core, including a project for each exercise that contains an empty implementation file. Thanks for the feedback! |
@ErikSchierboom when you say that you're waiting for the .NET Core CLI to be "finalized" what do you mean? I thought 1.0 has already been released. |
@robkeim Well, the .NET Core CLI has been released, but they are still preview releases (not even beta releases thus). Alongside the CLI work is the MSBuild work, which will replace the current .NET Core project.json format. This work is also not done. Once both of these are done, we will be able to do some very cool stuff such as:
Adding a default file to those project files (this issue) is already technically possible, but I think this would fit in better with the above rewrite. |
Ok that makes sense, thanks for the explanation! |
This was the post I was looking for (I added this comment to #183) before finding this one. @ErikSchierboom It looks like the CLI tooling is no longer in preview... finally :) https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes
|
@robkeim I'm busy porting the C# exercises to Xunit (on a branch of mine). I'll then work next on creating the new .csproj files. |
Sounds good @ErikSchierboom! |
I'm working on this in the .NET Core branch. |
While working on this, a question arose. I am creating a minimal skeleton file for each exercise. That means the user can focus on the actual implementation, instead of the boring and repetitive creating of files. For simple exercises, I think this is a huge win. Consider the following default file for the using System;
public static class Acronym
{
public static string Abbreviate(string phrase)
{
throw new NotImplementedException("Please implement this function");
}
} Looks clean to me, and it will let the user focus on the implementation. However, do we also want to create stubs for any required constructors? I'm leaning towards yes, but what do you feel? @balazsbotond @robkeim @jwood803 @bressain? Would you like this: using System;
public class Anagram
{
public string[] Match (string[] potentialMatches)
{
throw new NotImplementedException("You need to implement this function.");
}
} or this: using System;
public class Anagram
{
public Anagram (string baseWord)
{
throw new NotImplementedException("You need to implement this function.");
}
public string[] Match (string[] potentialMatches)
{
throw new NotImplementedException("You need to implement this function.");
}
} Note that the tests require that specific constructor, so we could supply it instead of having users use ReSharper or Visual Studio to generate it for them. |
Note that for some exercises, it might make sense to do require the user to specify the constructors. An example of this is the public class Node
{
}
public class Edge
{
}
public class Attr
{
}
public class Graph
{
} |
You can check my progress here: https://github.com/ErikSchierboom/xcsharp/tree/default-file |
@ErikSchierboom I'm kind of in the "no stubs" camp. I think it's fine to include a stubbed out file for the first few exercises but after that, I feel there is value in the user creating files from scratch. Yes it's repetitive but repetition is how you learn the language and I wouldn't want to take that away from the user. That said, I understand that decision may have already been made which is fine since I've been mostly MIA. My opinion however, is if we're going all in on stubs, let's keep it to a minimum so that we're not being too prescriptive. |
@bressain Thanks for chipping in! We had the same sort of discussion on the F# track. We can leave this issue open, as we can easily remove stubs if more people agree with your sentiment :) |
To @bressain's point, I think that we definitely need stubs for the first few exercises in order to reduce friction and on-boarding to the track. Given the fact that we're providing the tests we're already being fairly prescriptive in terms of function composition, naming, etc so I don't feel the stubs should take out much of the "meat" of the exercises as opposed to just reducing a few lines of boilerplate code. (Disclaimer: I'm just getting back from vacation and catching up on everything, so this thinking hasn't taken everything that's happened in the past few weeks into consideration) |
I understand @bressain's point, but it kinda depends on who you think is your target audience. For people completely new to C#, it might make sense to have them create the files at some point. However, for people already having some C# that want to hone their C# skills, it doesn't really bring anything to their table I feel. Also, when you get to the later exercises, you must already have some C# skills otherwise you wouldn't get there. For those people, which thus are relatively proficient, creating the stubs wouldn't be a problem, but they also wouldn't learn anything from it. I've also done worked on several other language tracks, with some tracks providing stubs (Haskell), some providing stubs for some exercises (Java) and some not providing any stubs (F#). It is probably no surprise, but I really like the Haskell track where a stub was provided for me. The Java track at some point didn't provide me with a stub, but all I did was to use my IDE to generate the stub for me. That did not teach me anything useful, expect how to use my IDE. So I do get the point @bressain is making, and it is a good one, only I feel that the previous points give the stubs approach the edge. |
With #199 merged, this issue can now be closed! 🎉 |
Some tracks lessen the barrier for users by providing an empty implementation file, which prevents the user from having to create the file themselves. An example of such a track is the Elm track, but the Scala track is also discussing this. How do you all feel about this? I think it would indeed lower the barrier, especially if we will also be providing exercise-specifc .csproj files.
The text was updated successfully, but these errors were encountered: