Skip to content

Clarify calling functions explanation#1635

Merged
das-g merged 2 commits intoDjangoGirls:masterfrom
lindboe:clarify-function-definition-vs-execution
Jan 26, 2020
Merged

Clarify calling functions explanation#1635
das-g merged 2 commits intoDjangoGirls:masterfrom
lindboe:clarify-function-definition-vs-execution

Conversation

@lindboe
Copy link
Copy Markdown
Contributor

@lindboe lindboe commented Jan 24, 2020

The original explanation says that we re-write the name of the example function at the bottom of the file "because Python reads the file from top to bottom, so we need to re-write the name of the function." I find that explanation a bit confusing myself; the primary reason that we need to write hi() is because we need to execute it, not because of Python's ordering properties.

I think two things were conflated here:

  1. The difference between defining and running a function
  2. Explaining that Python reads files from top to bottom, and needs functions to be defined before they can be called

I tried to more explicitly explain that what we're doing is calling a function we just defined, and break these concepts apart more. Very open to feedback on ways to do this better.

The original explanation says that we re-write the name of the example
function at the bottom of the file "because Python reads the file from
top to bottom, so we need to re-write the name of the function." I find
that explanation a bit confusing myself.

I think two things were conflated here:
1) The difference between defining and running a function
2) Explaining that Python reads files from top to bottom, and needs
functions to be defined before they can be called

I tried to more explicitly explain that what we're doing is calling a
function we just defined, and break these concepts apart more.
Copy link
Copy Markdown
Member

@das-g das-g left a comment

Choose a reason for hiding this comment

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

Great improvement! This part has been a source for confusion for some workshop participants.

Please consider my suggestion for keeping the text a bit more simple (and arguably more correct, albeit less explicit) by only mentioning one function.

Comment thread en/python_introduction/README.md Outdated
Make it clear that we only have to define the given function before we call it, to avoid making readers think they might have to define all functions before any are called

Co-Authored-By: Raphael Das Gupta <raphael.das.gupta@hsr.ch>
@lindboe lindboe requested a review from das-g January 25, 2020 22:59
Copy link
Copy Markdown
Member

@das-g das-g left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@das-g das-g merged commit 9eb953c into DjangoGirls:master Jan 26, 2020
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.

2 participants