Skip to content

Instantly share code, notes, and snippets.

@maxtruxa
Last active November 18, 2025 02:45
Show Gist options
  • Select an option

  • Save maxtruxa/b2ca551e42d3aead2b3d to your computer and use it in GitHub Desktop.

Select an option

Save maxtruxa/b2ca551e42d3aead2b3d to your computer and use it in GitHub Desktop.
A list of common terms used in programming and their respective antonyms.

Antonym List

Positive Negative
Acquire Release
Add Remove (e.g. an item), Subtract (arithmetic)
Advance Retreat
Allocate Deallocate (correct), Free (common)
Attach Detach
Begin End
Create Destroy
Construct Destruct
Enable Disable
Enqueue Dequeue
Enter Exit
First Last
Front Back
Get Set
Import Export
Increase Decrease
Increment Decrement
Insert Delete
Load Unload (e.g. a module), Store (e.g. a value)
Lock Unlock
Minimum Maximum
Next Previous
New Old
Open Close
Push Pop
Read Write
Register Deregister
Select Deselect
Send Receive
Set Unset (e.g. a key), Clear (e.g. a bit)
SetUp TearDown
Show Hide
Start Stop
StartUp ShutDown, CleanUp (maybe)
Suspend Resume
Up Down

Remarks

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 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 a antonym ;).

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

If you feel like you need an antonym anyway; possibilities include but are not limited to: Exit (very common in conjunction with Init), Reset, Finalize, Terminate.

@BugInMyHEAD
Copy link

BugInMyHEAD commented Jul 13, 2018

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

@psqli
Copy link

psqli commented Jul 23, 2018

What about setup/cleanup?

@maxtruxa
Copy link
Author

@BugInMyHEAD

add include, exclude; correct typo dereference

Added and fixed. Thanks!

@eIGato
Copy link

eIGato commented Dec 27, 2018

load | dump, save, store

@vinzm
Copy link

vinzm commented Apr 5, 2019

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

@onacit
Copy link

onacit commented May 15, 2019

an antonym of proxy please?

@nathnolt
Copy link

What about allow / deny

@maxtruxa
Copy link
Author

maxtruxa 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!

@nuno-andre
Copy link

encode/decode, encrypt/decrypt, client/server, paste/cut, commit/rollback, create/drop, input/output, static/dynamic, header/footer

Also push/pop for stacks, but push/pull for communication protocols.

And probably beyond the scope of the gist, but it's a rather funny and idiomatic pair of antonyms:
EAFP (easier ask for forgiveness than permission) / LBYL (look before you leap)

@swiehr
Copy link

swiehr commented Dec 19, 2019

explode is another antonym for compress (e.g. LISP, but also a common term for some compression types)

@roenschg
Copy link

wrap and unwrap

@0xTomDaniel
Copy link

success / failure; resolve / reject

@marius-ne
Copy link

What is the opposite of caller? As in functions.

@maxtruxa
Copy link
Author

maxtruxa commented Jul 5, 2021

@marius-ne: Caller / callee. Same as in trainer / trainee.

@iseahound
Copy link

What pairs with put, from, and to? Please help.

@simonhf
Copy link

simonhf commented Mar 10, 2022

I would love to see this list divided into two lists; the first containing words of the same length e.g. get / set or success / failure, and the second containing words of different lengths e.g. read / write or begin / end etc :-)

I would then spend most of my time in the first list :-) It might be just OCD on my part, but I love to see related names all the same length, e.g. instead of:

OnsuccessfulWrite()
OnUnsuccessfulWrite()
OnsuccessfulRead()
OnUnsuccessfulRead()

Then:

OnKeyPutSuccess()
OnKeyPutFailure()
OnKeyGetSuccess()
OnKeyGetFailure()

Does anybody else have this affliction? :-)

@Oli-Wright
Copy link

Oli-Wright commented Apr 22, 2022

WRT first / last

'Last' is unfortunately overloaded in English. It can mean 'final' ("last bus") or 'previous' ("last time") depending on context.

This means it can be ambiguous in code. Is lastValue the final value in an array, or the previous value that we looked at?

So I've always preferred to ban last and prefer final in this context.

@wffranco
Copy link

WRT first / last

'Last' is unfortunately overloaded in English. It can mean 'final' ("last bus") or 'previous' ("last time") depending on context.

This means it can be ambiguous in code. Is lastValue the final value in an array, or the previous value that we looked at?

So I've always preferred to ban last and prefer final in this context.

Is ambiguous if you use it wrong. By default in development first/last are the border values in a list of items.
For the context you mention use previous/next instead.


Some missing terms:

  • top / bottom
  • before / after
  • from / to
  • mount / unmount

@onacit
Copy link

onacit commented Nov 18, 2024

latest/oldest?

@onacit
Copy link

onacit commented Nov 18, 2024

sign/verify?

@sniperrifle
Copy link

claim / disclaim ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment