|
|
|
|
|
by sam_in_nyc
6103 days ago
|
|
Honestly, what did you expect? The link was called "Traits in PHP." The article described the initial constraint as being "stuck in PHP." This wasn't an article arguing that it's a good idea to do it, but more of an exercise. So your questions, does PHP really need all the added complexity of this? That doesn't matter. If you don't need it, don't use it. Does it really help solve the problem, or did you just add a new maintenance nightmare? This question is a false dichotomy. First, it wasn't trying to solve any other problem then getting traits to work. So yeah, it solved that problem. Second, new code always adds new maintenance concerns. Whether or not it's a nightmare depends on the quality of code, which seems to be above par in this case. As Nycto pointed out in this thread, there is a "Traits" patch which seems preferable to this code. It's likely that OP didn't realize it existed and did reinvent the wheel. But still, in terms of an exercise in PHP, I found it quite cool. |
|