Skip to content

Conversation

@wd15
Copy link
Contributor

@wd15 wd15 commented Feb 24, 2016

Improve the function lesson by including an SVG image of a function
with annotation. Image helps to break up the text and more easily
explain the parts of a function than just reading the text.

Improve the function lesson by including an SVG image of a function
with annotation. Image helps to break up the text and more easily
explain the parts of a function than just reading the text.

 * An explanation about how to reproduce the image is here,
https://gist.github.com/wd15/2b4ffbe5ce0d0ddb8a5b.

 * This addition is part of the instructor training for Daniel Wheeler.
06-func.md Outdated
<!--- see https://gist.github.com/wd15/2b4ffbe5ce0d0ddb8a5b to
regenerate the above figure --->

The function definition opens with the word `def`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you could use "keyword" instead of "word".

@iglpdc
Copy link
Contributor

iglpdc commented Mar 22, 2016

Looks a good idea to me, but for some minor details. I usually explain this when teach and it's nice to have it in the lesson.

Apart from the comments above, you use "signature" for the "def" part. But the signature is defined taking into account the arguments (and the return type in some other languages at least) [1].

I think better alternatives could be:

  • label "def" as "def keyword" or something like that, and/or
  • label the whole first line as "function prototype" or something similar. I don't know whether there's a better name in Python for this, but "function prototype" is the name used in other languages.

[1] https://www.python.org/dev/peps/pep-0362/

@wd15
Copy link
Contributor Author

wd15 commented Mar 22, 2016

@iglpdc, thanks for the feedback -- will update the pull-request soon.

Address swcarpentry#242

Change `signature` to `def keyword` in image and update associated
sentence in text.
@wd15
Copy link
Contributor Author

wd15 commented Mar 23, 2016

@iglpdc, updated without adding "function prototype", but used "def keyword" and modified the associated sentence.

@valentina-s valentina-s merged commit 79b53ea into swcarpentry:gh-pages May 22, 2016
@valentina-s
Copy link
Contributor

Looks good! Thank you for your contribution.

maxim-belkin pushed a commit that referenced this pull request May 17, 2018
Add note about the version of the style
zkamvar pushed a commit that referenced this pull request Apr 21, 2023
Address #242

Change `signature` to `def keyword` in image and update associated
sentence in text.
zkamvar pushed a commit that referenced this pull request Apr 21, 2023
Include a blueprint for a function image
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.

4 participants