Comments (7)
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.
from styleguides.
Done ! :-)
from styleguides.
and the title?
from styleguides.
Done
from styleguides.
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
from styleguides.
from styleguides.
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 :)
from styleguides.
Related Issues (20)
- Use assert class instead of ASSERT HOT 12
- Are comments bad or not?
- [Use CHANGING sparingly, where suited] Is it ok to use IMPORTING REF instead of CHANGING? HOT 7
- New rule: prefer inferring types HOT 1
- Abap Exception categories HOT 3
- Use READ-ONLY sparingly - new abap command FINAL HOT 2
- How to add sample code to Clean ABAP? HOT 1
- Unclear explanation of [Use LOCAL FRIENDS to access the dependency-inverting constructor] HOT 5
- Follow rules when abbreviating HOT 1
- "Dead" link at section "split-method-instead-of-boolean-input-parameter" HOT 3
- [Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE] In defense of RAISE EXCEPTION TYPE HOT 7
- Prefer ENUM to constants interfaces HOT 1
- [Use | to assemble text] Is a caveat needed in case of translatable texts? HOT 7
- "New rule" Tables > Prefer a Table Expression to READ TABLE HOT 3
- Clarify Show Message Text Shortcut HOT 2
- Prefer INSERT INTO TABLE to APPEND TO HOT 11
- [Close Brackets at Line End] Is this always a good thing? HOT 9
- Any chance for SAPUI5 or CAP Adaption? HOT 3
- [Close brackets at line end] rule is the root of all right leaning code in ABAP HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from styleguides.