Welcome Guest, Not a member yet? Register   Sign In
Functional PHP Extension
#13

[eluser]Randy Casburn[/eluser]
I completely agree with sophistry's points here. (Wired - hang in there - I acknowledge you point below).

Each time this stuff comes up it reminds me of regular expressions:
Code:
// return unique lines
(?<=,|^)([^,]*)(,\1)+(?=,|$)
vs. "expressive", "succinct", "without losing clarity", PHP
Code:
// return unique elements (lines)
array_unique($array);
Both of these have their place and balance of performance trade offs, etc. RegEx are so very powerful, efficient, and flexible. Right? Are they realistically "expressive" or "clear"?
=====
From my point of view I would like to see this...

One of the compelling nuances of this abstract approach (FP) is the possibility of providing the devs this awesome ability that JS has of dealing with abstract function arguments. By this I mean function arguments that aren't set into concrete at declaration. The dev can use function arguments in any order regardless of the function declaration, and use the arguments they chose and ignore the one's they choose not to use.

Could you imagine a function like:
Code:
function label_new_if_today($date, $date_format="Y-m-d", $label="(New Project)")
{
    return ($date === date($date_format)) ? $label : null;
}

Being called thus: label_new_if_today($label="(Old Project)"); ?

Or how about this...
Code:
function constructQuery($statement,$from,$where,$limit,$orderBy){
   ...
}

constructQuery($statement="select",$orderBy="firstname",$from="customers");

...

Then the beauty in the flexibility (that you so aptly see WiredByDesignz) would so grand it would undeniable.

Unfortunately, no one has been able to achieve this with PHP. (AFAIK)

=======
The rest of the theory is just academic to until a hard core WIIFM demonstration is provided.

Randy


Messages In This Thread
Functional PHP Extension - by El Forum - 07-06-2008, 08:30 PM
Functional PHP Extension - by El Forum - 07-06-2008, 11:59 PM
Functional PHP Extension - by El Forum - 07-07-2008, 12:15 AM
Functional PHP Extension - by El Forum - 07-07-2008, 12:48 AM
Functional PHP Extension - by El Forum - 07-07-2008, 12:58 AM
Functional PHP Extension - by El Forum - 07-07-2008, 01:20 AM
Functional PHP Extension - by El Forum - 07-07-2008, 01:44 AM
Functional PHP Extension - by El Forum - 07-07-2008, 07:51 AM
Functional PHP Extension - by El Forum - 07-07-2008, 07:55 AM
Functional PHP Extension - by El Forum - 07-07-2008, 08:32 AM
Functional PHP Extension - by El Forum - 07-07-2008, 09:53 AM
Functional PHP Extension - by El Forum - 07-07-2008, 10:15 AM
Functional PHP Extension - by El Forum - 07-07-2008, 02:42 PM
Functional PHP Extension - by El Forum - 07-07-2008, 07:27 PM
Functional PHP Extension - by El Forum - 07-07-2008, 10:19 PM
Functional PHP Extension - by El Forum - 07-07-2008, 10:53 PM
Functional PHP Extension - by El Forum - 07-08-2008, 09:10 AM
Functional PHP Extension - by El Forum - 07-08-2008, 11:21 AM
Functional PHP Extension - by El Forum - 07-08-2008, 06:33 PM
Functional PHP Extension - by El Forum - 07-08-2008, 07:02 PM
Functional PHP Extension - by El Forum - 07-10-2008, 11:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB