Glossary: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(→‎SEP: Fix spellink of Hi(t)chhiker)
(Encourage requests in the form of stub entries; and supply an entry for SFINAE.)
Line 1: Line 1:
This is a glossary of terms used in Qt discussions, code comments or commit messages.
This is a glossary of terms used in Qt discussions, code comments or commit messages.
Feel free to add a stub entry if you run into one you can't make sense of, in hopes of someone else filling it in here.


= D =
= D =
Line 26: Line 27:


Cf. https://en.wikipedia.org/wiki/Somebody_else%27s_problem
Cf. https://en.wikipedia.org/wiki/Somebody_else%27s_problem
== SFINAE ==
Substitution Failure is not an Error, a rule in the way templates work that makes it possible to limit what it's applied to by how they're used.  For example, if one of your template parameters is a <kbd>typename T<kbd> and you exercise a <kbd>T::foo()</kbd> method in the body, types which lack a <kbd>foo()</kbd> method don't qualify as candidates for this template's <kbd>T</kbd> parameter.

Revision as of 08:43, 31 July 2024

This is a glossary of terms used in Qt discussions, code comments or commit messages. Feel free to add a stub entry if you run into one you can't make sense of, in hopes of someone else filling it in here.

D

DRY

Don't Repeat Yourself. Cf. https://en.wikipedia.org/wiki/Don%27t_repeat_yourself

See also #SCARY.

S

SCARY

No-one can remember what the acronym stands for, not without googling, and even then it doesn't tell you much. Making a class or function template SCARY means to separate all that depends on the template arguments from all that doesn't depend on (some) template arguments, ensuring that identical code doesn't get recompiled over and over again for every instantiation of the template.

Cf. https://quuxplusone.github.io/blog/2019/08/02/the-tough-guide-to-cpp-acronyms/#scary-iterators

Originally merely coined for nested types like std::vector<T, A>::iterator (which never depends on A), it has come into use for other in-kind transformations, too, often being a special case of Extract Method or Extract Baseclass.

See also #DRY.

SEP

Someone else's problem. From Douglas Adam's Hitchhiker's Guide.

Cf. https://en.wikipedia.org/wiki/Somebody_else%27s_problem

SFINAE

Substitution Failure is not an Error, a rule in the way templates work that makes it possible to limit what it's applied to by how they're used. For example, if one of your template parameters is a typename T and you exercise a T::foo() method in the body, types which lack a foo() method don't qualify as candidates for this template's T parameter.