Mechanism: machinery. Relative to "strategy", it refers to providing a set of methods and APIs that can be used to complete specific functions. For example, the netfilter mechanism of the kernel, such as the mechanism composed of the X Window protocol.
Pattern: pattern. It’s just a routine. Whatever problem you have, follow a template that everyone knows.
idiom refers to fixed fragments like "idioms" and "idioms" in language. Different from the pattern, it is smaller and can be adapted to changes. Suggested translation: common usage, customary usage, etc. It is not recommended to use "technique", save that word for "trick".
The original meaning of the idiom is a word that everyone uses. If used in code, it is generally called a pattern (design pattern, code pattern). However, I feel that the translation of this model is too academic. In layman's terms, it should be idiomatic code.
"Mechanism" simply doesn't convey the meaning. In addition to being too academic, "pattern" is generally used at the design level and covers a large range. And "idiom" refers more to this small technique with only three or five elements. So "idiomatic code" or "idiomatic techniques" are more accurate.
Conventions, techniques, idioms, common usages. When it comes to code, architecture, etc., expressing a design style that can be reused can be called a pattern.
Let me explain a few words mentioned here.
Mechanism: machinery. Relative to "strategy", it refers to providing a set of methods and APIs that can be used to complete specific functions. For example, the netfilter mechanism of the kernel, such as the mechanism composed of the X Window protocol.
The original meaning of the idiom is a word that everyone uses. If used in code, it is generally called a pattern (design pattern, code pattern). However, I feel that the translation of this model is too academic. In layman's terms, it should be idiomatic code.
"Mechanism" simply doesn't convey the meaning. In addition to being too academic, "pattern" is generally used at the design level and covers a large range. And "idiom" refers more to this small technique with only three or five elements. So "idiomatic code" or "idiomatic techniques" are more accurate.
Code patterns. . . .
Conventions, techniques, idioms, common usages. When it comes to code, architecture, etc., expressing a design style that can be reused can be called a pattern.
Idioms, idioms, dialects.