Ruby VS PHP

T

Tristan Knowles

I was chatting with a PHP dev friend tonight, he is a
PHP die hard who thinks it can do anything.

Now, I am new to Ruby and programming in general, and
wasn't really able to offer any insightful reasons why
he should at least look at Ruby. So, I was wondering
if I could get some ammo for next time, especially
from people with a PHP background.

I don't mean the title in a literal sense, I'm more
after some general points about Ruby which distinguish
it from PHP.

I dropped the whole OO vs not true OO but he claimed
PHP has been OO since v3.

Any comments with regards to this? Point me in the
right direction if its been brought up a million times...:)


=09
=09
=09
___________________________________________________________=20
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voic=
email http://uk.messenger.yahoo.com
 
G

gabriele renzi

Tristan Knowles ha scritto:
I dropped the whole OO vs not true OO but he claimed
PHP has been OO since v3.

Any comments with regards to this? Point me in the
right direction if its been brought up a million times...:)

I can comment this last sentence. If he thought php (and <5 !) was OO he
has a bad idea of what Object Oriented means.
Anyway show him the usual rails videos ;)
 
B

Belorion

I dropped the whole OO vs not true OO but he claimed
PHP has been OO since v3.

Lol, that's pretty funny. It may have had a few OO type
implementations, but they were hacked and incomplete. PHP4 OO was
also incomplete and felt very hackish to me. (I can't say anything
about v5, because I haven't used it ... because I have Ruby/Rails now
;).

Basically, PHP started out as a small personal project (like many
languages) and has evolved over time. Features were added as needed,
but the core remained relatively unchanged for quite some time, and
they simply built around it. Ruby, on the other hand, was built from
the ground up with OO in mind.

I agree - if you can, show him the rails video. Ask him if he could
get a working blog app up in 15 minutes[1]. I have to admit, I didn't
see the Rails light until I saw Curts tutorial, but I've been hooked
ever since.
 
J

James Britt

Tristan said:
I was chatting with a PHP dev friend tonight, he is a
PHP die hard who thinks it can do anything.

Maybe in his hands it can.

Now, I am new to Ruby and programming in general, and
wasn't really able to offer any insightful reasons why
he should at least look at Ruby. So, I was wondering
if I could get some ammo for next time, especially
from people with a PHP background.

Suggest that Ruby might offer a different take on OO and dynamic typing
than PHP, and that he might gain some insight on programming in general
by taking a look at other languages. If there is a lack of natural
curiosity then screw it.

I don't mean the title in a literal sense, I'm more
after some general points about Ruby which distinguish
it from PHP.

I dropped the whole OO vs not true OO but he claimed
PHP has been OO since v3.

Ah, "But that's not OO!"

See http://www.paulgraham.com/reesoo.html

James

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
 
T

Tristan Knowles

--- Belorion said:
I agree - if you can, show him the rails video. Ask
him if he could
get a working blog app up in 15 minutes[1]. I have
to admit, I didn't
see the Rails light until I saw Curts tutorial, but
I've been hooked
ever since.

Hmm. I havn't even seen these... Gonna check them out.


=09
___________________________________________________________=20
How much free photo storage do you get? Store your holiday=20
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
 
L

Lothar Scholz

Hello Belorion,

B> Lol, that's pretty funny. It may have had a few OO type
B> implementations, but they were hacked and incomplete. PHP4 OO was
B> also incomplete and felt very hackish to me. (I can't say anything
B> about v5, because I haven't used it ... because I have Ruby/Rails now
B> ;).

PHP 5 is much much better. They only have the same problem that
disqualifies PHP for more complicated things: All source code must be
loaded and parsed all the time on each request.

Because of the PHP include/require mechanism and programming style only
some of this parsing tasks can be cached by 3rd party add-ons to the PHP VM.

B> Basically, PHP started out as a small personal project (like many
B> languages) and has evolved over time. Features were added as needed,
B> but the core remained relatively unchanged for quite some time, and
B> they simply built around it. Ruby, on the other hand, was built from
B> the ground up with OO in mind.

But it was with build with web sites in mind.

And it is still the best tool out there for simple websites that
only need a little scripts. For these millions of websites rails would
be completely unusable because of costs for
introduction/resources/maintainance.

The main PHP problem is just that too many people thought (and even
still think) it scales well with increased application size.
 
T

Tristan Knowles

--- Lothar Scholz said:
And it is still the best tool out there for simple
websites that
only need a little scripts. For these millions of
websites rails would
be completely unusable because of costs for
introduction/resources/maintainance.
=20
The main PHP problem is just that too many people
thought (and even
still think) it scales well with increased
application size.


Actually, part of my reason for learning Ruby is
because I have a project coming up that I will be
designing, and i'm not sure if PHP is up to the task.=20
I have been looking at ColdFusion, or more likely, the
J2EE framework.

