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

Skeleton files should be included in all problems to make it easier #272

Closed
gytdau opened this issue Dec 1, 2015 · 21 comments
Closed

Skeleton files should be included in all problems to make it easier #272

gytdau opened this issue Dec 1, 2015 · 21 comments

Comments

@gytdau
Copy link

gytdau commented Dec 1, 2015

I'm on the Python section, and I've found that only a few challenges include a skeleton file. This is helpful, since you can then start coding without the delay of creating your own file. Example: the Bob challenge comes with bob.py:

#
# Skeleton file for the Python "Bob" exercise.
#


def hey(what):

    return

It'd be great if a skeleton file like this was included in all of the challenges, to make things just a little bit easier for everyone.

@behrtam
Copy link
Contributor

behrtam commented Dec 1, 2015

I already had a similar feeling #210.

@kytrinyx
Copy link
Member

kytrinyx commented Dec 1, 2015

We originally put stub files in early exercises because some people are stumped about how to even start solving the problem without a stub file in place.

However, I've found that one important part of TDD for me has been to recognize categories of errors. Recognizing the type of error that comes from a missing file and a missing constant or definition seems like a fairly important step to me.

I like stub files in the early problems to help people get started, but once they are confident, I find that stub files are training wheels that are no longer necessary.

@behrtam
Copy link
Contributor

behrtam commented Dec 3, 2015

I see it exactly the other way around. While I agree that recognizing categories of errors is an important skill but once you have created 1-3 files and know how to find out the function signatures this task get's boring and is just an unnecessary step.

@gytdau
Copy link
Author

gytdau commented Dec 3, 2015

In any case, I see creating the file as a mild annoyance. It would be nice if the file was created for you, but this is not a huge issue.

@behrtam
Copy link
Contributor

behrtam commented Apr 12, 2016

I just started to work on the Scala track and it's really annoying to create the files. We should create them for all exercises. Mostly without any code, so we don't force specific ways of solving the problems.

@kytrinyx
Copy link
Member

Do you mean completely empty files? Or with empty function definitions?

@behrtam
Copy link
Contributor

behrtam commented Apr 14, 2016

The test suits define the class and/or function names, so I would add them as the developer has no choice about that. It's just tiring work that doesn't add any learning value.

@kytrinyx
Copy link
Member

That sounds reasonable to me.

@lbain
Copy link

lbain commented Jul 16, 2016

For what it's worth, I learned about how python file/function names can be imported from Exercism because the default file and functions weren't supplied. Hello World simply uses import hello_world and then explicitly calls hello_world.hello() from there. But the next exercise (leap year) uses from year import is_leap_year and it took me a bit of investigating to work out how it all fits together. Sure, it's probably less valuable after the first two or three, but needing to create new files did teach me something at first.

@Dog
Copy link
Contributor

Dog commented Aug 1, 2016

@lbain 's situation is why I've been resistant to including skeleton files. I wonder if it may be experienced more by people who have more experience with the programming language already. I felt keeping skeleton files out at least forces people to figure out how imports work, and it becomes less of an issue later on when exercises get more difficult.

@tewe
Copy link

tewe commented Oct 7, 2016

Having stubs would take the fun out of exercises that require special method names, like Clock.

How about storing the file name in the exercise? Then exercism submit wouldn't have to ask and a new exercism edit could launch an empty $EDITOR.

@arcuru
Copy link
Contributor

arcuru commented Oct 7, 2016

@tewe Those may be good suggestions for the client, as the client would have to build those in before we used it here, and I'm not familiar enough to know why they chose not to do that.

May be a good question for https://github.com/exercism/cli

@pheanex
Copy link
Contributor

pheanex commented Feb 16, 2017

Let's get this started -> #415 Please Review
@tewe I also renamed the files such that the name of the test- and implementation-files can be deduced from the exercise-name
I'm with @gytdau and think adding initial/minimal skeleton files makes it more convenient for people to get started with a new exercise and removes the boring/repititious task of creating new files. So they can get started right away and have fun doing the actual exercises.

@behrtam
Copy link
Contributor

behrtam commented Feb 17, 2017

We can create any empty file which is required due to being imported in the test file, that makes sense to me. But having every exercise already started with a class, function or what ever doesn't look like a good idea to me ...

@pheanex
Copy link
Contributor

pheanex commented Feb 17, 2017

what about your argument on on 14 Apr 2016 here?

@behrtam
Copy link
Contributor

behrtam commented Feb 17, 2017

To explain my schizophrenic self. Let's take the luhn exercise as an example. Right now we only provide the test file with the line from luhn import Luhn. So, we should definitely provide a luhn.py file, no question about that. But how much more should be thought about carefully. Options would be ...

  • an empty file

  • a minimalistic class

class Luhn(object):
    pass
  • a class with all methods
class Luhn:
    def __init__(self, number):
        pass

    def addends(self):
        pass

    def checksum(self):
        pass

    def is_valid(self):
        pass

    @staticmethod
    def create(n):
        pass

To provide the full structure, all function parameter names, etc might be a good idea for some exercises (especially for the first exercises), but I won't do it for all. Coming up with good parameter names, understanding the test suit and what needs to be implemented should be part of the learning experience as well. So, I would go with the minimalistic class and if the task is to implement functions, I would leave out the parameters in the stub file.

@tewe
Copy link

tewe commented Feb 17, 2017

I vote for the empty file. People should be free to satisfy an API expecting a class with a function (or a duck) of the same name.

@pheanex
Copy link
Contributor

pheanex commented Feb 17, 2017

one advantage of already providing the names would be more comparable solutions. But i can also the advantage of it being part of the exercise, although a bit strenouos if you do more exercises in a session.
=> How do we decide? Is it by voting or does @behrtam pick one?

@tewe
Copy link

tewe commented Feb 17, 2017

I want diverse solutions, not comparable ones.

@pheanex
Copy link
Contributor

pheanex commented Feb 20, 2017

=> Fallback: Finding decision by default: "By voting" => 2/1 for minimal-skeletton-files
=> I updated the PR => Please review again.

pheanex added a commit to pheanex/xpython that referenced this issue Mar 1, 2017
* rewrite tests so that users have more freedom of implementation
* update example-implementation to fit test-interface
* reduce skeleton to minimal as discussed in exercism#272
pheanex added a commit to pheanex/xpython that referenced this issue Mar 1, 2017
* rewrite tests so that users have more freedom of implementation
* update example-implementation to fit test-interface
* reduce skeleton to minimal as discussed in exercism#272
pheanex added a commit to pheanex/xpython that referenced this issue Mar 2, 2017
* rewrite tests so that users have more freedom of implementation
* update example-implementation to fit test-interface
* reduce skeleton to minimal as discussed in exercism#272
pheanex added a commit to pheanex/xpython that referenced this issue Mar 12, 2017
pheanex added a commit to pheanex/xpython that referenced this issue Mar 12, 2017
@iHiD
Copy link
Member

iHiD commented Apr 2, 2019

With reference to this discussion, you may want to consider https://github.com/exercism/exercism/issues/4789

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants