Skip to content

adding parameters to template A - B - #514

Merged
ilya-khadykin merged 2 commits into
exercism:masterfrom
jankaifer:master
Aug 24, 2017
Merged

ilya-khadykin merged 2 commits into
exercism:masterfrom
jankaifer:master

Conversation

@jankaifer

Copy link
Copy Markdown

viz issue #509

@ilya-khadykin ilya-khadykin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

As an improvement, I would name params with meaningful names rather than generic ones. But it's up to you to decide

@@ -1,2 +1,2 @@
def accumulate():
def accumulate(array, function):

@ilya-khadykin ilya-khadykin Aug 22, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks Ok to me, but some people would argue that you will force people to certain implementations by giving exact params.

I personally think it's a good idea to do so anyway, if one still doesn't want to follow suggested method signature he/she can ignore it and write his/her own implementation.

Moreover, sometimes forcing certain implementation helps people to use features of the language they aren't used to (like passing functions to a method, not all languages allow that etc)

As an improvement, I would name params with meaningful names rather than generic ones. But it's up to you to decide

@jankaifer jankaifer Aug 22, 2017 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an improvement, I would name params with meaningful names rather than generic ones. But it's up to you to decide

I wanted to use names from example.py, but as @behrtam said in issue #509 choosing good name is important thing too. So I chose generic ones. But that is just detail which depends on exercise creator.

And meaningful names are sometimes too long or it's not clear the type of variable just from the name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jankaifer, got it, thanks for clarification

@ilya-khadykin
ilya-khadykin merged commit acf16a9 into exercism:master Aug 24, 2017
@ilya-khadykin

ilya-khadykin commented Aug 24, 2017 •

Copy link
Copy Markdown
Contributor

@jankaifer, I've merged your changes, thanks.

And I think it's a good idea to give a learner a little clue of what they should do by providing expected parameters

@behrtam

behrtam commented Aug 24, 2017 •

Copy link
Copy Markdown
Contributor

We explicitly decided against parameters/arguments when we added stups ...

I asked in the issue why this should be done, than @jankaifer suggested that renaming is easy and maybe strange placeholders might work. So the discussion was still open ... but you merged this anyway why? I'm not really opposed to this, just think the process is wrong.

@ilya-khadykin

ilya-khadykin commented Aug 24, 2017 •

Copy link
Copy Markdown
Contributor

@behrtam, we can always revert this changes.

Why are you against of having the params in example code? I find it somewhat confusing to not have them. And tests still expect some certain types from you, take a look at https://github.com/exercism/python/blob/master/exercises/leap/leap_test.py for example

As I said before, the learner can ignore them if he/she thinks the suggest signature is not correct or convenient

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

Successfully merging this pull request may close these issues.

3 participants