Re: functions, opinion...
| From: | Hugh Bothwell | Date: | Tue, 17 Jun 2003 22:05:03 +0000 |
| Subject: | Re: functions, opinion... | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151912@lists.php.net to get a copy of this message | ||
"Dvdmandt" <dvdmandt@telia.com> wrote in message
news:20030617043209.82068.qmail@pb1.pair.com...
>
> Now, where did those two paragraphs come from? A bit of experience with
all
> those langs and the BASIC school... I'm at the age of 14 and don't even
know
> math yet so (I mean, I know +, -, / and *, but not advanced stuff)...
"functional programming" is based around the idea
that subroutines should have no side effects - all
the information a subroutine needs should be passed
as parameters, and its results should be returned.
Further, a function called with the same set of parameters
should always return the same result.
The original basis for this was that it made
program analysis much simpler; however, it
was found to be useful in practice as well for
a number of reasons:
- it was a means of enforcing variable scope
(essentially, all variables are local),
- it promotes much simpler functions and
more reuse.
- it can allow much more extreme compiler
optimizations
While the functional programming philosophy
can be applied in most programming languages,
some of the languages I mentioned do a better
job of making its usefulness obvious.
For more info, see some of the links at
http://directory.google.com/Top/Computers/Programming/Languages/Functional/
--
Hugh Bothwell hugh_bothwell@hotmail.com Kingston ON Canada
v3.1 GCS/E/AT d- s+: a- C+++ L++>+++$ P+ E- W+++$ N++ K? w++ M PS+
PE++ Y+ PGP+ t-- 5++ !X R+ tv b++++ DI+++ D-(++) G+ e(++) h-- r- y+