Re: [O] Re: Yahoo is moving to PHP ??
> "Perrin" == Perrin Harkins <[EMAIL PROTECTED]> writes: Perrin> Someone else will eventually have to maintain them, so I Perrin> write in a way that a novice with a copy of Learning Perl has a hope Perrin> of understanding. Perrin> When I work in an environment that is more Perl-centric, I expand the Perrin> vocabulary of my code more. This is the position we support during our code review services as well. You can use fancy stuff, but be sure to point to where you learned it. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Re: [O] Re: Yahoo is moving to PHP ??
Perrin Harkins writes: > Correct Perl style is probably not something that any two people will > ever agree on. If you use Extreme Programming, the whole team has to agree. Collective ownership, pair programming, and refactoring all suffer if you don't have a common coding style. The use of map, unless, closures, eval, etc. needs to be discussed and agreed on. It's a sign of a weak team if you can't agree on these details. > I've seen some hideous Java code at this place that really takes the > wind out of the "Java is more maintainable" argument. I thought all Java code is hideous. ;-) Rob
Re: [O] Re: Yahoo is moving to PHP ??
Tony Bowden wrote: ... but I think that there should be a certain level of ability that should be assumed when coding commercially ... My current situation is somewhat unusual because Perl is not the language that the people I am coding with were hired to write. They are mostly Java programmers, and I'm just doing some useful admin and database scripts in Perl because it's so much quicker than doing them in Java. Someone else will eventually have to maintain them, so I write in a way that a novice with a copy of Learning Perl has a hope of understanding. When I work in an environment that is more Perl-centric, I expand the vocabulary of my code more. things like map, hash slices, and even $_ aren't what I could class as advanced Perl ideas. Perl is a large language, and not all of it needs to be used all the time. I wouldn't call $_ advanced, but I know I hate reading code where people use it more than they have to. Hash slices and map are uncommon enough that I had been writing fairly challenging OO Perl for quite a while before I ever saw one. I don't use them when something more basic will do just as well. Correct Perl style is probably not something that any two people will ever agree on. This used to bother me more before I realized that all languages have this problem, even though they try to deny it. I've seen some hideous Java code at this place that really takes the wind out of the "Java is more maintainable" argument. - Perrin
Re: [O] Re: Yahoo is moving to PHP ??
On Fri, Nov 01, 2002 at 01:42:45PM -0500, Perrin Harkins wrote: > >It sounds like you're saying that you should only use a subset of Perl > >as some programmers may not understand the other parts of it? > That is what I'm saying. I'm aware that this is a controversial opinion > in the Perl world. However, I think it's reasonable to know your > audience and write for them. That's the good part of More Than One Way. > The New York Times writes their articles for a certain reading level, > and I do the same with my code. In principle, I broadly agree with this ... but ... > Note that different audiences have different levels. You can expect > someone who opens up the code in a module on CPAN to be pretty fearless > about advanced Perl ideas. On the other hand, the people in my current > office are mostly novices so I try to take it easy on them when writing > code for work. I will still use a Schwartzian Transform if I need one, > but I'll put in a comment saying "this is a Schwartzian Transform, see > such and such URL for an explanation." Same deal with things like > hash-slices, and I try to avoid using $_ when it isn't necessary. ... but I think that there should be a certain level of ability that should be assumed when coding commercially ... I'm all for abstracting away the really deep magic and serious perl wizardry into modules that less experienced programmers shouldn't need to delve into in the normal course of things, but things like map, hash slices, and even $_ aren't what I could class as advanced Perl ideas. I would expect anyone being paid to work with Perl to understand these - they're going to be popping up all over the place in code, and aren't that easy (or sensible) to hide away. And the best way for novices to learn these concepts is to see them properly used throughout the code base, not for their use to be shied away from. > So would I, in that situation. It's not that map is so evil, but rather > that I have often seen people overuse it (especially after a > first-reading of "Effective Perl"), and write confusing code with it by > jamming too much into the "map { some stuff } @list" form. Agreed. But 'proper' use of map can be explained fairly simply. It's not a difficult concept. Tony
Re: [O] Re: Yahoo is moving to PHP ??
Hi ( 02.11.01 13:42 -0500 ) Perrin Harkins: > It's not that map is so evil, but rather that I have often seen people > overuse it (especially after a first-reading of "Effective Perl"), and > write confusing code with it by jamming too much into the "map { some > stuff } @list" form. As a former map addict, I was shown the error of my ways on #[EMAIL PROTECTED] when it was pointed out to me that map returns a value. If you're not going to use that value, just use for[each]. This way the code is easier to read and the extra overhead of the return value [minute as it is] is avoided. -- .--- ...
Re: [O] Re: Yahoo is moving to PHP ??
Tony Bowden wrote: It sounds like you're saying that you should only use a subset of Perl as some programmers may not understand the other parts of it? That is what I'm saying. I'm aware that this is a controversial opinion in the Perl world. However, I think it's reasonable to know your audience and write for them. That's the good part of More Than One Way. The New York Times writes their articles for a certain reading level, and I do the same with my code. Note that different audiences have different levels. You can expect someone who opens up the code in a module on CPAN to be pretty fearless about advanced Perl ideas. On the other hand, the people in my current office are mostly novices so I try to take it easy on them when writing code for work. I will still use a Schwartzian Transform if I need one, but I'll put in a comment saying "this is a Schwartzian Transform, see such and such URL for an explanation." Same deal with things like hash-slices, and I try to avoid using $_ when it isn't necessary. Given: sub square { $_[0] ** 2 } my @nums = (1 .. 10); Which would say is more readable and maintainable? 1) my @squares; push @squares, square($_) for @nums; 2) my @squares = @nums; $_ = square($_) for @squares; 3) my @squares = map square($_), @nums; I'd go for (3) every time. So would I, in that situation. It's not that map is so evil, but rather that I have often seen people overuse it (especially after a first-reading of "Effective Perl"), and write confusing code with it by jamming too much into the "map { some stuff } @list" form. - Perrin
Re: Yahoo is moving to PHP ??
On Wed, 2002-10-30 at 17:09, John Saylor wrote: > Hi > > ( 02.10.30 03:22 -0500 ) Perrin Harkins: > > They didn't make their decision on performance though. They seem to > > have been most influenced by the idea that perl allows too much > > flexibility in coding style, although I can't see how PHP is going to > > help with that. > > Wow, I'd like what *they* had for lunch! > > Quasi-seriously, as someone who has had to maintain mountains of bad > perl code, I know TMTOWTDI can have a downside; but the openness of the > language is what has lead to its greatness ... > > -- > .--- ... Now we're going down to the ugly details of the article :) As Perrin noted they are probably going to use C/C++ to make the fundamentals of the application, like the framework the API, interface whatever, and use PHP as a templating language to iterate over the datastructures etc. I've just converted some totally unmaintainable code from PHP to perl (actually, i've rewritten it because everything was done in the wrong way (tm)). To write big and advanced applications in pure PHP is a big mistake IMHO, but to use it as a templating language doesn't sound as such a bad idea. Yahoo! is moving to open-source! Yahoo! -- Ask Solem Hoel[+4722808579 | +4797962181] ABC Startsiden AS [ http://www.startsiden.no]
Re: [O] Re: Yahoo is moving to PHP ??
On Fri, Nov 01, 2002 at 03:10:54AM -0500, Perrin Harkins wrote: > There is a time and place for map: when you want to do something > to each element in an array and return the array on the other side. > Otherwise, use for, like this: some_function($_) for @array;. > Even when map is not incorrect, I usually avoid it because it has a > tendency to take your code from nice, readable perl to evil h@x0r PERL > in 3 characters. This is the kind of thing that Yahoo was probably > worried about when the decided not to use Perl. This statement surprises me somewhat. It sounds like you're saying that you should only use a subset of Perl as some programmers may not understand the other parts of it? I'd say that if this were true the problem is in training the programmers. map and grep are very powerful constructs, and when used correctly lead to much more readable and maintainable code once you understand them: Given: sub square { $_[0] ** 2 } my @nums = (1 .. 10); Which would say is more readable and maintainable? 1) my @squares; push @squares, square($_) for @nums; 2) my @squares = @nums; $_ = square($_) for @squares; 3) my @squares = map square($_), @nums; I'd go for (3) every time. Tony
Re: [O] Re: Yahoo is moving to PHP ??
Franck PORCHER wrote: But is a lot easier to read and debug, IMHO Is there a significant performance difference in using map instead? My experience is that in most cases, the construct is used to apply the same treatment to all the elements of an array, whence the construct. In those cases, the readibility is definitely altered by the index that get in the way. I think you're forgetting that "for" is just a synonym for "foreach". You don't need an index. Of course, this is a quick analysis not taking into account other factors like readibility versus efficiency. In fact, regarding the efficiency of the construct, I often wondered whether Perl detects being ran in a void context, so as to give it an iterative interpretation, avoiding to build the output list. It's really not a matter of efficiency, but rather of correctness. Using map in a void context is a mistake. There is a time and place for map: when you want to do something to each element in an array and return the array on the other side. Otherwise, use for, like this: some_function($_) for @array;. Even when map is not incorrect, I usually avoid it because it has a tendency to take your code from nice, readable perl to evil h@x0r PERL in 3 characters. This is the kind of thing that Yahoo was probably worried about when the decided not to use Perl. - Perrin
Re: [O] Re: Yahoo is moving to PHP ??
On Thu, 31 Oct 2002, Franck PORCHER wrote: > In fact, regarding the efficiency of the construct, I often > wondered whether Perl detects being ran in a void context, > so as to give it an iterative interpretation, avoiding to build > the output list. IIRC (but I might not) then it does since version X, where X is relatively recent. - ask -- ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();
Re: [O] Re: Yahoo is moving to PHP ??
On Thu, 31 Oct 2002, Mike Miller wrote: > On Wed, 30 Oct 2002 20:28:11 + (GMT) > Franck PORCHER <[EMAIL PROTECTED]> wrote: > > > Let's prey that those PHP geeks quickly discover the > > true joy of working with functionnals (map and al.). > > I have often wondered about the ratio of Perl programmers > > still using the C-like construct. I guess it's rather low. > > > > But is a lot easier to read and debug, IMHO Is there a > significant performance difference in using map instead? My experience is that in most cases, the construct is used to apply the same treatment to all the elements of an array, whence the construct. In those cases, the readibility is definitely altered by the index that get in the way. I think that the adoption of map is mostly cultural, depending on one's background experience with functionnal programming, basically splitting the way of thinking about collections of objects between the construct (fortran programmers for instance) and construct (lisp programmers). Of course, this is a quick analysis not taking into account other factors like readibility versus efficiency. In fact, regarding the efficiency of the construct, I often wondered whether Perl detects being ran in a void context, so as to give it an iterative interpretation, avoiding to build the output list. Does someone know about this ? Franck. > --M. > > > > > -- ESSENTIAL SOFTWARE - Ingénierie Informatique Solutions Linux & Open Source en Polynésie française http://www.esoft.pf/ Tél: (689) 562 395 / 508 288-289 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- "Lassé des virus? Osez Linux, le choix moderne des gouvernements et des entreprises Fortune 500"
Re: Yahoo is moving to PHP ??
On Wed, 30 Oct 2002, Rob Nagler wrote: > Tagore Smith writes: > > I think it would be harder to hire people to work on his system (of course > > you'd probably also get more experienced people, so that might not be such a > > bad thing). > > This raises the $64 question: If you could hire 10 PHP programmers at > $50/hour or 4 Perl programmers at $125/hour, which team would deliver > more business value over the life of the site? > > > Graham's system uses macros extensively, and from other code of his > > that I've read (Graham wrote a couple of books about Lisp), I'd bet > > that he uses recursion and mapping functions a lot as well. > > His On Lisp book is a classic on macros--which are similar to closures > in Perl. You can download it for free: http://www.paulgraham.com/onlisp.html > > My guess is that Graham's answer to the above question would be: > Hire two Lisp programmers at $250/hour. :-) > Or better, 1 CLP(CT) programmer at $500/hour... Franck ESSENTIAL SOFTWARE - Ingénierie Informatique Solutions Linux & Open Source en Polynésie française http://www.esoft.pf/ Tél: (689) 562 395 / 508 288-289 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- "Lassé des virus? Osez Linux, le choix moderne des gouvernements et des entreprises Fortune 500"
Re: Yahoo is moving to PHP ??
> "PH" == Perrin Harkins <[EMAIL PROTECTED]> writes: PH> Sure. That's why Vignette used TCL: adding your own C commands to the PH> language is easy. Probably the same story for AOLServer. Considering that the whole purpose for TCL was to embed it into C progams, one would hope that it would be easy... -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Re: [O] Re: Yahoo is moving to PHP ??
> "Mike" == Mike Miller <[EMAIL PROTECTED]> writes: >> Let's prey that those PHP geeks quickly discover the >> true joy of working with functionnals (map and al.). >> I have often wondered about the ratio of Perl programmers >> still using the C-like construct. I guess it's rather low. >> Mike> But is a lot easier to read and debug, IMHO Is there a Mike> significant performance difference in using map instead? He said "C-like for". Your "for" is probably a "foreach", if you're comparing it with "map". -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Re: [O] Re: Yahoo is moving to PHP ??
On Wed, 30 Oct 2002 20:28:11 + (GMT) Franck PORCHER <[EMAIL PROTECTED]> wrote: > Let's prey that those PHP geeks quickly discover the > true joy of working with functionnals (map and al.). > I have often wondered about the ratio of Perl programmers > still using the C-like construct. I guess it's rather low. > But is a lot easier to read and debug, IMHO Is there a significant performance difference in using map instead? --M.
Re: [OT] Re: Yahoo is moving to PHP ??
On Wed, 30 Oct 2002, Richard Clarke wrote: > List, > You are probably not the best people to ask for an answer which > might advocate PHP, > but. > Can someone who is more proficient in PHP than I (I have used it > for 5 minutes) explain to me why it is quicker to prototype things in PHP? ---> it isn't. PHP blows.
Re: Yahoo is moving to PHP ??
On Thu, 31 Oct 2002, Gunther Birznieks wrote: > You would think if they want an anal scripting language they would move > to python not PHP. :) Python isn't anal--it's a very clean, interesting, flexible language on par with perl--perhaps superior in some ways and not as good in others but, overall, on a similar scale. In respect to the article, to me, anyway, most of the arguments weren't particularly compelling from my outside viewpoint. The one point they made was true--PHP was developed specifically for the web and doesn't have the wide variability of perl (they seem to equate extensive flexibility, as a trouble point leading to great variance in the code -- stylistically and logically). I don't think this problem is neccessarily eliminated comprehensively by switching to a crappy language like PHP. Some standardization could be achieved via coding guidelines, approved practices, code reviews etc. while still retaining the power and flexibility of a perl. Many of the problems they associated with perl aren't neccessarily eliminated by using PHP, including the issues with code variance. They still stated that perl would fuel many things on the backend, though, so they haven't gone completely mad. -mj > John Saylor wrote: > > >Hi > > > >( 02.10.30 03:22 -0500 ) Perrin Harkins: > > > > > >>They didn't make their decision on performance though. They seem to > >>have been most influenced by the idea that perl allows too much > >>flexibility in coding style, although I can't see how PHP is going to > >>help with that. > >> > >> > > > >Wow, I'd like what *they* had for lunch! > > > >Quasi-seriously, as someone who has had to maintain mountains of bad > >perl code, I know TMTOWTDI can have a downside; but the openness of the > >language is what has lead to its greatness ... > > > > > > >
[O] Re: Yahoo is moving to PHP ??
Let's prey that those PHP geeks quickly discover the true joy of working with functionnals (map and al.). I have often wondered about the ratio of Perl programmers still using the C-like construct. I guess it's rather low. Franck. On Wed, 30 Oct 2002, Tagore Smith wrote: > Rob Nagler wrote: > > > I think Yahoo Stores is written in Lisp. I also believe it handles > > the front and back end. Would be interesting to know why this was > > left out of the discussion. > >Yahoo store was originally ViaWeb and was written in Common Lisp. It was > one of the first large applications made available over the web. Paul Graham > has an article about it at http://www.paulgraham.com/paulgraham/avg.html > >ViaWeb was deployed using clisp, a very portable, but somewhat > incomplete, common lisp implementation that compiles lisp to bytecode. I > believe (take this with a grain of salt, as it's third hand) that ViaWeb > only presented dynamic content to the merchant, not to the user of the > merchant's site- it was a web application that built static web sites. Each > merchant had their own dedicated lisp listener to nteract with. > >This probably isn't the model that Yahoo had in mind, and it might not > have occured to them that the commercial Lisps have native threads. Using > clisp would also obscure one of the big advantages to using lisp- many lisp > implementations compile to native code, so they're very efficient. Also, I'd > imagine that you can hire just about any programmer to work on a PHP system; > even if they haven't seen PHP before they'll pick it up quickly (once they > get used to the weird reference semantics), and most of the work will be in > learning the libraries. Graham's system uses macros extensively, and from > other code of his that I've read (Graham wrote a couple of books about > Lisp), I'd bet that he uses recursion and mapping functions a lot as well. I > think it would be harder to hire people to work on his system (of course > you'd probably also get more experienced people, so that might not be such a > bad thing). > > Tagore Smith > > -- ESSENTIAL SOFTWARE - Ingénierie Informatique Solutions Linux & Open Source en Polynésie française http://www.esoft.pf/ Tél: (689) 562 395 / 508 288-289 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- "Lassé des virus? Osez Linux, le choix moderne des gouvernements et des entreprises Fortune 500"
Re: Yahoo is moving to PHP ??
Perrin Harkins wrote: Have you written C extensions for both Perl and PHP and think Perl is easier? Most certainly, using SWIG. I didn't have to recompile Perl two or three times, or read Perl's source to figure out what to do. The PHP docs on the subject were misleading and innacurate and wrong. That was about a year ago, I do hope things have improved.
Re: Yahoo is moving to PHP ??
Iain 'Spoon' Truskett wrote: In general, it makes sense that a simple language would be simple to extend with C. That's why people like TCL. They do? =) Sure. That's why Vignette used TCL: adding your own C commands to the language is easy. Probably the same story for AOLServer. - Perrin
Re: Yahoo is moving to PHP ??
* Perrin Harkins ([EMAIL PROTECTED]) [31 Oct 2002 14:26]: [...] > Have you written C extensions for both Perl and PHP and think Perl is > easier? I've only written XS for Perl. Not touched PHP with any C stuff. While I must admit that my early XS was crap, that's mostly my fault. Last time I looked at PHP, a while ago I admit, to extend it with C you had to recompile the lot. Has that changed? > Most people complain about XS being challenging. XS isn't that challenging if you read the documentation. In particular, that shiny new Jenness and Cozens book "Extending and Embedding Perl". > The picture might be different when SWIG and Inline::C are taken into > account, but I've never used them so I couldn't say. I find it's useful to know XS to use Inline::C. SWIG, since it's not Perl oriented, is possibly easiest. I'm not sure since I've not used it to any extent. > In general, it makes sense that a simple language would be simple to > extend with C. That's why people like TCL. They do? =) cheers, -- Iain.
Re: Yahoo is moving to PHP ??
Cristóvão Dalla Costa wrote: Perrin Harkins wrote: They also have more of a need than most people to integrate with C/C++, and I've been told that it's easier to hack those into PHP. What a joke. Have you written C extensions for both Perl and PHP and think Perl is easier? Most people complain about XS being challenging. The picture might be different when SWIG and Inline::C are taken into account, but I've never used them so I couldn't say. In general, it makes sense that a simple language would be simple to extend with C. That's why people like TCL. - Perrin
Re: Yahoo is moving to PHP ??
Perrin Harkins wrote: They also have more of a need than most people to integrate with C/C++, and I've been told that it's easier to hack those into PHP. What a joke.
Re: Yahoo is moving to PHP ??
Tagore Smith writes: > I think it would be harder to hire people to work on his system (of course > you'd probably also get more experienced people, so that might not be such a > bad thing). This raises the $64 question: If you could hire 10 PHP programmers at $50/hour or 4 Perl programmers at $125/hour, which team would deliver more business value over the life of the site? > Graham's system uses macros extensively, and from other code of his > that I've read (Graham wrote a couple of books about Lisp), I'd bet > that he uses recursion and mapping functions a lot as well. His On Lisp book is a classic on macros--which are similar to closures in Perl. You can download it for free: http://www.paulgraham.com/onlisp.html My guess is that Graham's answer to the above question would be: Hire two Lisp programmers at $250/hour. :-) Rob
Re: Yahoo is moving to PHP ??
Rob Nagler wrote: > I think Yahoo Stores is written in Lisp. I also believe it handles > the front and back end. Would be interesting to know why this was > left out of the discussion. Yahoo store was originally ViaWeb and was written in Common Lisp. It was one of the first large applications made available over the web. Paul Graham has an article about it at http://www.paulgraham.com/paulgraham/avg.html ViaWeb was deployed using clisp, a very portable, but somewhat incomplete, common lisp implementation that compiles lisp to bytecode. I believe (take this with a grain of salt, as it's third hand) that ViaWeb only presented dynamic content to the merchant, not to the user of the merchant's site- it was a web application that built static web sites. Each merchant had their own dedicated lisp listener to nteract with. This probably isn't the model that Yahoo had in mind, and it might not have occured to them that the commercial Lisps have native threads. Using clisp would also obscure one of the big advantages to using lisp- many lisp implementations compile to native code, so they're very efficient. Also, I'd imagine that you can hire just about any programmer to work on a PHP system; even if they haven't seen PHP before they'll pick it up quickly (once they get used to the weird reference semantics), and most of the work will be in learning the libraries. Graham's system uses macros extensively, and from other code of his that I've read (Graham wrote a couple of books about Lisp), I'd bet that he uses recursion and mapping functions a lot as well. I think it would be harder to hire people to work on his system (of course you'd probably also get more experienced people, so that might not be such a bad thing). Tagore Smith
Re: Yahoo is moving to PHP ??
I'm sure it is. This has been discussed on this list before: PHP in safe mode is much more likely to be found on the offerings of virtual hosting companies, which tend to use control panel things like Plesk, Ensim, or RAQ boxes. If you do get mod_perl you don't get to play with everything, it usually just means you get to run stuff in Registry. Therefore most people will get to play in PHP and do projects for real customers in PHP at an earlier stage in their careers. And inside of a year you'll have built some fairly solid applications that work, and you'll be looking for work as a "website programmer" because it was so easy to satisfy your customer, who really just wanted to be able to update his real-estate listings without phoning you twice a week.. Ooops, that's a lot of people right now. Jobs for PHP guys are fewer and farther between than for Perl guys. Supply/demand would tend to drive the price for PHP guys down, one would think. Later of course you'll try to differentiate yourself from the masses, and try to find out what Perl can do for your career and for your applications. Sometimes, and this is not me, you'll find that you NEED to look at some speed enhancement because your stupid website actually became popular. Tweaking PHP, refining your queries, adding hardware, and doing stuff like output caching would probably last you an awful long time before you had to switch languages. > I also wonder if it's cheaper/easier to hire and train PHP programmers that > Perl programmers. > > > -- > Bill Moseley > mailto:moseley@;hank.org
Re: Yahoo is moving to PHP ??
Perrin Harkins writes: > The real application stuff is built in other languages. (At least > this is the impression I get from the paper and from talking to > people there.) I think Yahoo Stores is written in Lisp. I also believe it handles the front and back end. Would be interesting to know why this was left out of the discussion. Rob
Re: Yahoo is moving to PHP ??
At 02:50 PM 10/30/02 -0500, Perrin Harkins wrote: >Mithun Bhattacharya wrote: > >>No it is not being removed but this could have been a very big thing >>for mod_perl. Can someone find out more details as to why PHP was >>preferred over mod_perl it cant be just on a whim. >> > >Think about what they are using it for. Yahoo is the most extreme >example of a performance-driven situation. I also wonder if it's cheaper/easier to hire and train PHP programmers that Perl programmers. -- Bill Moseley mailto:moseley@;hank.org
Re: Yahoo is moving to PHP ??
Mithun Bhattacharya wrote: No it is not being removed but this could have been a very big thing for mod_perl. Can someone find out more details as to why PHP was preferred over mod_perl it cant be just on a whim. Think about what they are using it for. Yahoo is the most extreme example of a performance-driven situation. They have so much volume that they are willing to write things in C++ just to get the speed that is required. They pre-process and cache things as much as they possibly can. The server-side scripting language they use is basically a glorified include processor. They pull in pre-built include files and read things out of dbms with it. That's all. The real application stuff is built in other languages. (At least this is the impression I get from the paper and from talking to people there.) Given that, PHP is a reasonable fit. It's fast, has a less flexible syntax, and uses less memory than mod_perl. They also have more of a need than most people to integrate with C/C++, and I've been told that it's easier to hack those into PHP. Think about the implications of the memory graph. If they can run 5 more apache children at once on PHP because of its lower memory consumption, 5 * 4500 = 22500 more users they can handle at any given moment! Also how does one go about justifying the fact that Ioncube cache is doing a better cacheing than any mod_perl based solution ?? Sorry, I read that wrong. It was actually mod_perl that had the best performance. The cache they use works just the same as Perl's normal operation, i.e. once some code is compiled it stays in memory and doesn't need to be compiled again. You don't have to do anything to get that in Perl. - Perrin
Re: [OT] Re: Yahoo is moving to PHP ??
Tom Servo wrote: Check out their online map site, they do use Python for that. I'm actually surprised they didn't go with Python, because the people I know there love it. If their backend data processing ever gets moved from Perl to something else, it would probably be moved to Python. - Perrin
[OT] Re: Yahoo is moving to PHP ??
Check out their online map site, they do use Python for that. snippet o' URL: http://maps.yahoo.com/py/maps.py?BFCat=. You know you're going to have a bad day when you see the sun come up. Over the curb. Brian Nilsen [EMAIL PROTECTED] On Thu, 31 Oct 2002, Gunther Birznieks wrote: > You would think if they want an anal scripting language they would move > to python not PHP. :) > > John Saylor wrote: > > >Hi > > > >( 02.10.30 03:22 -0500 ) Perrin Harkins: > > > > > >>They didn't make their decision on performance though. They seem to > >>have been most influenced by the idea that perl allows too much > >>flexibility in coding style, although I can't see how PHP is going to > >>help with that. > >> > >> > > > >Wow, I'd like what *they* had for lunch! > > > >Quasi-seriously, as someone who has had to maintain mountains of bad > >perl code, I know TMTOWTDI can have a downside; but the openness of the > >language is what has lead to its greatness ... > > > > > > >
Re: Yahoo is moving to PHP ??
On Wed, 30 Oct 2002 11:39:07 -0500 "Jesse Erlbaum" wrote: > Hi John -- > > > Quasi-seriously, as someone who has had to maintain mountains of bad > > perl code, I know TMTOWTDI can have a downside; but the openness of the > > language is what has lead to its greatness ... > > This doesn't have to be as big a problem as it often is. Having coding > standards makes a big difference no matter WHICH language you use. > Have you > ever seen bad Java code? Java has reached parity with Perl in that area, > for sure! This is a problem in ANY language. You just can't "hire smart > people" and send them out there without direction. Amen. I came to Perl from a language called IDL (Interactive Data Language, not Interface Definition Language). It's an array-based language that has inspired PerlDL (though I've not used PerlDL). I came to IDL from Ada and C. Ada and C are strongly typed, whereas Perl is loosely typed, though nowehere near as loose as IDL. The variable "a" in IDL can be changed between an array, scalar, function, etc., with no indication, or even concern, about how it's being used from line to line in your program. TMTOWTDI applies to IDL even more than it does to Perl. After trying to follow some IDL-based NASA code years ago, I posted an IDL Style Guide on my site that's seen some use in the IDL community. If nothing else, it keeps me from stepping all over myself when I'm coding in IDL. It's also easier to figure out when I've accidentally assigned a string to a variable when I planned to use it for an array, or whatever. > At my company we base all our work on CGI::Application and > HTML::Template to > solve exactly this problem. And I'm moving towards the same thing as I've spent a lot of time developing CGI code in the last couple of years. Mike Schienle Interactive Visuals, Inc. http://www.ivsoftware.com - This message sent using EMUmail -- http://www.emumail.com - Jumping through hoops to get E-mail on the road? You've got two choices: Join the circus, or use MollyMail. Molly Mail -- http://www.mollymail.com
RE: Yahoo is moving to PHP ??
At 11:39 30/10/2002 -0500, Jesse Erlbaum wrote: Hi John -- > Quasi-seriously, as someone who has had to maintain mountains of bad > perl code, I know TMTOWTDI can have a downside; but the openness of the > language is what has lead to its greatness ... This doesn't have to be as big a problem as it often is. Having coding standards makes a big difference no matter WHICH language you use. Have you ever seen bad Java code? Java has reached parity with Perl in that area, for sure! This is a problem in ANY language. You just can't "hire smart people" and send them out there without direction. I completely agree. Bad code is bad code in any languaje (well, perhaps with perl you can write the most encrypted code, but only if you are looking for it). I don't really know the ability of PHP to work with templates, but since I discovered Template Toolkit 2, I've never written (nor will I) more web applications without it. I cannot understand why don't want them to use HTML templates. I suspect, the propietary languaje the were using was similar in concept to PHP or ASP not allowing templates. Oscar Serrano. At my company we base all our work on CGI::Application and HTML::Template to solve exactly this problem. CGI-App and HTML-Tmpl (or Template Toolkit -- TT is compatible with C::A) "strongly suggest" a standard way of writing the uninteresting bits of a web application -- namely, state management and HTML separation. They go beyond what is provided by simply making a decision to use a particular API, such as CGI, mod_perl, PHP, Mason, etc. No software library will factor this problem out entirely. This is really a human problem -- not a software problem. However, choosing a specific tactic is a good start. TTYL, -Jesse- -- Jesse Erlbaum The Erlbaum Group [EMAIL PROTECTED] Phone: 212-684-6161 Fax: 212-684-6226
RE: [OT] Re: Yahoo is moving to PHP ??
The first thing to note is that our working definition of intuitive here translates to: based on prior knowledge. PHP is a tag based language and places relatively complex functions at the fingertips of your average joe newbie. It is therefore more intuitive and remarkably faster to develop with when you are employing a pool of bell-curve skilled programmers. It is for this same reason that we offer cold fusion for the dynamic sites we host: if you have a bit of experience with HTML, a one day class in cold fusion lets you work with cookies and databases, et cetera. In our evaluation of what to support in terms of web application languages, we selected perl for its power and Cold Fusion for its speed of deployment; the latter over PHP because of its maturity { security, stability, features, IDE support }. I laugh at the Java bashing because as time wore on, you guessed it, we were asked to write an enterprise calendar in Java. Derrick Stone Internet Specialist Web Development Center UVa Health System ICQ# 1464194 -Original Message- From: Richard Clarke [mailto:ric@;likewhoa.com] Sent: Wednesday, October 30, 2002 11:34 AM To: [EMAIL PROTECTED] Subject: [OT] Re: Yahoo is moving to PHP ?? List, You are probably not the best people to ask for an answer which might advocate PHP, but. Can someone who is more proficient in PHP than I (I have used it for 5 minutes) explain to me why it is quicker to prototype things in PHP? I can't understand this statement. Surely this is only applicable to people who are not proficient with mod_perl & [% my_templating_engine %]? Much of the code from PHP based websites which I have read has seemed to take this prototyping idea too much to heart. It looks more like an overly complex prototype than a well working application. /me doesn't get it.
RE: Yahoo is moving to PHP ??
Hi John -- > Quasi-seriously, as someone who has had to maintain mountains of bad > perl code, I know TMTOWTDI can have a downside; but the openness of the > language is what has lead to its greatness ... This doesn't have to be as big a problem as it often is. Having coding standards makes a big difference no matter WHICH language you use. Have you ever seen bad Java code? Java has reached parity with Perl in that area, for sure! This is a problem in ANY language. You just can't "hire smart people" and send them out there without direction. At my company we base all our work on CGI::Application and HTML::Template to solve exactly this problem. CGI-App and HTML-Tmpl (or Template Toolkit -- TT is compatible with C::A) "strongly suggest" a standard way of writing the uninteresting bits of a web application -- namely, state management and HTML separation. They go beyond what is provided by simply making a decision to use a particular API, such as CGI, mod_perl, PHP, Mason, etc. No software library will factor this problem out entirely. This is really a human problem -- not a software problem. However, choosing a specific tactic is a good start. TTYL, -Jesse- -- Jesse Erlbaum The Erlbaum Group [EMAIL PROTECTED] Phone: 212-684-6161 Fax: 212-684-6226
[OT] Re: Yahoo is moving to PHP ??
List, You are probably not the best people to ask for an answer which might advocate PHP, but. Can someone who is more proficient in PHP than I (I have used it for 5 minutes) explain to me why it is quicker to prototype things in PHP? I can't understand this statement. Surely this is only applicable to people who are not proficient with mod_perl & [% my_templating_engine %]? Much of the code from PHP based websites which I have read has seemed to take this prototyping idea too much to heart. It looks more like an overly complex prototype than a well working application. /me doesn't get it.
[OT] Re: Yahoo is moving to PHP ??
If they are going to inherently mangle their php and perl and lose that abstraction layer I think in 2 years they will look back and wish TMTOWTDI was their only problem That said, Kudo's to yahoo for being this public about it. These are the sorts of publically available presentations that give those of us trying to justify our existence some teeth. Walking into a management meeting and saying 'Look, even yahoo disdains Java and they have 4500+ servers and are the biggest internet portal and have a lot of geeks programming and even they admit modperl is awesome and fast and they are only not using it becuase its TO powerful' is a potent weapon. Cheesy yes, needed, yes.. John- On Thu, 31 Oct 2002 00:12:02 +0800 Gunther Birznieks <[EMAIL PROTECTED]> wrote: You would think if they want an anal scripting language they would move to python not PHP. :) John Saylor wrote: Hi ( 02.10.30 03:22 -0500 ) Perrin Harkins: They didn't make their decision on performance though. They seem to have been most influenced by the idea that perl allows too much flexibility in coding style, although I can't see how PHP is going to help with that. Wow, I'd like what *they* had for lunch! Quasi-seriously, as someone who has had to maintain mountains of bad perl code, I know TMTOWTDI can have a downside; but the openness of the language is what has lead to its greatness ...
Re: Yahoo is moving to PHP ??
You would think if they want an anal scripting language they would move to python not PHP. :) John Saylor wrote: Hi ( 02.10.30 03:22 -0500 ) Perrin Harkins: They didn't make their decision on performance though. They seem to have been most influenced by the idea that perl allows too much flexibility in coding style, although I can't see how PHP is going to help with that. Wow, I'd like what *they* had for lunch! Quasi-seriously, as someone who has had to maintain mountains of bad perl code, I know TMTOWTDI can have a downside; but the openness of the language is what has lead to its greatness ...
Re: Yahoo is moving to PHP ??
Hi ( 02.10.30 03:22 -0500 ) Perrin Harkins: > They didn't make their decision on performance though. They seem to > have been most influenced by the idea that perl allows too much > flexibility in coding style, although I can't see how PHP is going to > help with that. Wow, I'd like what *they* had for lunch! Quasi-seriously, as someone who has had to maintain mountains of bad perl code, I know TMTOWTDI can have a downside; but the openness of the language is what has lead to its greatness ... -- .--- ...
RE: Yahoo is moving to PHP ??
> -Original Message- > From: Mithun Bhattacharya [mailto:inzoik@;yahoo.com] > Sent: 30 October 2002 09:17 > To: [EMAIL PROTECTED] > Subject: Re: Yahoo is moving to PHP ?? > > > No it is not being removed but this could have been a very big thing > for mod_perl. Can someone find out more details as to why PHP was > preferred over mod_perl it cant be just on a whim. I might be biased > but considering the fact that PHP and mod_perl were neck to neck the > cons should have made up for any slipup in performance. err did you look at the same slides as me? in all performance tests, YSP(perl) performed better than PHP, with the exception of memory usage. and there is a slide explaining why not Perl - the main objection seemed to be: "There's More Than One Way To Do It so many different Perl styles everyone's code looks different problematic for development when many people working on single codebase" While there were Pros/Cons for Perl and the other rejectees, there were no Pros/Cons for PHP unless you count the gotchas mentioned after four months of using PHP: Shallow learning curve - very easy to get some pages up quickly But mixed app/presentation problematic - PHP code and HTML forever intertwined - coding conventions help *.inc for function and class libraries *.php for web pages (call functions, echo $vars) - use Smarty to enforce separation? "The drawback of using a code in template system, is that your code and HTML output quickly become forever intertwined. This makes changing the appearance of your pages difficult. For example, if you check the user cookie and load user database data in the "common-header" moving around where you include this template will change where you retrieve the database information for the user, possibly breaking other parts of the page which rely on that data. " http://www.clearsilver.net/docs/apples_to_oranges.hdf The "implement twice" problem - much offline processing done in Perl - example: tax/shipping calculation for Shopping PEAR != CPAN - installer doesn't work in PHP 4.2.x - repository smaller, less mature than CPAN Surprises for people used to coding Perl Interestingly our experience was/is similar - we chose PHP 2.5 years ago for the development of our dynamic ASP interactive pages, and Perl for all our data-processing and server management etc. Hindsight shows us that it was the right decision at the time - we gained an 18 month lead on the competition. After 2.5 years, the 'have to write everything twice' problem has lead us to plan a gradual migration from PHP to Perl. All our new pages and products are being developed in mod_perl. I wonder if they will consider a similar change? Unlikely give the number of developers and the disruption? There is one con for PHP that I disagree with - you don't have to mix your HTML and application logic - just as in Perl, you can separate them if you want to - we work extensively in PHP ordered hashes and isolate the formatting and HTML generation in a few included utility collections, making it easy to change the HTML we generate without changing any of the underlying business information. Regards Jeff
Re: Yahoo is moving to PHP ??
--- Perrin Harkins <[EMAIL PROTECTED]> wrote: > Mithun Bhattacharya wrote: > > >http://public.yahoo.com/~radwin/talks/yahoo-phpcon2002.htm > They also say they plan to continue using lots of perl in all the > places > they use it now: off-line processing, filling in the includes and dbm > > files that the server-side script assembles. Perl is not being > removed. No it is not being removed but this could have been a very big thing for mod_perl. Can someone find out more details as to why PHP was preferred over mod_perl it cant be just on a whim. I might be biased but considering the fact that PHP and mod_perl were neck to neck the cons should have made up for any slipup in performance. Also how does one go about justifying the fact that Ioncube cache is doing a better cacheing than any mod_perl based solution ?? I am assuming when Yahoo did their research they optimized everything to the maximum possible they werent out to do a marketting propaganda now were they Mithun __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/
Re: Yahoo is moving to PHP ??
Mithun Bhattacharya wrote: http://public.yahoo.com/~radwin/talks/yahoo-phpcon2002.htm If nothing else this should be atleast generate some thoughts ?? It does: hooray! Yahoo is moving from a proprietary server-side scripting tool to an open source one. Great news for all of us, since they will help legitimize open source ("the largest site in the world runs on it") and maybe feed good ideas back to the open source world. (Of course Yahoo has used other open source tools forever.) If you look at the performance graphs they made, mod_perl comes in neck and neck with PHP. We always see mod_perl go faster than PHP in Joshua's tests, but Yahoo was testing with this Ioncube cache that keeps PHP code in memory (like mod_perl). The performance tests were so close that a little optimization on the mod_perl side might actually turn it around. They didn't make their decision on performance though. They seem to have been most influenced by the idea that perl allows too much flexibility in coding style, although I can't see how PHP is going to help with that. They also say they plan to continue using lots of perl in all the places they use it now: off-line processing, filling in the includes and dbm files that the server-side script assembles. Perl is not being removed. - Perrin