Idiom vs. pattern

Posted by Roger Pate on Stack Overflow See other posts from Stack Overflow or by Roger Pate
Published on 2010-01-09T20:24:28Z Indexed on 2010/03/27 5:03 UTC
Read the original article Hit count: 362

In the context of programming, how do idioms differ from patterns?

I use the terms interchangeably and normally follow the most popular way I've heard something called, or the way it was called most recently in the current conversation, e.g. "the copy-swap idiom" and "singleton pattern".

The best difference I can come up with is code which is meant to be copied almost literally is more often called pattern while code meant to be taken less literally is more often called idiom, but such isn't even always true. This doesn't seem to be more than a stylistic or buzzword difference. Does that match your perception of how the terms are used? Is there a semantic difference?

© Stack Overflow or respective owner

Related posts about language-agnostic

Related posts about idioms