39

I see this term on the internet a lot (in fact, typing it on google returns a lot of results).

What is the exact definition of an "implementation detail"?

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
GurdeepS
  • 65,107
  • 109
  • 251
  • 387
  • 1
    General definition: a specialization of an idea by an implementer, where it is possible to implement the idea in another way. The implementer's implementation may reflect their limitations and/or environment. – doubleOrt Mar 17 '18 at 21:50
  • 1
    @doubleOrt I'd stress: a detail about the implementation that should not be relied upon, isn't part of documented interface and can change without affecting conformance to specifications. (So, both the "functionally irrelevant" and "illegal to rely on" aspects matter) – sehe Jun 26 '19 at 21:54

3 Answers3

32

It's a behavior produced by code which may be relied on by consuming code, though that behavior is not specified by the spec the code is written to. Hence, other implementations of the same spec may not exhibit the same behavior, and will break that consuming code. That's why it's bad to rely on them.

For instance, if you were to write some code against a list interface which specified an array sort but not the algorithm it used, and you needed the sort method to be stable, and a version of your code was used with a non-stable sort algorithm, then your code would break.

RCIX
  • 38,647
  • 50
  • 150
  • 207
29

I'm not aware of the exact formal definition of the term "implementation detail", it generally refers to the concrete implementation of a certain specification.

Take a List for example.

A specification of a List may say that "it is able to hold multiple values with duplicates while preserving order."

From the above, it doesn't mention what kind of backing data structure is used for the List -- for all we know, it may be an array, or a linked list. That is really an implementation detail that is really left up to the implementor of the List.

coobird
  • 159,216
  • 35
  • 211
  • 226
16

An "implementation detail" is a decision that is left to be made by the developers, and is not specified at an earlier level (such as a requirement document or, depending on context, an architectural document.)

Oddthinking
  • 24,359
  • 19
  • 83
  • 121
  • 6
    This is what I thought - something defined at the implementation level only, not in the design/planning stages. – GurdeepS Nov 22 '09 at 03:42