I prefer the philosophy and community of Ruby, but am
still not sure at which point it is required. When
would you say, ok, here is a job for Ruby?

A basic site requiring a MySQL backend for a few
queries here and there is obviously a job for PHP, so
at what stage is Ruby required?


=09
___________________________________________________________=20
How much free photo storage do you get? Store your holiday=20
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
 
E

Eustáquio Rangel de Oliveira Jr.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

| The main PHP problem is just that too many people thought (and even
| still think) it scales well with increased application size.

Another one is that their team changes a lot of stuff a lot of times and
just sometimes put some compatibility to older versions.
The database functions changed but the old ones works. The way to refer
to $this changed somewhere on the 5.x development and they just leaved
the things breaks. :-(

- ----------------------------
Eust=E1quio "TaQ" Rangel
(e-mail address removed)
http://beam.to/taq
Usu=E1rio GNU/Linux no. 224050
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFC2TyTb6UiZnhJiLsRAuG7AJ4tAVZe24MO0eaDHAs0iLgbiUma4wCeMr2H
PrS8B+2aKzKe10C3zyroSrw=3D
=3DPqiv
-----END PGP SIGNATURE-----
 
R

Robert Oliver

------=_Part_283_30611254.1121534650632
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

=20
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
=20
| The main PHP problem is just that too many people thought (and even
| still think) it scales well with increased application size.
=20
=20
=20
I still think that PHP 4/5 have uses, especially in small sites or in=20
one-post type applications. Even though Ruby / Rails seem the most efficien=
t=20
languages to me even for middle sized projects, PHP has the ability to=20
quickly let you implement a template system, or to do a quick form that in=
=20
Ruby dragging out CGI would seem too much.=20

So, from my personal perspective, and what direction our company is taking,=
=20
Ruby (and/or) Rails for medium and large projects, and PHP for small ones.


--=20

Robert W. Oliver II
CEO / President - OCS Solutions, Inc.
http://www.ocssolutions.com/

------=_Part_283_30611254.1121534650632--
 
J

Jim Freeze

* Robert Oliver said:
I still think that PHP 4/5 have uses, especially in small sites or in
one-post type applications. Even though Ruby / Rails seem the most efficient
languages to me even for middle sized projects, PHP has the ability to
quickly let you implement a template system, or to do a quick form that in
Ruby dragging out CGI would seem too much.

So, from my personal perspective, and what direction our company is taking,
Ruby (and/or) Rails for medium and large projects, and PHP for small ones.

Are you aware that you can now use Wee inside rails. So, those
simple one-post type applications become even more trivial.
 
R

Robert Oliver

------=_Part_380_10246839.1121541390362
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

=20

ones.
=20
Are you aware that you can now use Wee inside rails. So, those
simple one-post type applications become even more trivial.
=20
Jim,

No I wasn't aware of using Wee for simple things. I'll check this out.

Still.. we gotta find something for PHP to do don't we? :)

--=20

Robert W. Oliver II
CEO / President - OCS Solutions, Inc.
http://www.ocssolutions.com/

------=_Part_380_10246839.1121541390362--
 
M

Marcelo Paniagua

Also, you could note that with Ruby you can make non-Web applications,
which to my knowledge, you can't with PHP.
 
D

Dominik Schlütter

Hi,

Marcelo Paniagua said:
Also, you could note that with Ruby you can make non-Web applications,
which to my knowledge, you can't with PHP.

That's not true, of course you can build "non-web" apps with PHP [0] -
starting with simple scripts up to GTK bindings <http://gtk.php.net/>
you have quite a lot of possibilities.

I think there's a lot of prejudice in that field. There are people
building high-traffic websites using PHP, and I think it scales at least
as good as "Ruby on Rails" (as you can use the same methods for
distributing your server load). There's also commercial support
available from Zend <http://www.zend.com/>.

And last but not least it's still much easier to find a web hoster who
supports PHP (with database bindings etc.) than to get support for Ruby
or even Rails. The latter is changing, though - but at least here in
Germany there's still a long way to go.


Regards,

Dominik.


[0] e.g. autocompletion and method reference for PHP in my editor
TextMate <http://macromates.com/> is written as PHP scripts ...
 
R

Robert Oliver

------=_Part_496_13731161.1121546720390
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

=20
=20
I think there's a lot of prejudice in that field. There are people
building high-traffic websites using PHP, and I think it scales at least
as good as "Ruby on Rails" (as you can use the same methods for
distributing your server load). There's also commercial support
available from Zend <http://www.zend.com/>.


I agree with this. PHP scales quite well. In fact, in my experience, it did=
=20
better performance wise than RoR pre v.13. But the benefits that RoR brings=
=20
on development are worth the extra server resources IMHO ;)=20

