Idiom (software engineering)

from Wikipedia, the free encyclopedia

In Software Engineering includes idioms to the pattern ( English pattern ).

Idiomatic programs / idiomatic programming

In programming, the term for idiomatic programs or idiomatic programming is common. Colloquially, this means whether the programmer wrote the source text as experts would do in this programming language. For example, whether a program in C ++ adheres to the usual conventions, not using too many, but also not too few, options in this language, or whether there are perhaps signs that the programmer is more likely to have experience with another programming language such as C or assembler Has. In didactic media, especially in English, reference is often made to particularities of idiomatic language. So it is colloquially meant a mixture of programming style , use of the available language resources and simple problem-solving templates.

The result is a relatedness to the concept of phrase (idiom) in natural languages. Similarly, an idiom can be subsumed as a pattern as follows:

Idioms

Idioms can be understood as conversions (implementations) of abstract patterns in a specific programming language. So how simple tasks (low level of abstraction) are solved in a programming language. There are no set recognized idioms, but there are a number of widely used idioms that help to understand and learn the syntax of a programming language. The best-known example is likely to be here print 'Hello World'.

Buschmann defines: “An idiom is a programming language-specific pattern and thus a pattern on a low level of abstraction. An idiom describes how to implement certain aspects of components or relationships between them with the means of a certain programming language. "

An idiom is thus characterized by the following properties:

  • it is programming language specific
  • it can be found in the detailed design and implementation (low level of abstraction). So it is about the implementation of special design aspects.

It is therefore used, for example, as follows:

  • Concrete implementation of a design template.
  • Programming conventions: Basic idea “The code is not yours”, e.g. B. Code formatting, naming conventions, comment formatting, etc. This can be done with or without technical support ( Checkstyle / Pretty Printer) .
  • Typical code structures, e.g. B. minimal class interface
  • Typical solutions for problems not directly supported by the programming language, e.g. B. Storage Management

Examples of idioms can be found in the literature, for example for Smalltalk , C ++ or C # .

Web links

Wiktionary: Idiom  - explanations of meanings, word origins, synonyms, translations

Individual evidence

  1. The Computer Language Benchmarks Game, accessed on February 10, 2017 ( Memento of the original from March 4, 2016 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / benchmarksgame.alioth.debian.org
  2. Which Programming Languages ​​are Write-Only ?. Retrieved February 10, 2017
  3. Learning aids for training IT specialists, accessed on February 10, 2017
  4. ^ Patrick Walton: C ++ Design Goals in the Context of Rust . December 5, 2010. Retrieved on February 10, 2017: "... It's impossible to be" as fast as C "in all cases while remaining safe ... C ++ allows all sorts of low-level tricks, mostly involving circumventing the type system, that offer practically unlimited avenues for optimization. In practice, though, C ++ programmers restrict themselves to a few tools for the vast majority of the code they write, including stack-allocated variables owned by one function and passed by alias, uniquely owned objects (often used with auto_ptror the C ++ 0x unique_ptr), and reference counting via shared_ptror COM. One of the goals of Rust's type system is to support these patterns exactly as C ++ does, but to enforce their safe usage. In this way, the goal is to be competitive with the vast majority of idiomatic C ++ in performance, while remaining memory-safe ... "
  5. Buschmann et al .: Pattern-Oriented Software Architecture: A Pattern System . Addison-Wesley, ISBN 3-8273-1282-5 .
  6. Kent Beck: Smalltalk Best Practice Patterns . Prentice Hall, 1997, ISBN 0-13-476904-X .
  7. James Coplien: Advanced C ++ Programming Styles and Idioms . Addison-Wesley, 1992, ISBN 0-201-54855-0 (English).
  8. Bill Wagner: Effective C # (covers C # 4.0): 50 Specific Ways to Improve Your C # . In: Effective Software Development . 2nd Edition. Addison-Wesley, Amsterdam 2010, ISBN 978-0-321-65870-8 (English).
  9. Bill Wagner: More Effective C #: 50 Specific Ways to Improve Your C # . In: Effective Software Development . 1st edition. Addison-Wesley, Amsterdam 2008, ISBN 978-0-321-48589-2 (English).