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

Chapter "Avoid abbreviations" #346

Open
mariomuellergermany opened this issue Jan 26, 2024 · 7 comments
Open

Chapter "Avoid abbreviations" #346

mariomuellergermany opened this issue Jan 26, 2024 · 7 comments
Labels
Adjustment Of Rule The issue or PR proposes an adjustment of a rule or set of rules clean-abap

Comments

@mariomuellergermany
Copy link

mariomuellergermany commented Jan 26, 2024

Chapter abrevations says:

"If you do have to abbreviate, start with the unimportant words."

It would be far better to do without "vowels". Scientific studies have shown that the text remains comprehensible.

grafik

thanks regards, Mario

@mariomuellergermany mariomuellergermany added Adjustment Of Rule The issue or PR proposes an adjustment of a rule or set of rules clean-abap labels Jan 26, 2024
@ConjuringCoffee
Copy link
Contributor

Thanks for the contribution, but... 😉

Please use English for issues, pull requests, and discussions. Due to the wide-spread presence of English as a second language, SAP uses English as its common language to facilitate cross-culture communication.

@mariomuellergermany
Copy link
Author

Done ! :-)

@larshp
Copy link
Contributor

larshp commented Jan 27, 2024

and the title?

@mariomuellergermany mariomuellergermany changed the title Kapitel "Abkürzungen vermeiden" Chapter "Avoid abbreviations" Jan 27, 2024
@mariomuellergermany
Copy link
Author

Done

@pokrakam
Copy link
Contributor

pokrakam commented Jan 30, 2024

The online help also provides some good guidance on when to abbreviate and when to remove vowels.

See under Descriptive Names:
You should avoid using abbreviations as name components wherever possible. Exceptions to this rule are abbreviations that are usually used instead of the complete term, such as GUI or XML. However, if the use of certain abbreviations cannot be avoided due to restricted space, you should initially use common abbreviations.

If no common abbreviation exists, you should proceed as follows: Vowels are omitted, unless they are the first letter of the word. They are of minor significance for the recognition value. If a word starts with a double vowel, both letters are kept for ease of recognition (for example, outbnd as the abbreviation for outbound instead of otbnd). If further abbreviations are required, you can replace double consonants with single consonants. Even after this step, the word is generally still recognizable.

Or in German here

@larshp
Copy link
Contributor

larshp commented Jan 31, 2024

#253

@bjoern-jueliger-sap
Copy link
Member

I think the suggestion in the guide is actually correct, but as so often not sufficiently explained. Here's my take on how getting rid of unimportant words makes more sense than abbreviating vowels.

For instance, in languages with unrestricted identifier length (which is, uh, all languages that aren't ABAP...), it's common to have long unit test names of the form given_X_when_Y_then_Z, where X, Y, Z can be quite elaborate identifiers themselves.

This obviously doesn't work in ABAP, but is the variant gvn_x_wn_y_thn_z, where x, y, z, are the vowel-reduced forms of X, Y, Z, really what we consider the correct and readable solution? I think it isn't - in this case it's much better to encode one of the three given/when/thens into the name of the test class, and the rest into the name of the test method. Then we have 60 characters to work with, which gives much more breathing room to not have to resort to consonant messes. And if the convention is given_X=>when_Y_then_Z, then we might as well omit part of this and just choose X=>Y_then_Z.

This is my interpretation of the "start with the unimportant words" suggestion - we got rid of the given and when without losing information or readability. In other common cases, such "unimportant" words are often get_ (is there really any danger of someone having a harder time interpreting data(customer_name) = customer->name( ). than data(customer_name) = customer->get_name( ).?) or repeating the name of the type in the method name (customer->set_customer_name( name ). is not better than customer->set_name( name ) .. If someone names their customer object instance in a way that they can't see it's a customer, that's their naming problem, not mine.)

Of course, you might not have any such unimportant words and still hit the character limit. In that case, I agree the vowels will have to go :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adjustment Of Rule The issue or PR proposes an adjustment of a rule or set of rules clean-abap
Projects
None yet
Development

No branches or pull requests

5 participants