Skip to content

Latest commit

 

History

History
321 lines (251 loc) · 7.33 KB

README.md

File metadata and controls

321 lines (251 loc) · 7.33 KB

Abbreviations in code

The list of the abbreviations you can find and use in software environments.

Index

A good abbreviation is:

  • global • understood by everyone
  • significant • seen for the first time you still know what it means
  • absolute • not related to the context
  • short • taking out one letter is not an abbreviation

Goal

Giving good names to variables, functions, classes, files etc. can be difficult. Long names are always clear, but take time to read, take up space and are hard to remember. Choosing a shorter form is better.

If you use the abbreviations below, your naming will become more coherent, logical and understandable to other programmers (even newbies).

Guide

Abbreviations are in key–value format. Multiple choices are sorted from most to least used. Colored circles signify the degree of recommendation:

  • 🟢 Recommended
  • 🟡 Context-sensitive
  • 🔴 Not recommended

Unrecommended ones can still be considered. The most important thing is to remain consistent in your code.

List

Numbers

  • 🔴 2 • to

A

  • 🟢 abbr • abbreviation
  • 🟢 abs • absolute number
  • 🔴 act • action / active / actual
  • 🟢 addr • address
  • 🟡 alloc • allocate {memory}
  • 🟢 alt • alternative / alternate
  • 🟢 app • application
  • 🟡 arg • argument {memory}
  • 🟢 arr • array
  • 🟢 async • asynchronous
  • 🟢 attr • attribute
  • 🟢 auth • authentication / authenticate
  • 🟢 avg • average

B

  • 🟡 bat • battery {power}
  • 🟢 bg • background
  • 🟢 bin • binary
  • 🟡 bl • breakline {encoding}
  • 🟢 bool • boolean
  • 🔴 brk • break
  • 🟢 btn • button
  • 🟢 buf • buffer

C

  • 🟢 calc • calculate / calculator
  • 🟢 cb • callback
  • 🟢 cert • certificate
  • 🟡 ch • channel {connection}
  • 🟢 chk • check
  • 🟢 char • character
  • 🟡 circ • circle {shape}
  • 🟢 clr • clear
  • 🟢 cmd • command
  • 🟡 cmp • compare {conditional operator}
  • 🟢 cnt • counter
  • 🟢 concat • concatenate
  • 🟢 conf / config • configuration
  • 🟢 conn • connection {connection}
  • 🟢 cont • continue
  • 🟢 conv • conversation
  • 🟢 col • column
  • 🟢 coll • collection
  • 🔴 com • commercial / common / communication
  • 🟢 coord • coordinate
  • 🟢 cos • cosine
  • 🟢 cot • cotangent
  • 🟡 csum • checksum {operation}
  • 🟢 ctrl • control
  • 🟢 ctx • context
  • 🟢 cur / curr • current
  • 🔴 cpy • copy

D

  • 🟢 db • database
  • 🟢 dbg • debug
  • 🟢 dec • decimal / decrease
  • 🟢 def • default / define
  • 🟢 del • delete
  • 🟢 dest • destination
  • 🟢 dev • development / device / developer
  • 🟡 diff • difference {operation}
  • 🟢 dir • directory / direction
  • 🟢 dis • disable
  • 🟢 disp • display
  • 🟢 doc • document
  • 🟢 drv • driver
  • 🟢 dsc • descriptor
  • 🟡 dt • delta time {calculation}
  • 🟢 dyn • dynamic

E

  • 🟢 e • event
  • 🟢 e.g. • example
  • 🟢 en • enable
  • 🟢 env • environment
  • 🟡 eq • equal {binary operation}
  • 🟢 err • error
  • 🟢 exe • executable
  • 🟢 expr • expression
  • 🟢 ext • extension
  • 🟢 etc • etcetera

F

  • 🟢 f / func • function
  • 🟢 fac • factory
  • 🟢 fd • file descriptor
  • 🟢 fig • figure
  • 🟢 fmt • format
  • 🟢 fp • function pointer

G

  • 🟡 ge • greater or equal {binary operation}
  • 🟢 gen • generate
  • 🟡 gt • greater than {binary operation}

