Clarify calling functions explanation#1635
Merged
das-g merged 2 commits intoDjangoGirls:masterfrom Jan 26, 2020
Merged
Conversation
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.
das-g
requested changes
Jan 25, 2020
Member
das-g
left a comment
There was a problem hiding this comment.
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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.