SAP / styleguides

This repository provides SAP style guides for coding and coding-related topics.
Other
1.68k stars 444 forks source link

Follow rules when abbreviating #342

Open kjetil-kilhavn opened 1 year ago

kjetil-kilhavn commented 1 year ago

Proposed Rule

When abbreviations are required, follow a set of rules instead of trying to be creative. Not only does it require less thinking on your part, it also makes it more likely that another developer will understand what has been abbreviated.

  1. Use common abbreviations such as doc for document and tel for telephone
  2. Remove filler words such as of or at, i.e. arrival_time_port instead of arrivl_tme_at_prt
  3. Omit vowels, unless they are at the beginning or end of a word
  4. Replace double consonants with single consonants
  5. Abbreviate the least significant and/or longest parts first, i.e. purchsr_city instead of purchaser_ct
  6. Abbreviate the last parts before the first parts, i.e. purchase_requisitn instead of prchse_requisition

Additionally, avoid that the result is similar to a common abbreviation for a completely different term.

" you have 15 characters available for 'delegation responsibility'
dlgtn_rspnsblty

is better than

" anti-pattern - is it response or responsibility?
delegation_resp

Justification

These are the recommendations in SAP's documentation which has a lot more to say about the topic - but I wasn't sure if such a long text block could be included in a rule here. https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abentelling_names_guidl.htm

larshp commented 1 year ago

I think https://github.com/SAP/styleguides/issues/253 is relevant in this case