views:

157

answers:

3

Aside from scalability issues, has anyone here actually stumbled upon a web-development problem where PHP just didn't cut it and had to go for another language / platform?

I am interested in particular scenarios and the ways they have been handled.

Thanks.

+12  A: 

I've been working as a PHP developper (sometimes on projects not too small) for more than 3 years, and I have never really met anything that PHP wouldn't allow me to do.

Of course, you sometimes/always have to use several servers, some other piece of software (database, reverse proxy, cache, ...) ; but that's part of the game ;-)

Actually, the best thing about PHP is its "glue" nature : what PHP does is allow you to glue stuff together, to build your application using different components.
And PHP does that really well.

Sometimes, you'd have to programm in C to code a PHP extension, to glue to something no-one else has ever used (there are a lot of PHP extension which do that already like mysql or curl, to say only two names) ; but there are so many extensions that already exist that I've never had to do that -- even if I'll probabaly do so one day or another, just for fun ;-)


An important thing to note is that there is probably always a solution to your problems :

  • You're speaking about scalability ; what about caching ? using several servers ? using a reverse proxy ? PHP has no problem with that.
  • And, as you can see on SO (and in so many places) : PHP has a great community !


If I had to think about one thing that PHP is not well suited for, I'd say "comet" : PHP model of one process per request is not good for long polling and the like...

PHP is not quite good for long running batches, too ; and you often have some of those alongside your web application ; and using the same language allows you to reuse code -- still, I've always found a (not too difficult) solution.

Oh, and I'd also say : PHP is great for web applications... But not that great when is comes to desktop applications -- even if it's possible (see PHP-GTK for example).

Pascal MARTIN
Nicely written!
Arms
@Arms : thanks !
Pascal MARTIN
+8  A: 

The only limit I've ever reached as a programmer was that of my own abilities. I've worked on sites that did a few hundred hits a day and maintained software for a network of sites doing over 1M uniques/day total and both ran on the same piece of the software. The pressure wasn't on PHP, the pressure was on me to make PHP, the servers and the databases all work together to make use of them properly and to do things in a scalable way.

  • Query optimization
  • Database optimization
  • HTTP Caching
  • Memcache/APC
  • Server optimization
  • Master/Slave database setup
  • Profiling
  • Choosing just the right amount of DB normalization
  • Proper logging (only logging what's useful and not so much logging that it becomes useless)
  • Attention to detail
  • Proper testing
  • Code organization
  • Version control with good branching/tagging
  • File servers vs web servers vs database servers
  • Reverse proxies
  • General security (preventing SQL Injection, preventing XSS attacks, Session hijacking, etc)

All things learned along the way to making myself a better programmer. There's very few languages that can't run any site on the internet without the proper hardware behind it. Much of your job as a programmer is finding out the best way to take advantage of that hardware.

There are things however that PHP isn't all that good at by it's nature. Such things would include:

  • Desktop software (although possible)
  • Daemons (again, possible)
  • Large scale string manipulation (such as scraping sites) in a timely manner
Steven Surowiec
+2  A: 

PHP is Turing-complete, so it technically doesn't have any limits than any other language doesn't have. However, there are things that I find easier to do in other languages.

Chuck