Live data from Hacker News

Ask HN: Is PHP more scalable than Ruby or Python?

news.ycombinator.com

1–10 of 15 posts

Ask HN: Is PHP more scalable than Ruby or Python?

#1
Edit: I just realized how generic my post was... so I want HN to weigh in on something a friend said:

"PHP is more scalable than Ruby and most languages"

//start old post Let me preface this with: I'm not trying to start a language war.

I have very little experience coding, but have learned enough (some may say 'caught') PHP to get by.

I want to take it a step further but I'm getting thrown in a thousand different directions. I want a language/framework that's fairly straightforward and somewhat scalable.

I am looking at Python/Django, but getting pulled towards Ruby/Rails by friends - and some people saying that PHP is more scalable than either Python or Ruby and I should be looking at the Cake or CodeIgniter frameworks.

Can someone push me in the right direction? I want to invest the time in a language but I'm not sure which to start with. //end old post

Re: Ask HN: Is PHP more scalable than Ruby or Python?

#2
Any mainstream language you choose will be scalable enough.

Spend some time reading online rails and django documentation. Either one will be fine for you to learn.

My personal opinion is that Python is easier to learn for a beginner, but not by much. Ruby has http://hacketyhack.net/ which is a fun way to learn, and Python has http://www.diveintopython.org/ which is a tremendous (and free!) resource.

I say flip a coin and roll with it. They're both great languages and both frameworks are great for learning.

[Errr... The submission changed after my response was entered, sorry if it seems a bit off-topic.]

Re: Ask HN: Is PHP more scalable than Ruby or Python?

#4
post #2

Any mainstream language you choose will be scalable enough. Spend some time reading online rails and django documentation. Either one will be fine for you to learn. My personal opinion is that Python is easier to learn for a beginner, but not by much. Ruby has http://hacketyhack.net/ which is a fun way to learn, and Python has http://www.diveintopython.org/ which is a tremendous (and free!) resource. I say flip a coi…

That's true; Ruby and Python would both be worth learning. I'd push you toward Python, though, mainly because it has more traction outside of web development too (e.g. system administration, etc).

Re: Ask HN: Is PHP more scalable than Ruby or Python?

#7
post #5

Why are you worried about scalability when you're just learning to program?

I'd like to keep it in mind and I find it fascinating. Plus, in the future I don't want to have to tear down what I've built and rebuild again just because it wasn't scalable from the start.

Basically I know enough PHP to get by and if it's possible to code some awesome, and scalable, apps in PHP then I might as well expand my knowledge of PHP instead of starting with something new and completely foreign.

Re: Ask HN: Is PHP more scalable than Ruby or Python?

#8
Scalability for web applications has -nothing to do with the programming language-. PHP, Ruby, Python, ASP.net, they all use the same strategies to scale. Three things: cache religiously, index well, and refactor your database queries.

Take it from me: I've worked on a Java site with over 2 million monthly uniques. I built a Ruby on Rails app from the ground up that grew to over 15 million pageviews a day. I also helped build a PHP-backed api the handled a few million hits a month.

I'm sick and tired of the "X scales better than Y" debate. It's pointless.

Re: Ask HN: Is PHP more scalable than Ruby or Python?

#9
post #8

Scalability for web applications has -nothing to do with the programming language-. PHP, Ruby, Python, ASP.net, they all use the same strategies to scale. Three things: cache religiously, index well, and refactor your database queries. Take it from me: I've worked on a Java site with over 2 million monthly uniques. I built a Ruby on Rails app from the ground up that grew to over 15 million pageviews a day. I also hel…

Not only pointless but willfully ignorant. Think about it, people who say one language is more scalable than another don't even understand scaling means. Only slightly better are the religious rants about some framework or another.

In reality, the most a language or framework can provide is a slight head start in terms of absolute performance. The dominant factor will always be nature of the application.

Re: Ask HN: Is PHP more scalable than Ruby or Python?

#10
Don't freak out about it. This is not like getting married.

First the easy advice: If you have friends pulling you toward Ruby and Rails... learn Ruby and Rails. Momentum is a good thing. Comradeship is a good thing. Don't worry: If it turns out in two years that we'd all rather be using Python and/or Django, we can switch. It will still be there.

Now we begin to edge toward personal opinion: I'd avoid sticking with PHP. Not merely because PHP is often like a parody of a programming language, but because variety is the spice of life. Learn something different. Take a look at how other languages do things.

Now, if you really want to stay out of a language war, ignore anyone who goes on about the "scalability" of their chosen language. Most of those claims are just posturing, backed up with no relevant data. [1] If your PHP friends won't shut up about their language's unbeatable super speed, show them the first fifteen minutes or so of Yehuda Katz's Merbcamp keynote:

http://www.merbcamp.com/video/katz3.mp4

... and once they're done rending their garments and throwing things at the screen tell them to take some data and go argue with someone who cares. You've got better things to do.

---

[1] Why do most language scalability arguments have such dubious data to back them up? Because, as others have taken pains to point out, languages don't scale: application architectures scale. If your webapp is much more complex than "Hello, World" its efficiency will depends on a host of factors, of which the speed of any particular language construct is usually a tiny one.

Post reply on HN