H

  • 🟡 h • height {shape}
  • 🟢 hex • hexadecimal
  • 🔴 hdr • header
  • 🟡 hor • horizontal {shape}
  • 🟡 hw • hardware {computer science}

I

  • 🟢 id • identifier
  • 🟢 idx • index
  • 🟢 iface • interface
  • 🟢 img • image
  • 🟢 in • input
  • 🟢 inc • include / increase
  • 🟢 info • information
  • 🟢 init • initialize
  • 🟢 ins • insert
  • 🟢 intf • interface
  • 🟢 int • integer
  • 🟢 iter • iterator

J

  • 🟢 js • javascript

K

  • 🟡 key • object key {only with val}

L

  • 🟢 lang • language
  • 🟡 lat • latitude {only with coord}
  • 🟢 lib • library
  • 🟡 le • less or equal {binary operator}
  • 🟢 len • length
  • 🟢 ll • linked list
  • 🟡 lon • longitude {only with coord}
  • 🟡 lt • less than {binary operators}

M

  • 🟢 max • maximum
  • 🟢 mcu • microcontroller
  • 🟢 mem • memory
  • 🟡 meta • metadata {data science}
  • 🟢 mid • middle
  • 🟢 min • minimum
  • 🟢 misc • miscellaneous
  • 🟢 mng • manager
  • 🟢 mod • modulo
  • 🟢 msg • message
  • 🟡 mut • mutable {variables}

N

  • 🔴 n • no {only with yes}
  • 🟢 nav • navigation
  • 🟡 ne • not equal {binary operator}
  • 🟢 net • network
  • 🟡 nl • newline {endcoding}
  • 🟢 num • number

O

  • 🟢 obj • object
  • 🔴 ord • order {data science}
  • 🟡 op • operation {binary operation}
  • 🟢 opt • option / optional
  • 🟢 os • operating system
  • 🟢 out • output

P

  • 🟡 p • pointer {memory}
  • 🟢 param • parameter
  • 🟢 perf • performance
  • 🟢 pic • picture
  • 🟢 pos • position
  • 🟢 pred • prediction
  • 🟢 pref • preference
  • 🟢 prev • previous
  • 🟡 proc • process {thread}
  • 🟢 prod • production
  • 🟢 prof • profiler
  • 🟢 ptr • pointer
  • 🟢 pr • pull request
  • 🟡 pwr • power {energy}
  • 🟢 px • pixel

Q

  • 🟢 q / qry • query

R

  • 🟡 r • radius {circle / shape}
  • 🟢 rand • random
  • 🟢 rec • record
  • 🟡 rect • rectangle {shape}
  • 🟢 recv • receive
  • 🟢 ref • reference
  • 🟢 regex / rgx • regular expression
  • 🟢 rem • remove
  • 🟢 repo • repository
  • 🟢 req • required / requested
  • 🟢 res • response / result
  • 🟢 ret • return
  • 🟢 rev • revision
  • 🟢 rng • range

S

  • 🟡 s • signed as prefix {modifier}
  • 🟡 sem • semaphore {conditional operator}
  • 🟢 sel • selected / selection
  • 🟢 sin • sine
  • 🟢 seq • sequence
  • 🟢 sqrt • square root
  • 🟢 src • source
  • 🟡 sw • software {computer science}
  • 🟢 stat • statistic
  • 🟢 std • standard
  • 🟢 str • string
  • 🟢 sum • addition
  • 🟢 sync • synchronize

T

  • 🟡 t • time / type (e.g. uint8_t) {type modifier}
  • 🟢 temp • temperature
  • 🟢 temp / tmp • temporary
  • 🔴 tgl • toggle
  • 🟢 tmr • timer
  • 🟢 ts • timestamp
  • 🔴 txt • text

U

  • 🟡 u • user {URLs}
  • 🔴 usr • user

V

  • 🟢 v • value {only with k}
  • 🟡 v • vector / version
  • 🟢 val • value
  • 🟢 var • variable
  • 🟢 ver • version / vertical

W

  • 🟡 w • width {shape}
  • 🟢 win • window
  • 🟡 ws • white space {encoding}

X

Y

  • 🟡 y • yes {only with n}

Z

Symbols

  • 🟡 $... • node ($btn) {jQuery selector / DOM}

Go to index