[Tutor] Writing the right code rite

Steven D'Aprano steve at pearwood.info
Tue Nov 27 05:39:38 EST 2018


On Mon, Nov 26, 2018 at 07:18:46PM -0500, Avi Gross wrote:

> What kind of answers have people provided?

The archives of this mailing list go back to 1994. If you spend some 
time browsing randomly at the answers people provide, you should get a 
feel for what sort of answers we tend to give.

https://mail.python.org/pipermail/tutor/



> I know it slows things down, especially with a moderator, but often the best
> answer is to ask some questions before trying to supply an answer.

Indeed. Learning how to ask good questions is part of the learning 
process, and when people ask poor questions, asking questions in return 
will either:

- teach them by example what sort of information they need to solve 
their problem; or

- discourage the lazy help-vampires from draining the energy out of this 
group.

http://www.skidmore.edu/~pdwyer/e/eoc/help_vampire.htm



> Perhaps a
> rapid email exchange directly with a student, perhaps moving on to instant
> messaging or phone or video forms of communication would work better for
> those interested.

Of course you are an adult in a free country and you have the right to 
do whatever you like, but I don't recommend this. In fact I would 
consider it anti-social and hostile to the rest of the community.

I think I speak for most of us when I say we're looking to help and 
educate the entire community. We're not the personal servants of 
individual posters, or private teachers. We post so that *everyone* can 
learn from the answers, not just the person asking the question, and the 
*process* of reaching the answer is just as important as the final code. 

Taking that process off-list is, in my opinion, not helping the 
community. (Here, I'm not speaking for others.)

Its also likely to get annoying fast, for both parties: you, when the 
poster starts bombarding you with question after question, and the 
poster themselves, when you are too slow to respond. At least if they 
email the list, there is the opportunity for others to reply in your 
stead.

Of course there are circumstances where it is appropriate to take 
discussion off-list:

- you're being paid to help;

- the discussion wanders off-topic;

- or it becomes irrelevant and of no interest to the rest of the 
community (perhaps because it is too specialised to interest anyone but 
yourself and the original poster);

- or moves into confidential/private areas of discussions that shouldn't 
be posted to the list (were you asked to sign an NDA?);

etc. Some subjective judgement may be required.


> When done, you might post a summary if appropriate for
> others interested but note showing a full solution can be unfair if other
> students working on the same problem just latch on to that.

The community standard here is that we don't do homework for others. 
We'll answer concrete questions about Python the language itself, of 
course: "how do I use the zip function?". We'll help them debug their 
code, if they've written some code.

If they haven't written even a single line of code, we generally don't 
do much more than say "Show us what you've tried."

We'll help guide people towards solutions, but not hand them the 
solution on a platter.

That's for students in school, of course. We're a bit more flexible when 
it comes to self-learners or even professional programmers asking for 
help. And we usually take it on trust if they say "this isn't homework".

But even then, we're not the personal slave of the poster, and we have 
no obligation to solve their problem for them. We're not obliged to hand 
over a complete solution, and in fact doing so goes against our stated 
aim to *teach* people. (How will they learn effectively if we do their 
work for them?)

Again, some subjective judgement is required. I wouldn't hesitate to 
answer minor or trivial questions in full, e.g. "how do I count the 
number of digits in a string?". If it were homework, I might answer a 
slightly different question instead:

number_of_vowels = sum(thestring.count(vowel) for vowel in "aeiouAEIOU")

and let them generalise to digits. But more substantial questions, I 
probably wouldn't unless the problem really tickled my fancy and I had 
plenty of time to work on a solution.

(Time. I remember when I had time.)


-- 
Steve


More information about the Tutor mailing list