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"?

2
  • 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, 2018 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, 2019 at 21:54

3 Answers 3

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.

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.

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.)

1
  • 6
    This is what I thought - something defined at the implementation level only, not in the design/planning stages.
    – GurdeepS
    Nov 22, 2009 at 3:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.