Syntax error for simple script

Erik python at lucidity.plus.com
Wed Jun 28 18:00:30 EDT 2017


On 28/06/17 03:46, Steve D'Aprano wrote:
> All of this is irrelevant if beginners don't read the error message.

"if".

> End-users
> don't read error messages, no matter how well written they are,

Reference?

> and every word
> you add probably cuts the number of people reading it by half.

"probably".

> That's not something needed in the error message
> itself (imagine how annoying it would be if ZeroDivisionError tried to explain
> the basis of arithmetic and why you can't divide by zero),

Nobody is suggesting that. You are blowing things out of proportion. We 
are talking about a much more likely scenario that has been brought 
about by the very specific transition of "print" from a statement to a 
function between Python versions while there are still many tutorials 
and how-to guides online which will cite the earlier, obsolete syntax.

> and rather than
> helping the newbie, it will probably intimidate

"probably"

> When designing an error message, imagine that you are going to read it a dozen
> times a day, every day, for the rest of your career.

I did. I thought the suggestion (current text, followed by a bit more 
information for those who don't immediately recognise the message) was a 
reasonable compromise.

Are you honestly suggesting that people with a career in programming 
would make this same mistake a dozen times a day, every day? As I said 
in my previous email, I would be _very_ surprised if this particular 
error is generated at all outside of the "beginner typing in a Py2 
example" and "person who flips between the two versions and forgets 
occasionally to add the parentheses in Py3".

I presumed we were being a bit more pragmatic about this specific issue 
rather than talking about general theory of error messages. There is 
presumably a reason why this error was specifically introduced for 
Py3.[45] as you have previously asserted.

>> I would suggest that making the error dissuade them from doing that (for
>> the cost of a few tens of bytes) is a good thing.
> 
> The cost isn't ten bytes. The cost is human attention span.

I do not understand what you are alluding to here.

> Don't think of the newbie reading the error for the first time, because that
> only happens *once*. Think of them reading it for the 50th time. Do you think
> they will still appreciate your little history lesson?

My "little history lesson"? Wow.

> Of course it could. It could also include a link to the Python documentation, a
> history of how and why Python 3000 came to be, and a note that if you email the
> Python Software Foundation they'll pay you $50, and none of these things will
> make the slightest difference if people don't read them.

Steven, you do this a lot. You take someone's comments and then blow it 
out of proportion and say ridiculous things in response "Hey, let's just 
include the kitchen sink, shall we?". Do you realise that those people 
are also trying to be productive and helpful? Putting people down like 
this is not respectful of the thought and effort they have put in to 
make the comment in the first place.

I'm not saying you shouldn't point out if you think someone is wrong, 
but there are ways of doing it.

Regards, E.



More information about the Python-list mailing list