WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #22400, comment 7


Ignore:
Timestamp:
11/10/12 03:37:57 (2 years ago)
Author:
DrewAPicture
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22400, comment 7

    initial v1  
    22> Having `$defaults` contain all valid parameters certainly helps a lot but I still think `extract()` is bad. 
    33 
    4 In many contexts, I'd argue that unless you have intimate knowledge of the codebase, the `$defaults` array is ''the best'' documentation available for incoming args, regardless of whether `extract()` is used or not. 
     4In many contexts, I'd argue that unless you have intimate knowledge of the codebase, the `$defaults` array is ''the best'' in-line documentation available for incoming args, regardless of whether `extract()` is used or not. 
    55 
    66I've read several places that using `extract()` often creates confusion, though I think as you pointed out, a lot of that stems from the lack of distinction with the resulting variables. With what seems to be widespread use in core (as evidenced in comment:3), I'm surprised `EXTR_PREFIX_ALL` never got used to set unique prefixes.