Nicholas Knight wrote:
Months? It takes me a few *hours* to be able to create useful code in a new language. A few days and I can embark on significant projects. This isn't about difficulty or time (though I'd not be happy about wasting the time), it's about not wanting to subject myself to the horror that is PHP just to be able to do a couple things with MediaWiki, probably never to touch the code again.
Well, it only took *me* a few hours to learn how to create useful code in PHP, and my programming skills are strictly hobbyist level. I worked through a couple of online tutorials, and that was all I needed. PHP is actually a lot like Perl, with somewhat more conventional syntax and a little less emphasis on text processing. I love the way you can use it to drop code right into the middle of HTML. With just a few lines of code you can create an interactive form that queries a database and returns a result. To do the same thing in Perl, you'd typically need one static HTML page and a separate page for the CGI script that processes the form data and returns the result. It can be done, but it's more work. Once I discovered PHP, I stopped using Perl and haven't looked back.
--Sheldon Rampton
Sheldon Rampton wrote:
With just a few lines of code you can create an interactive form that queries a database and returns a result. To do the same thing in Perl, you'd typically need one static HTML page and a separate page for the CGI script that processes the form data and returns the result. It can be done, but it's more work. Once I discovered PHP, I stopped using Perl and haven't looked back.
I can imagine there are situations this is a reason to use PHP. I don't see how MediaWiki is one, though. Isn't MediaWiki trying to be a solid, well-designed, large and scalable application? It takes time to write such a thing. Probably more in PHP than in languages designed for (among other things) such tasks. A well-designed application seperates interface and implementation, which requires a good templating system. I believe Ruby on Rails is such a thing (www.rubyonrails.org), but being a Pythonista, I'm not sure. Development speed is a good thing. At the cost of scalability, however, it is not.
regards, Gerrit Holl.
I agree with Sheldon. When I first picked up PHP, the only programming language (or something resembling it) I knew was HTML. I had dabbled with Perl and C, but they were too complicated to pick up, especially for programming on the web. Perl and C are great for use on real applications, but PHP is a language designed with the web in mind.
I haven't contributed to any MediaWiki development, sadly, because I'm still picking up the language; every time I stare at the code for a major PHP application, I get a dreadful headache. Usually it's because they use object-oriented PHP, which I haven't really learned yet.
John Lee ([[User:Johnleemk]])
Sheldon Rampton wrote:
Nicholas Knight wrote:
Months? It takes me a few *hours* to be able to create useful code in a new language. A few days and I can embark on significant projects. This isn't about difficulty or time (though I'd not be happy about wasting the time), it's about not wanting to subject myself to the horror that is PHP just to be able to do a couple things with MediaWiki, probably never to touch the code again.
Well, it only took *me* a few hours to learn how to create useful code in PHP, and my programming skills are strictly hobbyist level. I worked through a couple of online tutorials, and that was all I needed. PHP is actually a lot like Perl, with somewhat more conventional syntax and a little less emphasis on text processing. I love the way you can use it to drop code right into the middle of HTML. With just a few lines of code you can create an interactive form that queries a database and returns a result. To do the same thing in Perl, you'd typically need one static HTML page and a separate page for the CGI script that processes the form data and returns the result. It can be done, but it's more work. Once I discovered PHP, I stopped using Perl and haven't looked back.
--Sheldon Rampton