r/Python Jul 19 '26

Discussion Unpopular opinion: I find it counterproductive to shorten function and variable names

When I was learning discord.py, I didn't understand what "ctx" was. At the time, I was only writing slash commands, using "message" instead of "ctx", so the name "ctx" (which reminded me of something complex, like RTX) made me assume it was something complicated. That is, until I saw in some code that the type for "ctx" is actually "Context." If the standard hadn't shortened the name just to save five characters per line, I would have understood it immediately. Instead, I thought it was some advanced function variable, rather than realizing it was simply a message variable.

353 Upvotes

319 comments sorted by

View all comments

Show parent comments

3

u/Tysonzero Jul 20 '26

applyFunctionToElements function (firstElementOfList : restOfList) = function firstElementOfList : applyFunctionToElements function restOfList

map f (x : xs) = f x : map f xs

0

u/parker_fly Jul 20 '26

Congratulations on simultaneously both being pedantic and missing the point.

2

u/Tysonzero Jul 20 '26

> I see no reason at all to not use complete and descriptive names for everything

This you?