I’ve develop a few applications using PHP/MySQL/Apache and its growing in
size. After reading the Ruby tutorial, and do a simple script, I kind of
like this ease of use and a much cleaner language.
But I have reservation about its viability as a dominant web programming
language/tools. As with PHP, everywhere you look its PHP, perhaps it has
extensive bell and whistles for web programmers to write cool and
sophisticate commercials grade web application. How about its security? Is
it better/worse than PHP? Is Ruby thread-safe?
So, what’s the drawback of leaving PHP and embrace Ruby as web programming
tools?
Ruby and PHP are two differents thing. Ruby is used for command line
program supporting user input and run just as batch file or linux shell
script do. PHP run embedded on a webpage and it main purpose is for website
development.
I’ve develop a few applications using PHP/MySQL/Apache and its growing in
size. After reading the Ruby tutorial, and do a simple script, I kind of
like this ease of use and a much cleaner language.
But I have reservation about its viability as a dominant web programming
language/tools. As with PHP, everywhere you look its PHP, perhaps it has
extensive bell and whistles for web programmers to write cool and
sophisticate commercials grade web application. How about its security? Is
it better/worse than PHP? Is Ruby thread-safe?
So, what’s the drawback of leaving PHP and embrace Ruby as web programming
tools?
I develop web applications with Ruby ever single day, and wouldn’t do it
any other way. For my purposes the fact that it doesn’t have the market
penetration of PHP isn’t important. My customers typically don’t care
what language their stuff is implemented in. They just want it to work
and to be delivered on time.
I haven’t encountered any problems with web development using Ruby where I
have thought that PHP would be a better/easier choice. Security is a
facet of the application, and not the language. Ruby has internal
threading using green threads.
The main drawback of leaving PHP for Ruby is just the learning curve.
Figuring out how you want to approach things with Ruby. If you like the
PHP model of embedding code within HTML, take a look at eRuby or ERb. If
you want another model, such as an application framework or templating
system, there is a plethora of choices. If you like the idea of being
able to write templates that work with both Ruby and PHP, take a look at
Kwartz. http://www.kuwata-lab.com/webtech/kwartz.index.html
Kirk Haines
···
On Thu, 22 Apr 2004, Useko Netsumi wrote:
I’ve develop a few applications using PHP/MySQL/Apache and its growing in
size. After reading the Ruby tutorial, and do a simple script, I kind of
like this ease of use and a much cleaner language.
But I have reservation about its viability as a dominant web programming
language/tools. As with PHP, everywhere you look its PHP, perhaps it has
extensive bell and whistles for web programmers to write cool and
sophisticate commercials grade web application. How about its security? Is
it better/worse than PHP? Is Ruby thread-safe?
So, what’s the drawback of leaving PHP and embrace Ruby as web programming
tools?
So, what’s the drawback of leaving PHP and embrace Ruby as web
programming tools?
First of all: It’s very hard to compare languages to each other. You
generally don’t earn much in these debates because standpoints and
premises heavily differ from person to person and when this sort of
question arises with Ruby and Python or something similar, I generally
just suggest trying out both. And this might still be the best idea in
this case.
However I’ll write a more aggressive reply this time. This will be very
subjective and is by no means meant as an insult to any guys out there
using PHP.
I think that PHP has major flaws in its underlying design. It has lots
of inconsistency in its standard library, its naming conventions are a
major mess, its integrated standard libraries don’t use OOP much, there
are broken concepts like super globals, it has a history of sacrificing
security just to make the language appear simpler (Introducing things
like auto importing of parameters are this sort of mess – the PHP world
still has to recover from the damage caused by that model.) I also think
that that the approach of putting everything into the interpreter is
flawed – standard library (and the “Batteries included” way of
thinking) are good concepts, but there’s no argument for putting this
into the interpreter IMHO. (Yes, it’s still somewhat modular, but that
doesn’t help much.)
PHP seems to be taking anther, better route with PHP5 which means that
the things I just complained about might well be hopelessly outdated in
a few years.
There’s one good argument for using PHP however and that is industry
acceptance – PHP has lots of frameworks readily available. Ruby doesn’t
have those to the same degree – it’s getting closer, but if this is
what is most important to you, you might get good results with Python.
It’s everybody’s good right to disagree with this opinion. I don’t want
to try to convince the PHP community that they should stop using the
language – this is just how I feel towards PHP.
I hope I could help and didn’t offend anyone too much. Remember, this is
just my opinion and that it’s by no means neutral and undistorted.
I’ve develop a few applications using PHP/MySQL/Apache and its growing in
size. After reading the Ruby tutorial, and do a simple script, I kind of
like this ease of use and a much cleaner language.
But I have reservation about its viability as a dominant web programming
language/tools. As with PHP, everywhere you look its PHP, perhaps it has
extensive bell and whistles for web programmers to write cool and
sophisticate commercials grade web application. How about its security? Is
it better/worse than PHP? Is Ruby thread-safe?
So, what’s the drawback of leaving PHP and embrace Ruby as web programming
tools?
Thanks
What you get with PHP is maturity and speed and a dirty namespace.
Ruby is more elegant and extensible -beautifully object oriented with a
great class structure. You can extend/change built in classes.
With ruby i spend much less time in the docs and more coding.
Dont get me wrong PHPs docs are great and organized- the implementation
is not.
I've develop a few applications using PHP/MySQL/Apache and its growing in
size. After reading the Ruby tutorial, and do a simple script, I kind of
like this ease of use and a much cleaner language.
But I have reservation about its viability as a dominant web programming
language/tools. As with PHP, everywhere you look its PHP, perhaps it has
extensive bell and whistles for web programmers to write cool and
sophisticate commercials grade web application.
I also see Lisp (like Yahoo) and Smalltalk based web applications.
There are a lot of way to do things.
How about its security? Is
it better/worse than PHP? Is Ruby thread-safe?
Its worse if you have to use a shared hosting environment. Its not
possible to protect different virtual hosts when using mod_ruby. Of
course you can setup an FCGI ruby server for each virtual host, but
this can raise your memory consumption a lot.
So, what's the drawback of leaving PHP and embrace Ruby as web programming
tools?
If you must host 100 users on a 2,0 GHz Pentium with 1 GB RAM, you
don't have real a choice: you must use PHP.
But if you do more complicated thinks in larger applications there is
no drawback in leaving PHP and moving to a new language, whatever you
choose (maybe FORTH or Assembler wouldn't be really good but maybe
still better then PHP
Virtual Servers get more popular every day, so you have the freedom to
choose what you want.
I think one thing people like about PHP is it comes with a lot of
built-in functions for dealing with Web-related problems. It might be
an interesting project for someone to make a list of common PHP
functions used in web developments, with their Ruby equivalent
(including what library it comes from).
For example, just taking a quick look at the PHP docs I see ‘URL
Functions’ with base64_decode and base64_encode. So the table might have
PHP Ruby
base64_decode require 'base64’
Base64::decode64
base64_encode require 'base64’
Base64::encode64
Maybe it could even follow a similar organizational structure as the PHP
docs, so someone who wants to move from PHP to Ruby would feel right at
home.
True, but not completely true. Things like mod_ruby and eRuby let one
embed Ruby into HTML, and there is a wealth of different web application
frameworks sitting over on RubyForge for a person to chose from.
I personally use Ruby for almost all of my dynamic web page / web
application development. It works fantastically well.
Kirk Haines
···
On Thu, 22 Apr 2004, Savut wrote:
Ruby and PHP are two differents thing. Ruby is used for command line
program supporting user input and run just as batch file or linux shell
script do. PHP run embedded on a webpage and it main purpose is for website
development.
Damn! I guess I’ll have to delete my 40,000 line Ruby web application
then…
Cheers
Dave
···
On Apr 21, 2004, at 11:34, Savut wrote:
Ruby and PHP are two differents thing. Ruby is used for command line
program supporting user input and run just as batch file or linux
shell script do. PHP run embedded on a webpage and it main purpose is
for website development.
Well I use PHP nearly only on command line as a neat Perl replacement and just saw that ruby is of course also available as embedded Apache
scripting language (mod_ruby) so you guys should better focus to the language itself instead on their original purpose
(but IMHO ruby looks ugly => use php g)
Ruby and PHP are two differents thing. Ruby is used for command line
program supporting user input and run just as batch file or linux
shell script do. PHP run embedded on a webpage and it main purpose is
for website development.
With total disregard for any kind of safety measures "Savut" webki@hotmail.com leapt forth and uttered:
Ruby and PHP are two differents thing. Ruby is used for command
line program supporting user input and run just as batch file or
linux shell script do. PHP run embedded on a webpage and it
main purpose is for website development.
Hardly.
Ruby can be used for shell scripting, GUI application programming
(there are 3 GUI toolkits available that I know of) and Web CGI
scripting. It’s a very flexible language with a very nice syntax.
The only reason I can think of for choosing Ruby over PHP is the
Syntax however. It’s a lot more object-oriented than PHP4 and very
easy to learn. But the language is still quite young in terms of
available libraries. Plus it’s a lot easier debugging web apps
written in PHP.
Basically it all comes down to the fact that PHP is aimed, first
and foremost, at web applications. And most of it’s features are
tailored with this in mind.
Not necessarily. I run a very large, busy site consisting of around 250
dynamically generated pages of content using Iowa with a process size of
around 14-16Mb in size.
My personal business site is smaller, but has about 50 dynamically
generated pages served out of a process that runs around 5Mb in size.
The devil is in the details, but I am pretty confident that I could
support 100 sites on a 2.0 Ghz Intel server with 1GB of ram, if they were
all using Iowa to drive their dynamic content.
Kirk Haines
···
On Thu, 22 Apr 2004, Lothar Scholz wrote:
If you must host 100 users on a 2,0 GHz Pentium with 1 GB RAM, you
don’t have real a choice: you must use PHP.
I think one thing people like about PHP is it comes with a lot of
built-in functions for dealing with Web-related problems. It might be
an interesting project for someone to make a list of common PHP
functions used in web developments, with their Ruby equivalent
(including what library it comes from).
Or even going a step farther, create a module that’s nothing but
wrappers around those methods/classes.
require “php-transition”
plain = base64_decode(source)
actually is:
plain = Base64::decode64(source)
Though I have a feeling that having both PHP and Ruby targetting Parrot
would make this significantly easier, as long as the PHP functions are
implemented in a modular way.
I’ve develop a few applications using PHP/MySQL/Apache and its growing
in
size. After reading the Ruby tutorial, and do a simple script, I kind
of
like this ease of use and a much cleaner language.
But I have reservation about its viability as a dominant web
programming
language/tools. As with PHP, everywhere you look its PHP, perhaps it
has
extensive bell and whistles for web programmers to write cool and
sophisticate commercials grade web application. How about its security?
Is
it better/worse than PHP? Is Ruby thread-safe?
So, what’s the drawback of leaving PHP and embrace Ruby as web
programming
tools?
Thanks
What you get with PHP is maturity and speed and a dirty namespace.
There was a posting in this group that told the story of a PHP application
rewritten in Ruby with significantly less lines of code plus it was
considerably faster. Dunno the ref though.
In article 1441333312.20040421215228@scriptolutions.com,
: UN> So, what’s the drawback of leaving PHP and embrace Ruby as web programming
: UN> tools?
:
: If you must host 100 users on a 2,0 GHz Pentium with 1 GB RAM, you
: don’t have real a choice: you must use PHP.
Assuming that all 100 users agree on what PHP syntax to use.
Have you looked at /etc/php.ini? It’s a single, global configuration
file, and it controls all kinds of aspects of the language.
Have you looked at the docs? One can set set php.ini-values per
server, per virtualhost, per directory and per script. No user has to
agree with any other user.
Please don’t let this become such a useless php-vs-ruby-bashing-
thread.
···
On Thu, Apr 22, 2004 at 09:39:08PM +0900, Dave Brown wrote:
; Use Sybase-style magic quotes (escape ’ with ‘’ instead of ').
magic_quotes_sybase = Off
Or the CGI-parsing behaviour:
; This directive describes the order in which PHP registers GET, POST, Cookie,
; Environment and Built-in variables (G, P, C, E & S respectively, often
; referred to as EGPCS or GPC). Registration is done from left to right, newer
; values override older values.
variables_order = “EGPCS”
Change that and some of the scripts stop working and some of the scripts
start working. And someone who tests their scripts on their home system
with a php.ini that slightly differs from yours will have all kinds of
problems. Try to install an app which requires a change to your php.ini
and you could break everyone else’s code.
And don’t get me started on why there isn’t an equivalent of DBI, or how
optimization patches aren’t accepted into the open-source PHP codebase
(because that would compete with Zend) or why you have a choice of more
than 20 different functions just to do search-and-replace, or any number
of other things.
I’m in the process of banishing PHP from my web site. I tried. It
didn’t work out. It’s just too painful to work with any more. The
actual amount of code that I have to write has practically collapsed;
I’ve gone from multi-hundred-line PHP source files to tens-of-lines Ruby
source files. Most of my source files I can now fit onto a single
(50-line) xterm. Life is so much easier now, and I can spend my time
doing what I want to instead of fighting with the language.
Ruby and PHP are two differents thing. Ruby is used for command line
program supporting user input and run just as batch file or linux
shell script do. PHP run embedded on a webpage and it main purpose is
for website development.
Damn! I guess I’ll have to delete my 40,000 line Ruby web application
then…
Don’t worry, I’m sure you can rewrite it in 90,000 lines of PHP.
Quite. I highly dislike doing web stuff that leaves the functionality
tied to the web… that means either in the CGI or some embedded code.
PHP isn’t too easy to make a backend with.
Ruby and PHP are two differents thing. Ruby is used for command
line program supporting user input and run just as batch file or
linux shell script do. PHP run embedded on a webpage and it main
purpose is for website development.
True, but not completely true. Things like mod_ruby and eRuby let
one embed Ruby into HTML, and there is a wealth of different web
application frameworks sitting over on RubyForge for a person to
chose from.
I personally use Ruby for almost all of my dynamic web page / web
application development. It works fantastically well.
It is very unfortunate that this nice young language does not consider the
web development in mind. I even think that if and only if Ruby creator ever
think this thru by including web design in mind, Ruby can easily gain its
popularity against PHP and Java because of its ease of use features, its
consistency, its OO paradigm, and many.
Is there any work being done to cater specifically for web development?
Thanks
With total disregard for any kind of safety measures "Savut" webki@hotmail.com leapt forth and uttered:
Ruby and PHP are two differents thing. Ruby is used for command
line program supporting user input and run just as batch file or
linux shell script do. PHP run embedded on a webpage and it
main purpose is for website development.
Hardly.
Ruby can be used for shell scripting, GUI application programming
(there are 3 GUI toolkits available that I know of) and Web CGI
scripting. It’s a very flexible language with a very nice syntax.
The only reason I can think of for choosing Ruby over PHP is the
Syntax however. It’s a lot more object-oriented than PHP4 and very
easy to learn. But the language is still quite young in terms of
available libraries. Plus it’s a lot easier debugging web apps
written in PHP.
Basically it all comes down to the fact that PHP is aimed, first
and foremost, at web applications. And most of it’s features are
tailored with this in mind.