Tagged articles
Traits
24 articles · Page 1 of 1
The article argues that PHP Traits are an underestimated metaprogramming feature offering low cognitive overhead, but their potential is limited by weak composition contracts; it proposes bidirectional contracts allowing traits to require interfaces and implement interfaces, turning traits into predictable compile-time class transformations.
Compile-time TransformationComposition ContractsPHP
0 likes · 8 min read

Developers transitioning from Java or C# to Go or Rust often miss class inheritance, but both languages deliberately avoid it; this article explains the pitfalls of inheritance, the benefits of composition, interfaces, and traits, and offers practical guidance for designing maintainable, concurrent systems without inheritance.
Traitssoftware design
0 likes · 10 min read

This article explains PHP Traits—a reusable code mechanism that lets developers share methods and properties across classes, detailing their definition, usage with the `use` keyword, advantages like avoiding multiple inheritance and reducing redundancy, and important considerations such as method conflicts and priority.
Traitscode reuseobject-oriented programming
0 likes · 5 min read

This comprehensive guide introduces Rust’s core syntax and unique programming mindset, walks through a practical greplite example, and covers essential topics such as installation, Cargo commands, data structures, ownership, traits, iterators, async/await, concurrency, and best learning resources for rapid mastery.
ConcurrencyRustTraits
0 likes · 32 min read

This article explains PHP's polymorphism—covering method overriding, simulated method overloading, interface polymorphism, traits, abstract classes, magic methods, and performance considerations—while providing clear code examples and discussing real‑world uses such as plugin systems, testing mocks, middleware, and strategy patterns.
OOPPHPPolymorphism
0 likes · 9 min read

Explore how Rust’s Send and Sync marker traits guarantee thread‑safe ownership transfer and shared references, with clear explanations, practical code examples, custom type implementations, common pitfalls, and performance considerations to help you write reliable concurrent programs.
ArCMutexRust
0 likes · 8 min read

This article compares Python’s abstract base classes with Rust’s traits, showing how familiar Python concepts map to Rust syntax through detailed code examples, covering method binding, trait implementation, operator overloading, and testing, helping developers transition between the two languages.
ABCPythonRust
0 likes · 12 min read

This article explains PHP traits as a code‑reuse mechanism, compares them with classes and multiple inheritance, demonstrates their syntax and conflict‑resolution operators, and offers advanced usage examples and best‑practice guidelines for backend development.
OOPTraitscode reuse
0 likes · 11 min read

This guide explains how to use PHP Traits within the Symfony framework to encapsulate reusable functionality, demonstrating the creation of a LoggerTrait, its integration into a UserService, and the injection of that service into a controller for clean, modular, and DRY code.
PHPTraitsbackend development
0 likes · 5 min read

This article explains how PHP traits enable code reuse across multiple classes, illustrating the problem of duplicated methods in Person‑derived classes like Student, Guardian, and Teacher, and showing step‑by‑step refactoring to eliminate redundancy while maintaining clear inheritance structures.
PHPTraitscode reuse
0 likes · 6 min read

This article explains PHP Traits, covering their concept, definition, usage examples, advantages such as avoiding multiple inheritance and reducing code duplication, as well as important considerations like method conflicts and precedence, providing a comprehensive guide for backend developers.
OOPPHPTraits
0 likes · 5 min read

This article explains how PHP traits enable code reuse by allowing reusable method blocks to be incorporated into classes, covering trait definition, simple examples, method priority rules, conflict resolution with multiple traits, and trait composition for flexible functionality sharing.
OOPPHPTraits
0 likes · 5 min read

The article introduces PHP 8.2’s major enhancements—including read‑only classes, disjunctive normal form (DNF) types, the ability to use null, false and true as independent types, and constant definitions inside traits—providing code examples that illustrate each new capability.
BackendTraitsdnf
0 likes · 3 min read

This article introduces the Rust programming language, explains its design principles such as memory safety, ownership, and zero‑cost abstractions, compares it with C++ and JavaScript, and provides practical advice, code examples, and insights on when and how to start learning Rust.
GenericsProgramming LanguageRust
0 likes · 27 min read

This article explains PHP's Trait feature, showing how to use it for multiple inheritance, resolve method and property conflicts with insteadof and as, combine multiple Traits, and leverage advanced capabilities such as abstract methods and static members, all illustrated with complete code examples.
Code ExampleMultiple InheritancePHP
0 likes · 7 min read

This article explains how Laravel leverages PHP's modern features—namespaces, Composer‑managed packages, autoloading, reflection, and traits—to enable clean, modular, and extensible backend development with practical code examples.
LaravelReflectionTraits
0 likes · 10 min read

The article outlines six fundamental traits of serverless architecture—low barrier-to-entry, hostless, stateless, elasticity, distributed, and event-driven—explains why they matter, discusses the benefits and hidden challenges each introduces, and offers concise recommendations for developers to successfully adopt serverless solutions.
Traitsarchitecturecloud computing
0 likes · 15 min read

This article explains how to resolve incorrect date formatting in Laravel notification queries by creating a custom Notification model that uses a HasDateTimeFormatter trait and overriding the notifications() method in the User model.
LaravelNotificationsTraits
0 likes · 3 min read

This article explains PHP traits—a code‑reuse mechanism for single‑inheritance languages—covering their definition, basic syntax, how to use them with the use keyword, resolving property and method conflicts, visibility adjustments, and abstract method support, all illustrated with clear examples.
PHPTraitscode reuse
0 likes · 7 min read

This article explains the concept of PHP Traits, how they overcome single inheritance limitations, provides clear code examples of defining and using Traits in plain PHP, and demonstrates practical integration of Traits within Laravel applications for reusable functionality.
BackendOOPTraits
0 likes · 4 min read

This article explains the Open Application Model (OAM), its core concepts of Components, Application Configuration and Traits, and demonstrates a visual platform that lets users create, configure, version, and publish a multi‑component application (nginx, tomcat, redis) on Kubernetes with detailed screenshots and a GitHub demo repository.
Application DeploymentKubernetesOAM
0 likes · 12 min read


21CTOFeb 27, 2017 · Backend Development
PHP7 brings a host of performance improvements and new language features—including refined namespace usage, interfaces, traits, generators, closures, Zend OPcache, and a built‑in HTTP server—each illustrated with practical code examples and best‑practice recommendations for modern backend development.
OPcacheTraitsbackend development
0 likes · 8 min read


21CTOMay 8, 2016 · Backend Development
This article explains PHP Traits—introduced in PHP 5.4—as a fine‑grained code‑reuse mechanism, illustrates their definition, shows practical examples of extracting reusable methods into traits, compares trait usage with inheritance, and offers tips for effective trait design.
PHPTraitsbackend development
0 likes · 7 min read

This article introduces the latest PHP language features—including namespaces, traits, closures, generators, and a range of new syntax enhancements—explaining their purpose, usage, and code examples to help developers build modern, maintainable web applications.
PHPTraitsbackend development
0 likes · 17 min read
