trait

noun — 2 senses

trait

noun

/tɹeɪt/ · /tɹeɪ/

Etymology Borrowed from Middle French trait (“line, feature”), from Latin tractus (“drawing, pulling”), from Latin trahō. Doublet of tract.

1

Biology, Human sciences, Natural sciences, Psychology, Sciences An identifying characteristic, habit or trend.

  • inherited traits and acquired traits
  • The number one personality trait I hate is hypocrisy. Why can't you be consistent!?
3 more examples
  • The English, of all classes, value themselves on this trait, as distinguishing them from the French, who, in the popular belief, are more polite than true.1856, Ralph Waldo Emerson, English Traits, Truth:
  • The positive and constructive aspect of possibility gives the key to understanding the two chief traits of immaturity, dependence and plasticity.1916, John Dewey, Democracy and Education:
  • Turning to our second trait, if you have straight hair, then both of your parents must carry an allele for this trait.2003, Robert S. Siegler, Judy S. DeLoache, Nancy Eisenberg, How Children Develop, Macmillan, →ISBN, page 89:
2

An uninstantiable collection of methods that provides functionality to a class by using the class’s own interface.

Object-oriented programming

  • Traits are somewhat between an interface and a mixin.
  • Traits are parametrized on other methods, which must be provided to create a class using the trait. Using a trait-like mechanism to compose large collections of mutually-dependent classes or traits could lead to parameter explosion.2006, Nathaniel J. Nystrom, Programming languages for scalable software extension and composition:
Derived terms
character trait, eigentrait, multitrait, neurotrait, personality trait, subordinate trait, subtrait, traitless, traitlike, X-linked trait
Related terms
portrait, sickle cell trait, tract, tractate, treat, treaty

Entry derived from the Wiktionary, under licence CC BY-SA 4.0 — list of authors.