-
-
Notifications
You must be signed in to change notification settings - Fork 807
Drop 'import ... as ...' syntax #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It's not worth introducing extra syntax just because folks might see this in the wild. As Greg said in 181e463 (Starting to write instructor's guide, 2015-02-15): In order to teach that, we must teach people a little about the mechanics of manipulating data with lists and file I/O so that their functions can do things they actually care about. Our teaching order tries to show practical uses of every idea as soon as it is introduced; instructors should resist the temptation to explain the "other 90%" of the language as well.
|
Mmm... the other reason for introducing the aliases is that instructors and learners are typing this stuff as they go along, and some of them won't have editors that tab-complete. |
|
Since this only about Python
and I expect that people use IPython Notebook
**that has tab-complete**
I'm +1 to drop `import ... as ...`
**for our novice lesson**.
|
|
A large number of instructors don't use the Notebook (at least not |
|
On Fri, Apr 10, 2015 at 04:26:57AM -0700, Greg Wilson wrote:
Do they use IPython's command line interface? Or do they switch |
|
On Fri, Apr 10, 2015 at 02:59:22AM -0700, Greg Wilson wrote:
And this commit only requires:
in the core topics (not counting the code/readings-*.py, since they're |
|
I agree with @gvwilson on this one. When we tab complete what we are doing is invisible to our students |
|
On Fri, Apr 10, 2015 at 09:13:16AM -0700, Azalee Bostroem wrote:
And when we introduce new syntax we're loading our learner's short |
|
Is explaining tab-completion a large cost?
The problem isn't explaining tab-completion
but that students aren't used to it.
|
|
I think a handful of additional characters is a really good deal for not having to introduce a concept we would rather avoid having to talk about in the first exposure to Python. |
|
This issue seems controversial and with good arguments for either side. I think the only fair way to settle this is with a good old fashioned vote. Register your +1 for either A) dropping import aliases or B) keeping import aliases. We'll give it several days, or until there's an obvious consensus. I'm +1 for keeping them. |
|
On Mon, Apr 20, 2015 at 06:33:30AM -0700, Trevor Bekolay wrote:
I'm +1 for dropping them (obviously ;). To help me understand your preference for dropping them, do you think |
|
Just the weighting; I think the "folks will see this in the wild" and "my fingers hurt from typing" outweigh the short term memory demand. Many novices that I have taught are slow at editing text; they type at a leisurely pace, and when they make a mistake at the start of a line, they may not realize it for a while. Once they realize it, they'll backspace back to where they made the error, and start typing from that point. Not that big a deal for |
|
+1 for keeping.
|
|
On Mon, Apr 20, 2015 at 09:56:21AM -0700, Trevor Bekolay wrote:
Agreed. More typing isn't free.
Also agreed, but with this change they only have to type it out twice As an aside on the inline business, UW was mostly taught from an older |
|
I vote +1 for dropping "import as". I think that On a related issue, I'd also favour Personally I think that |
|
I'm +1 for using the following: import numpy as np These are all very common syntaxes in on line documentation and I think exposure to it is important for our students |
|
I agree that it is important to show the I would also like to reiterate that it would be great if we found a way for a more data-driven discussion (i.e. experiment with either model), instead of only relying on (very valuable, but nevertheless) anecdotal evidence and personal opinions. |
|
I agree with @abostroem ( The problem with tab completion is that no matter how many times you say they should use it, some people don't do it and prefer trust their typing. I guess non-programmers never have to use tab, so it's a really strange key for them. |
|
On Mon, Apr 20, 2015 at 12:13:33PM -0700, Bernhard Konrad wrote:
What lesson do you teach for the second Python lecture? |
|
On Mon, Apr 20, 2015 at 12:16:33PM -0700, Ivan Gonzalez wrote:
I think this is just so frozen into the numpy community that it's hard |
|
On Mon, Apr 20, 2015 at 12:13:33PM -0700, Bernhard Konrad wrote:
+1. Until then, we can bikeshed over the central phrasing, and then |
Maybe, but this is where we are :-) In any case, maybe a good compromise would be to add to your PR an extra sentence (maybe in a callout or something in the extra files) explaining |
|
On Mon, Apr 20, 2015 at 12:36:36PM -0700, Ivan Gonzalez wrote:
No ‘import … as …’ in the main flow with a short ‘import … as …’ |
|
FWIW, I'm +1 for dropping |
|
I don't think Either way I think the examples and exercises have to be consistent i.e. I'm -1 on introducing the syntax later since that will really confuse people. |
|
@kynan in my experience As a cognitive science speculation I think this is a variant of object permanence [1]: While seasoned coders have a reasonably complete mental model of the context relevant to their code (and are quick to figure out where they may have their model wrong), beginners tend to be aware of the code on the screen only. Once code grows to a size where the |
|
As of now, I count 5 in favour of dropping, 4 in favour of keeping, and 1 neutral (as long as it's consistent). It's not a strong consensus, but in the interest of moving forward I'm going to merge this and add a note about it to |
|
On Thu, Apr 30, 2015 at 06:35:23AM -0700, Trevor Bekolay wrote:
That sounds close enough that the callout middle ground might be |
|
Ah, I missed that callout suggestion. I'll add it to #76. |
Phonic wholeword
It's not worth introducing extra syntax just because folks might see
this in the wild. As Greg said in 181e463 (Starting to write
instructor's guide, 2015-02-15):