Repository navigation
adding parameters to template A - B - #514
Conversation
accumulate - bracket-push
ilya-khadykin
left a comment
There was a problem hiding this comment.
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): | |||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
|
@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 |
|
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. |
|
@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 |
viz issue #509