Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A list of common terms used in programming and their respective antonyms.

Antonym List

Note: The table headings (positive/negative) are not necessarily meaningful.

Positive Negative
acquire release
add remove (e.g. an item), subtract (arithmetic)
advance retreat
allocate deallocate (correct), free (common)
allow deny
assemble disassemble
assign deassign (e.g. a task)
associate dissociate
attach detach
begin end
bind unbind
compile decompile
compress decompress
connect disconnect
construct destruct
create destroy
do undo
enable disable
enqueue dequeue
enter leave, exit
expand collapse (e.g. a tree view), contract
first last
freeze unfreeze
front back
get set
grant revoke
head tail
import export
include exclude
increase decrease
increment decrement
indent dedent
inflate deflate
inject eject
insert delete (e.g. from a collection), extract (e.g. in a stream)
install uninstall
link unlink
load unload (e.g. a module), save (e.g. state), store (e.g. a value)
lock unlock
maximum minimum
new old
next previous
open close
compose parse
push pop
raise lower
read write
reference dereference (e.g. a pointer), unreference (e.g. an object in the case of reference counting)
register deregister
resume suspend
select deselect
send receive
serialize deserialize
set unset (e.g. a key), clear (e.g. a bit), get (e.g. a value)
set up tear down
show hide
start stop
start up shut down, clean up (maybe)
up down
upper lower

Remarks

Motivation

Using sensible, consistent wording in APIs improves readability, usability and greatly helps new users getting started. There is nothing more annoying than wondering what a function call is supposed to do while reading (someone else's or your own) code.

Initialize

There is no precise antonym for initialize and I don't think there has to be: By using initialize only for simple initializations that don't need any clean up code (initialize as its own antonym) you can

  1. establish a convention through that initialization routines without a corresponding clean up routine can be easily recognized, and
  2. circumvent the need for an antonym ;).

For routines that do not fall into this category, select another verb from the table above (most of the time there is a more descriptive alternative anyway).

If you still feel like you need an antonym; possibilities include but are not limited to: exit (very common in conjunction with init), reset, finalize, terminate.

"De-" vs. "Un-"

Both prefixes (de- and un-) can be defined as a reversal of action. Most of the time the prefix de- is used for verbs while un- is used for adjectives. There are many exceptions to this rule though. In some cases careful usage of these prefixes can avoid ambiguity. For example, "he was unregistered" is ambiguous because it can mean either "he was not registered" or "his registration was removed", while "he was deregistered" is not.

@BugInMyHEAD

This comment has been minimized.

Copy link

commented Jul 13, 2018

#https://gist.github.com/694bc413cd618cd3fec4b04e1bd8b518.git
add include, exclude; correct typo dereference
A good gist!

@pasqualirb

This comment has been minimized.

Copy link

commented Jul 23, 2018

What about setup/cleanup?

@maxtruxa

This comment has been minimized.

Copy link
Owner Author

commented Sep 12, 2018

@BugInMyHEAD

add include, exclude; correct typo dereference

Added and fixed. Thanks!

@eIGato

This comment has been minimized.

Copy link

commented Dec 27, 2018

load | dump, save, store

@vinzm

This comment has been minimized.

Copy link

commented Apr 5, 2019

halt is a common term too, a possible alternate antonym of begin or start.

@onacit

This comment has been minimized.

Copy link

commented May 15, 2019

an antonym of proxy please?

@nathnolt

This comment has been minimized.

Copy link

commented May 23, 2019

What about allow / deny

@maxtruxa

This comment has been minimized.

Copy link
Owner Author

commented Jun 5, 2019

@ElGato I added save but I'm not sure about dump. dump is sometimes used with load, restore and various other words, or with a completely different meaning (similar to discard), making it too vague for my taste.
@vinzm halt can possibly be an antonym of begin, start, run, start up and many more.
@onacit What are you looking for?
@nathnolt Added. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.