And last but not least it's still much easier to find a web hoster who
supports PHP (with database bindings etc.) than to get support for Ruby
or even Rails. The latter is changing, though - but at least here in
Germany there's still a long way to go.


Hopefully this is improving. We offer full RoR and Ruby support, and I know=
=20
some others are too. The thing is though, most web hosts have a "If Cpanel=
=20
doesn't have a checkbox for it we don't offer it" attitude. Partially this=
=20
is due to lack of experience on the part of alot of server admins of alot o=
f=20
smaller web hosting companies.

--=20

Robert W. Oliver II
CEO / President - OCS Solutions, Inc.
http://www.ocssolutions.com/

------=_Part_496_13731161.1121546720390--
 
L

Lothar Scholz

Hello Dominik,

DS> That's not true, of course you can build "non-web" apps with PHP [0] =
-
DS> starting with simple scripts up to GTK bindings <http://gtk.php.net/>
DS> you have quite a lot of possibilities.

I think the killer argument against this is that a php script never
frees memory, so it is not useable for many non web applications.


--=20
Best regards, emailto: scholz at scriptolutions d=
ot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's
=20
 
A

Ara.T.Howard

Hello Dominik,

DS> That's not true, of course you can build "non-web" apps with PHP [0] -
DS> starting with simple scripts up to GTK bindings <http://gtk.php.net/>
DS> you have quite a lot of possibilities.

I think the killer argument against this is that a php script never
frees memory, so it is not useable for many non web applications.

seriously? __never__? if so - wow.

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| My religion is very simple. My religion is kindness.
| --Tenzin Gyatso
===============================================================================
 
S

Stefan Scholl

I was chatting with a PHP dev friend tonight, he is a
PHP die hard who thinks it can do anything.

And why do you continue to talk to him? It's a waste of time.
 
D

Dominik Schlütter

Hi,

Tim Hammerquist said:
That's dangerously like saying gasoline cars are better than electric or
hydrogen because it's easier to find a gas station.

Hmm - not sure about your example, as electricity outlets are even
easier to find than gas stations. But I would take "better" as "better
suited for today's life" - and then your above statement is true.

Electric or hydrogen cars might be "better" from an engeneering and
environmental point of view. But if you see your car as a way of
transportation and not only as a technical masterpiece, it is more
important to be able to get your fuel whenever you need it[0], IMHO.

Or if you look at Ruby: I really like it for administrative scripts and
I'm toying with Rails on my PowerBook. But my current web hoster
(domainfactory) e.g. only supports Ruby, no Rails, no fast-cgi or
mod_ruby. I'd like to do one of my next projects as a Rails application,
but that means I'd have to find me a new hoster being able to handle
different admin-c (the customer) and billing address/accounts (me),
offering something to grow with my needs, provide good support and
possibly be inside the EU. All these things are much easier to find, if
you only look for PHP - that's what I wanted to say with my statement.


Regards,

Dominik.


[0] And I need it quite often as I'm driving a 30 year old Citroen AK400
with a gas tank of about 25l ... :).
 
S

Shaun Fanning

I have used PHP over the last three years to build a fairly complex, high
traffic and quite profitable web-based CRM-like application in the education
market. It served me well in the early stages of the business because we
were able to get new features out very rapidly and scaling for traffic has
been no problem. But I have to say I think the biggest weakness is in
scaling with the complexity of your application. That's why I'm on this
mailing list right now. I'm looking at Ruby and specifically RoR as a way to
maintain the agility that comes from using a dynamic language but gain some
structure and a greater power to manage an increasingly complex domain
model. The PHP community has been pushing toward more "best practices" like
test-driven development, design patterns, etc., but this is a relatively
recent thing and while PHP allows you to do these things, it doesn't
necessarily make them easy or natural. You can do a lot of things with PHP
or any language if you're smart enough, but that doesn't mean you should if
there are other tools for the job that are more productive. Getting more
productivity out of my development team is a much bigger business issue for
me right now than scaling to handle more traffic. It all depends on what
your ultimate goal is. I'm a Ruby Nuby so don't take my word for it, but so
far I'm pretty excited by what I've found both in terms of the language
itself and the community behind it, relative to my experience with PHP.
 
M

Matthew Berg

The main PHP problem is just that too many people thought (and even
still think) it scales well with increased application size.

Scalability has a lot more to do with design than language. I work at a
company with an extremely large PHP codebase pushing over 5200 requests
a second at peak.

Though I prefer the coding style Ruby encourages myself, PHP is like
Perl - it's only as good as the programmer writing it. My main problem
with it has always been somewhat lackadaisical regression testing on new
releases. That may have improved in 5.x as well, but they had a bad
habit of introducing stupid bugs in the 4.x series.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top