Top "Traits" questions

In computer programming, a trait is a collection of methods, used as a "simple conceptual model for structuring object oriented programs"

Java 8 default methods as traits : safe?

Is it a safe practice to use default methods as a poor's man version of traits in Java 8? Some claim …

java java-8 traits default-method
In Scala; should I use the App trait?

I've just started learning Scala and many of the tutorials that I'm following are using a combination of different representations …

scala main traits
Difference between Trait and an Abstract Class in PHP

I recently came across Traits in PHP and I'm trying to understand them. During my research I stumbled upon this …

php abstract-class traits
PHP trait method conflicts: trait "inheritance" and trait hierarchies

UPDATE: I am not alone in my pondering on this issue and it seems it is indeed a bug. See …

php class multiple-inheritance traits
is it possible to add traits to a class in PHP in runtime?

Simple question, is it possible to dynamically add traits to a php class in runtime without using eval?

php traits
Mixing in a trait dynamically

Having a trait trait Persisted { def id: Long } how do I implement a method that accepts an instance of any …

scala mixins case-class traits
PHP trait: is there a proper way to ensure that class using a trait extends a super class which contains certain method?

Example #2 from PHP manual http://php.net/manual/en/language.oop5.traits.php states <?php class Base { public function …

php class inheritance superclass traits
PHP type-hinting traits

I have a trait. For the sake of creativity, let's call this trait Trait: trait Trait{ static function treat($instance){ // …

php traits type-hinting
Is it possible to use `impl Trait` as a function's return type in a trait definition?

Is it at all possible to define functions inside of traits as having impl Trait return types? I want to …

rust traits
Find out whether a C++ object is callable

Is it possible to write a type trait, say is_callable<T> which tells if an object has …

c++ metaprogramming traits typetraits