views:

817

answers:

4

I remember seeing somewhere a dictionary of idiomatic word pairs for use in programming.

Like get-set, open-close, allocate-free and so on.

Does anyone remember an URL?

+2  A: 

Never seen a list generally aimed at programming, however PowerShell has such a list: Cmdlet verbs. Pairings are highlighted for each verb where they exist.

And while much of PowerShell's strive for consistency on the command line comes from standardizing those verbs some of the pairings may be appropriate in other contexts as well.

Joey
Thanks, but, that is not the list I search for.
Alexander Gladysh
+2  A: 

English is not my first language but aren't those antonyms rather than idiomatic pairs?

In Linux you can use wordnet to search for antonyms

sudo apt-get install wordnet

wn open -antsv

-ants for antonyms and v for verbs. You can also search for (n | a | r) – antonym for noun | adjective | adverbs.

Jonas Elfström
Most of these words are, indeed, antonyms. But not all antonyms are idiomatic pairs in the sense of my question. See store-fetch vs. store-load in the comment above. Different use cases, different pairs. Which words are paired and when -- that is where idioms are. (P.S. English is not my mother's tongue either.)
Alexander Gladysh
A comfortable way to search for antonym pairs in general is a good thing, thanks. However, I'd like to find a list which specifies *established practice* of using such words in code.
Alexander Gladysh
+1  A: 

There are two short lists of such pairs in Code Complete, one for function names, one for variable names. You can search for "Use Opposites Precisely" using amazon's look inside feature if you don't have the book.

ergosys
Cool, you gave me new keywords to search! Thanks! The list I've seen was longer, but this is a start.
Alexander Gladysh
I've accepted the "closest to what I want" question. Still looking for the url though...
Alexander Gladysh
+1  A: 

Building on ergosys' answer:

From Code Complete 2, Chapter 11, p. 264:

Common Opposites in Variable Names

  • Begin/end
  • first/last
  • locked/unlocked
  • min/max
  • next/previous
  • old/new
  • opened/closed
  • visible/invisible
  • source/target
  • source/destination
  • up/down
I82Much