Re: lambda() naming

From: Date: Sun, 04 Jun 2000 22:08:37 +0000
Subject: Re: lambda() naming
References: 1 2 3 4 5 6 7 8  Groups: php.dev 
Request: Send a blank email to php-dev+get-20209@lists.php.net to get a copy of this message
Zeev Suraski wrote: > At 22:44 04/06/2000, Sterling Hughes wrote: > >Andrei Zmievski wrote: > > > > > On Sun, 04 Jun 2000, Andi Gutmans wrote: > > > > Guys, > > > > > > > > I want to change the name of lambda() tomorrow. Let's agree on a name. > > > > Possibilities people brought up: > > > > create_funtion() > > > > new_funtion() > > > > anonymous_function() > > > > > > > > I am for create_function(). > > > > > > Well, seeing as nobody is for lambda() (which would make most sense to > > > me, since I think beginners would not use it at all), create_function() > > > or new_function() would be fine. > > > >I'm for lambda(), I think its unreasonable to cater to the DCD (Dumbest > >Common Denominator), if the users can't learn what lambda() does, they > >shouldn't be programming, period. I mean heck, lets go ahead, and change > >preg_grep to "search_a_list_by_a_pattern_and_return_the_result" or chop to > >"take_off_the_whitespace_at_the_end_of_this_string()." > > I have to second Andi on this one. I have a computer science degree, and > until Stig Bakken suggested we implement lambda() some 2.5 years ago, I > never heard of it. Perhaps I'm not the most experienced CS major in the > world, but I don't consider myself amongst the DCD, as you define it... > But you understand it now right? If someone gave you a thousand dollars to learn what it meant you could understand it. I define the DCD as someone who can't learn it. > > Bare in mind that we're not aiming PHP at the CS majors. Most CS majors > wouldn't use PHP or get involved in Web development in the first place. At > the very least, a huge amount of people without computer science knowledge > uses PHP, and this will only become more and more true as time goes > by. That's mainly because PHP is such an easy language to learn and use. > Right, but also bear in mind that one of the reasons I chose to use PHP is because its a mixture of the other languages. A lot of PHP's syntax (if not all), is borrowed from another language, Python was my first introduction (which BTW is a very good language to learn programming from) to lambda. > > With all due respect to the name 'lambda' and whatever meaning it has in CS > or in math, in LISP or in other languages, create_function() describes what > it does much better, and would make the code much more readable to the non > CS guys, while not impairing the ability of CS guys to understand what's > going on. I see no particular reason to go with 'lambda'. > The main reason is compatability to other languages. Yesterday I was programming Python, today I might be programming PHP, I don't want to have to remember that in Python its lambda and in PHP its create_function. Also lambda is a little more graceful than create_function. But its not really crucial to me, create_function sounds good too. Sterling

« previous php.dev (#20209) next »