From: "Guy N. Hurst" Date: 2000-10-10T00:18:21+09:00 Subject: [ruby-talk:5334] Re: Ruby vs PHP ? Hi, I have been working with PHP for over three years, and with Ruby since earlier this year. PHP is a hypertext preprocessor written in C and having more extensions and modules than you would ever hope to use. (Such as SWF, PDF, cURL, ORBit, XML, LDAP, zlib, sockets, etc.) It is specifically a web developer's language, competing mostly with ASP and ColdFusion. It is easy to learn, having a syntax similar to C and Perl. It has many many built-in functions and also supports many databases. It is Open Source, but the new Zend modules allow for optimization and compiling of code for commercial purposes. PHP is something that could itself be written using Perl, Python, or Ruby. PHP, however, has gone way beyond any of these in its specialization. It has incorporated simple access to many databases and external programs. And since it is written in C, it is very fast. It has been tested thoroughly on many platforms, and there is even a native version for Windows (no cygwin required). If you are a web developer, PHP is a must. On the other hand, Ruby is a general purpose OOP script interpreter. It is easy to extend and has the beginnings of a large collection of applications, extensions, and modules. It is competing mostly with Perl and Python, although it is more like well known compiled languages such as Smalltalk and others. Ruby is the up-and-coming OO scripting language, seemingly without equal. Ruby is special in its OO offerings, and promises to allow the large, scalable applications in a more maintainable, easy manner. While PHP has some very basic OO-looking features, it was never meant to be OO, and even the OO it has was forced in by popular demand. However, companies working on large projects deem the OO features a must. Perl and Python both have OO features also, but neither have it to the extent that Ruby has it. Perl has it to the extent that you can make it work as you like, and Python has it to the extent that it is simple. But Ruby has it to the extent that it is easy, usable, and 'fun'. PHP should not really be compared to Ruby directly. They can be used together if you do web development. If you do not do web development, there is no reason for you to bother with PHP, though. PHP can call external non-PHP scripts using, e.g., exec() or system(), and I have done so with Ruby scripts because handling non-HTTP protocols are easier/faster with a Ruby script. I do, however, see Ruby as having potential for large web-based projects. I really wonder if something similar to 'Zope' (which is written in Python) could better be written in Ruby. Of course, Ruby *can* be used to run python scripts, but that is another topic. All these languages are being improved as we speak, and it yet remains to see how each of them adopt best practices from each other :-) Guy N. Hurst "Hal E. Fulton" wrote: > > I don't know PHP, but Guy Hurst knows it well... > maybe he will comment here. :) Guy? > > Hal > > ----- Original Message ----- > From: Valerio Bamberga > To: ruby-talk ML > Sent: Monday, October 09, 2000 3:49 AM > Subject: [ruby-talk:5329] Ruby vs PHP ? > > > Hi! > > I have a 'beginner' question: > > I was going to learn PHP, when I found an article (the first in Italy i > > think) speaking about this new lang: Ruby! It seems really impressive. > > I looked around and I studied why Ruby is better than Perl, Smalltalk, > > Phyton, C++, Java etc.. > > but I found nothing about Ruby vs Php. > > Why? > > > > Thanks! > > Valerio > > > > -- HurstLinks Web Development http://www.hurstlinks.com/ Norfolk, VA - (757)623-9688 PHP/MySQL - Ruby/Perl - HTML/Javascript