Skip to content
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

Use of abbreviations and jargon #52

Open
MichaReiser opened this issue May 17, 2023 · 3 comments
Open

Use of abbreviations and jargon #52

MichaReiser opened this issue May 17, 2023 · 3 comments
Labels
question Further information is requested

Comments

@MichaReiser
Copy link
Contributor

I assume that the use of abbreviating statement as stmt is for CPython compatibility. Another reason might be that it's slightly less to type but I think that's no longer a big concern, now that we have powerful IDEs like rust-analyzer.

The downside I see with using abbreviations (and chargon) is that it increases the barrier for new contributors for RustPython or downstream crates. Some of them may never have heard of stmt or what an expr is and it takes them, maybe only a little, time to understand that it is an abbreviation for statement.

That's why we at rome had the following two philosophies when it comes to naming:

  • Utilize verbosity when naming commands and flags. No unnecessary and confusing abbreviations.
  • Reduce jargon. Don’t assume that users will understand specific terminology. Strive to provide clear meaning for experts and beginners. For example, use “character” where you would traditionally use “token” when producing parser errors.

I'm curious to hear your perspective on this subject.

@MichaReiser MichaReiser added the question Further information is requested label May 17, 2023
@MichaReiser MichaReiser changed the title Avoid abbreviations Use of abbreviations and jargon May 17, 2023
@youknowone
Copy link
Member

youknowone commented May 17, 2023

In my opinion, the biggest benefit of using the Python(not CPython, but Python here) AST originated terms is documentation. People can learn it from official document https://docs.python.org/3/library/ast.html
Another benefit is matching with python runtime. I expect user of this library has more chance to be familiar with Python. They can use ast.parse which returns the same AST. I think alignment gives more value than more describing name.

Enhancing parser error sounds very good idea as long as keeping consistency with SyntaxError for the same reason. I will keep using same token terms with tokenize module, but ParseError will not be part of that. Because Python doesn't expose error variant but only error messages, renaming variants will be a good idea. Appending more human friendly error messages to original messages will be too.

If you are also regarding it, I think renaming Cmpop to CmpOp will be good. It will not make document lookup harder but less confusing.

@DimitrisJim
Copy link
Member

DimitrisJim commented May 17, 2023

Though the intent is indeed a +1 I'd also stick with the ugly abbreviations due to the reasons YunWon states. Of course, non-public facing names with such a relation to Python can and should be as clear as possible.

@youknowone
Copy link
Member

Do you have good suggestions for new names of ParseErrorType variants?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants