python-ecology-lesson icon indicating copy to clipboard operation
python-ecology-lesson copied to clipboard

Repeated explanation of functions

Open cbrafter opened this issue 7 years ago • 7 comments

Functions are introduced at the very end of Ep.00, but unused until Ep.05 where they are reintroduced more comprehensively as part of the section dedicated to loops and functions. Should the information about functions in Ep.00 be removed, as it introduces a new concept that isn't in the stated lesson objectives and is treated properly later? Alternatively it could be added to the Ep.00 lesson objectives, and could be given its own challenge?

cbrafter avatar Jan 24 '18 15:01 cbrafter

That's a good point @cbrafter. We discuss functions in the next chapter, but in the sense of loading a library and using pre-existing functions. I think perhaps the best way forward would be to take them out in lesson-00, introduce functions in 01 as pre-existing tools in a library [no change to text], then discuss custom functions in 05. What do you think about that approach? That's a little more in line with how R-ecology is doing it these days, as well.

Note that I'm not committing you to do any of that, just bouncing the idea around;)

wrightaprilm avatar Jan 25 '18 19:01 wrightaprilm

I agree with the approach proposed by @wrightaprilm. I think it would also be worthwhile to move this line

Tip: print and type are built-in functions in Python. Later in this lesson, we will introduce methods and user-defined functions. The Python documentation is excellent for reference on the differences between them.

to 05, and include the link to the Python documentation that explains these differences.

dylanmikesell avatar Feb 14 '18 21:02 dylanmikesell

Hi everybody! I see the problem, but I have a different suggestion. I agree with moving intro to functions from 00 episode to 01 episode, but add it to section "Useful Ways to View DataFrame objects in Python", where methods are introduced. How I would phrase it is that attributes are descriptions of objects, for example "this cat is black" and methods are small functions that require more lines of code, for example how much weight this cat lost weight in kg since last vet visit".

pinsleepe avatar Feb 23 '18 09:02 pinsleepe

OK, so for those following along at home, here are the proposals:

  • [ ] Remove references to functions in lesson 00.
  • [ ] Add a definition of a method, since we use that term
  • [ ] Move custom definitions to 05.

Does that sound right? Let me know if it doesn't - I'll amend the checklist. Any one of these items would be a good instructor training checkout exercise.

wrightaprilm avatar Feb 23 '18 21:02 wrightaprilm

I will make this a part of my instructor checkout ;)

pinsleepe avatar Feb 26 '18 07:02 pinsleepe

Hi @pinsleepe, I wanted to check in if you still intend to get to this, or if I can mark it as up-for-grabs for the Bug BBQ. Either way is totally fine. Thanks!

wrightaprilm avatar Apr 05 '18 18:04 wrightaprilm

I think explaining and using build in function should be introduced in the introduction, but how to write own functions is more advanced and should only come later or dropped from the lesson (the R lesson for example does not introduce functions at all) I just added a pull-request #260 with a rewritten introduction which does not include the self defined function anymore

katrintirok avatar Apr 08 '18 17:04 katrintirok

Closed together with #260

btovar avatar May 19 '23 11:05 btovar