
Running a Modern Startup on PHP - SeoxyS
http://blog.chartboost.com/post/4591949888/php-agile-development
======
aeontech
Their setup doesn't seem extra-ordinary in any great way, and reads more like
a justification against a strawman argument. The author sets up with "PHP is
regarded as a clumsy and amateurish technology, best left to development
newbies". I am not sure who it is that regards PHP in such a way. Sure, it's
not as sexy as Clojure, Scala, Ruby or Erlang these days, but I don't think
anyone needs to be convinced that PHP is a worthy technology to build a
platform on - some of the biggest sites out there are running on PHP just
fine.

PHP has a bit of a reputation for attracting unskilled programmers, but that's
because it is so easy to get started with, which leads to a lot of newbies
writing it. All that means is that you may have to filter your candidates more
carefully when you hire, and nothing to do with the language itself.

In short, the post seems subjective and opinionated, without showing any
concrete problems that they overcame with alternative languages or frameworks.
"Codeigniter is bloated" vs "Paraglide is awesome" are both so vague as to be
useless. "Ruby's syntax sucks" is even worse.

Much better to have had a list of specific things that dissuaded them from
using one framework or language, and some killer features that convinced them
to use the other - if all I see is a personal opinion without any reasoning
behind it, I cannot make any useful decisions in my own situation.

~~~
omouse
_"PHP is regarded as a clumsy and amateurish technology, best left to
development newbies". I am not sure who it is that regards PHP in such a way._

No one likes it but it gets the job done in a clumsy and amateurish way. It's
the BASIC of web programming. Those other so-called sexy languages have
actually been _designed_ rather than having features bolted on later, those
features are designed to fit into the language from the start.

 _some of the biggest sites out there are running on PHP just fine._

Popularity != proof of goodness.

~~~
sanswork
I think he was trying to show capability more than quality.

------
jmspring
Simply put - if you are a good developer and the language isn't completely out
of whack for what you are attempting to do -- for instance, web apps and
fortran probably aren't optimal -- the language shouldn't matter in terms of
getting things done.

I know of a couple of startups doing well that are built using PHP. One
doesn't even advertise the fact that they use PHP because they want strong
developers regardless of language. Fact is, PHP is pretty darn simple to pick
up, not much harder to do things correctly, and has a _lot_ of third
party/opensource support. Is it cool? No, but when it comes to language wars,
this pretty much sums up my feelings:

<http://programming-motherfucker.com/>

Personally, there was a startup about 6 years ago where I wanted to use
Python. The IT guy and I got into a discussion about PHP vs. Python. He was
more comfortable in securing PHP apps. I was enamored with Python, since I was
writing a bunch of stuff with it. After exploring mod-python vs. mod-php, mod-
python had bugs and wasn't nearly as mature, so we went with PHP. The language
didn't matter, it was about getting things done.

There are lots of "cool" languages out there, a good dev will run circles
around a mediocre dev who focuses on things that are "cool".

~~~
troels
Isn't `mod_python` dead?

~~~
zoomzoom
Yes, replaced by mod_wsgi.

------
bgoldman
As the author of Paraglide and Paragon, I thought I'd post here. I knew SeoxyS
was writing a blog post that may have included Paraglide, but I didn't know
when he would publish it. I'm glad that he did, but had I known when, I may
have whipped up a simple homepage, did a little bit more polishing, and
created some basic documentation. I wasn't quite ready yet to release this to
the wild for mass consumption. It's in the cards, but I just didn't expect to
push it publicly for a little while longer.

Thanks to everyone who followed the github project, and whoever had nice
comments to say. For anybody that has criticism of the projects, I'm happy to
address them in a separate thread when I officially release the project
publicly. I'll make a post here when I'm ready and have proper documentation.
Please expect more updates in the very near future, and thanks for the
interest.

~~~
johnkary
I'd really just like to know why your framework reinvents the wheel for nearly
every aspect of the application stack? Looking at the code even thus far, I
don't see how Paraglide or Paragon improves on any aspect already offered by
the largest frameworks Zend Framework, Symfony and Lithium, which already have
documentation, encourage new contributions and follow best practices within
their respective paradigms.

Why not contribute to an existing framework? Your efforts will be better
received and more widely appreciated.

The absolute last thing the PHP community needs is another framework.

~~~
bgoldman
If this were a brand new framework, then maybe it would be a waste of my time,
unless I had more compelling reasons. However, I started building my framework
a few years ago and have just been making incremental updates here and there.
Friends and coworkers have started to use it over time, and people like it.
I've been told to publicize it over the last 3-6 months, but haven't gotten
around to it.

My framework is minimalist and gets the job done. I'm a big fan of minimalism
and I don't like that some modern frameworks are bloated and have something
like hundreds of thousands of lines of code, as opposed to just a few
thousand, and that includes components outside the core, like helpers.

Paragon has more work in it than Paraglide. Paragon can support multiple
different backends with the same code, just different drivers. I know this
exists in other PHP ORM frameworks now, but not a few years ago (not saying
mine was the first, it just wasn't as widespread). Also, Paragon integrates
cleanly with Memcache so the developer doesn't have to deal with cache and
uncache logic.

Hope this clears things up!

~~~
chrisohara
Exactly what I was going for when I released klein.php
(<https://github.com/chriso/klein.php>)

Sure, you could do the same thing with other frameworks, but most of the other
frameworks are full of bloat and not particularly fast. I think it's better to
have a few components that do one thing really well rather than a monolithic
framework that tries to handle every aspect.

------
josegonzalez
Paraglide and Paragon looks pretty terrible. Honestly, I don't see it as a
great PHP5.3 framework. In fact, it looks pretty terrible.

Lithium would be a better choice, if you think that you can't do OOP in PHP5
without 5.3, or you think that all other frameworks suck for this/that reason:

<http://lithify.me/>

Personally I use CakePHP for side-projects, and it suits me just fine. But
honestly, PHP development isn't that bad, even with a 3 year old version of
certain frameworks...

~~~
breck
Paraglide and Paragon look decent to me.

PHP makes the need for a framework minimal. Cake is neat but overkill in a lot
of ways unless you happen to be one of the developers of Cake and know it
inside and out. Same goes with Kohana, CodeIgniter, etc.

If you know PHP well, it's almost as efficient--possibly moreso--to program
your own minimal MVC framework. PHP has so much of what you need done for you
that only an efficient ORM is a bit tricky.

You're not going to have the widespread adoption of your framework that Rails
enjoys. This is because Rails increases the utility of Ruby for webapps by a
factor of 10x while your PHP framework improves PHP for web apps about 2x.

BUT, if you are using PHP you might as well write your own internal framework
because it's a fun programming exercise and will take you only a little longer
than mastering someone else's.

I went down the same path(created my own minimal php framework called uno a
while back), though if I'm doing MVC apps nowadays it's almost always using
Rails. Rails has the advantage of loads of great devs that know it. Also, once
I learnt Rails well I grew to depend on certain features that I just didn't
want to emulate in Uno.

~~~
josegonzalez
I am actually one of those people that knows CakePHP inside and out (see
<http://github.com/josegonzalez>).

Regardless, a framework is a way to jump-start someone in developing for a
given language. Honestly, I've taught at least 5 developers PHP in about half
the time it would normally take using a framework than without. The same
applies to any other language.

It's easy to write your own framework, but I can almost guarantee you that it
will have more bugs than any of the larger, open source frameworks out there.
They may have their chinks, but those get largely fixed and tend to benefit
the most people. Using a well-known, and well-tested, framework means you have
access to a greater pool of developers, and they don't have to learn the
idiosyncracies of something you've written because you could.

And while I am in the process of writing my own framework (see
<https://github.com/josegonzalez/git-php>), I still prefer using someone
else's framework. It's nice to be shown other ways of doing things.

"If you know LANGUAGE well, it's almost as efficient--possibly moreso--to
program your own minimal ARCHITECTURE framework. LANGUAGE has so much of what
you need done for you that only an efficient IMPORTANT_DETAIL is a bit
tricky."

~~~
breck
> but I can almost guarantee you that it will have more bugs than any of the
> larger, open source frameworks out there.

I think you can _definitely_ guarantee it :). Before stopping dev work on Uno
I ran into plenty of bugs that I didn't anticipate that would have been
quickly weeded out by a bigger community. Many times I realized, "oh, this is
why all the frameworks do it that way", only after doing things a way I
thought was "simpler".

> "If you know LANGUAGE well, it's almost as efficient--possibly moreso--to
> program your own minimal ARCHITECTURE framework. LANGUAGE has so much of
> what you need done for you that only an efficient IMPORTANT_DETAIL is a bit
> tricky."

Good point. I do think PHP is a bit unique though in the respect that many
people argue that _PHP itself is_ a framework/architecure for web apps. But I
largely agree with everything you've said.

~~~
josegonzalez
PHP is a complicated templating language ;)

------
aaronbrethorst
Despite the author's denigration of Ruby for its "mess of symbols, implied
parenthesis (sic), and lack of statement endings," they sure do depend on a
lot of Ruby tools and Ruby-based services: Capistrano, Github, Lighthouse,
Tender, and Campfire.

~~~
ceejayoz
I don't like metalworking, but I depend on my car.

------
donaq
_Older technologies don’t get much love, and PHP especially has a bad
reputation_

Actually, Python is older than PHP.

~~~
semerda
Correct. Python 1991 (20 years ago) & PHP 1995 (16 years ago).

------
drm237
CodeIgniter is bloated? It doesn't even include an ORM! There are some many
things missing from it that other frameworks include that I can't even fathom
what the author is talking about.

Having switched from PHP to Ruby a year ago, I now find Ruby's syntax
beautiful and incredibly powerful. If you don't like the implied parentheses,
it turns out, you can go ahead and add them!

Edit: because I didn't proofread the first time...

~~~
breck
> Having switched from PHP to Ruby a year ago, I now find Ruby's syntax
> beautify and incredibly powerful. If you don't like the implied parentheses,
> it turns out, you can go ahead and type them add them!

I like Ruby's syntax as well and do most web app work in Rails nowadays.

However, one thing I love about the PHP syntax is that it's so easy to switch
between PHP and C or C++ and vice versa. So if you're doing a lot of C work
and only a bit of web work, it's nice to know PHP.

Otherwise if you're doing web work full time, Ruby's quite fun.

------
ssharp
Lumping CodeIgniter and Symphony together as parallel examples of bloated and
get-in-your-way frameworks seems like a stretch.

CodeIgniter is modular, so you can just use the MVC capability it provides and
leave the rest alone. Symphony seems to require a substantial amount of prep
and up-front learning in order to use it. I couldn't see the set up time
between the two frameworks being much further apart.

I'm curious what aspects of CodeIgniter the author found to be bloated and
crippling.

~~~
ricardo_sdl
When I started using CodIgniter the easiness of installing the framework
really amazed me. You don't even need the mod_rewrite enabled!

Just extract the CodIgniter code into a webserver directory and create the
controller code to show some output or load a view and you are done!

------
clu3
The framework is one thing, how you use it is more important and I believe
once you know any framework ( and in any language) inside out, it's kinda
pointless to compare. Anything will do, unless you are writing a new super
duper cool Google, Twitter of Fb

Also strange, after reading 51 comments, i have not seen anyone mention Zend
Framework. It's got a steep learning curve, but it's just awesome. I've been
writing a social web app framework based on ZF, Redis, Gearman and lots of
other stack and it's awesome.

~~~
mattm
I also love Zend but you're right about the learning curve. It's a bit steep
but is well designed IMO.

------
daakus
Why would one use a language where the best you can say is "it gets the job
done". There are so many better options in absolutely every single way that
the only reason I can fathom for one to start something new using it out of
choice is laziness to learn something better.

~~~
weego
If the technical founders are most comfortable with PHP then getting to market
with code you know you can trust can be far more important than picking the
"right" language (and by right I mean a language that startup communities see
as being a proper language to work with).

More props to them for clearly knowing it has its limitations and downsides...
I'd pick a developer who used a language they knew inside and out and were
informed and aware of the downsides of the language over a zealot who thinks
their language of choice works best in every situation (my most common
experience of these types are in the ruby community, by a quirk of
coincidence).

PHP was the language I used to teach myself how to develop for the server-side
when I'd been purely a front end dev many years ago and I still like it
(though granted I like Scala more) because it's always felt like a language
you can sit down and get shit done with quickly and without fuss, and
sometimes that is as important as any other attribute you can attach to any
other language choice.

------
tomlin
As far as PHP frameworks go, I've been using Yii when I do a PHP project and
have found it simple and clean and Yii's documentation is pretty superb.

------
malux85
Yeah I agree with most of the comments here. PHP is a clumsy mess, but it gets
the job done and I am a firm believer in importance of being first to market.

Cite my sources: When I came out of university I had what I thought was a very
good grasp of what software should be, and that "elegant" well written
software would dominate the market. Totally not true. The best example is the
accounting system "Attache" in Australia ... it was the WORST software I have
ever used. They only recently (in the last couple of years) got the ability to
open more than one window at a time _in an mdi windows application_ !! ..
Attache is without a doubt the most successful accounting software in
Australia, despite the fact that it's a dog. Why?? Because they were first to
market. They were there on Day 1 with a product that met the minimum
requirements (e.g. it RAN)

I often see people who underestimate the importance of being first to market
... I truly think it's very important

------
lox
Paraglide looks interesting, although looking at the main class doesn't
inspire me with a lot of confidence:

[https://github.com/bgoldman/Paraglide/blob/master/paraglide....](https://github.com/bgoldman/Paraglide/blob/master/paraglide.php)

The lack of tests somewhat seals the deal.

~~~
bobds
If you want something that's nothing like that, you may enjoy this:

<https://github.com/codeguy/Slim>

~~~
chrisohara
or mine: <https://github.com/chriso/klein.php>

------
paradox95
We use s similar setup to what they are using. We use in house built MVC
framework though. Our Model is a lacking but still works. We do still use
Memcached and I don't see how they can skip that. I don't know what their user
numbers are like for even 1-2k concurrents that many Mongo queries could be
deadly.

~~~
SeoxyS
We're still at a very early stage and the traffic is definitely not what it's
gonna be in the future yet. So far, Mongo has held up beautifully in real-life
situations and benchmarking, and we can deploy new boxes infinitely to beef up
our replica set with Amazon EC2 when we reach our limits—but Memcached is not
out of the picture entirely. So far there's been no need for it (which would
not be the case with MySQL) but if future traffic starts to call for it, we'll
definitely add that to our setup.

~~~
plasma
Note that you can only get up to 7 usable members in a RS (then you need to
shard), see <http://www.mongodb.org/display/DOCS/Replica+Sets+Limits>

I'm curious if you happen to use any monitoring to notice when load on your
mongo servers gets too high (eg is about to start swapping to disk instead of
using RAM etc)?

Cheers

------
theoj
Somewhat related... Derek Sivers attempted to port CD Baby to Ruby on Rails,
but ended up abandoning the port effort after 2 years and switched back to
PHP. See his post on why he came back to PHP and what he learned from Rails
(from 2007):
[http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_swit...](http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html)

~~~
wikyd
Holy lord is that a lot of risk to accumulate doing a full rewrite and
deploying it all at once. I think the hardest part about rewriting an app is
knowing about all the edge cases, kludges, etc. that accumulate over the
years. It makes sense that the person who knows the most about the product and
its dirty secrets would be much more capable of rewriting the app quickly than
a newly hired employee.

As a counterpoint, last year I joined a startup as the first technical member.
I migrated a PHP application written by an inept contractor (terrible DB
layout, SQL queries in the views, most features buggy and incomplete, etc.) to
Rails piece-meal. I had very little experience with Rails or PHP prior to
this, but was able to rewrite the app in the course of a few months, while
adding new features and continuing product development. I simply placed nginx
in front of both the PHP and Rails app servers and rewrote the auth system for
both apps so that cookies/credentials could be shared. Then it was a matter of
migrating sections of the app over one-by-one. There was some hairiness in how
the Rails side linked to non-Rails pages, but that code was gradually replaced
as the rewrite progressed.

Even despite the abominable DB schema from the original PHP app (which, in
fairness, had nothing to do with PHP), Rails was flexible enough to allow me
to override its conventions and map tables to models with joins, etc. Overall,
it was much simpler than I thought it would be and after the rewrite was
complete, it was pretty simple to write migrations to start organizing the DB
schema into something coherent.

------
brianbreslin
somewhat related: anyone know if cakephp is still being actively developed (as
a framework)?

~~~
ccorcoran
I believe it is, I haven't met anyone who's used in a long time though. I
think CodeIgniter is the current hot framework for PHP.

~~~
eropple
CodeIgniter is still PHP4-friendly. It's not "hot" by any means. CakePHP is
still actively developed, but it's pretty miserable. (It's slow, too - so much
so that framework devs usually benchmark against it because it's so reliably
slower-than-everyone-else.)

If you're going to use PHP, I can't really think of a good reason to use
anything other than Symfony2.

~~~
josegonzalez
They're removing PHP4 compatibility in 2.0, which is being more than actively
developed. And it at least gets as much traffic as Symfony does:
<http://www.google.com/trends?q=symfony%2Ccakephp>

As far as not using Symfony 2, I wouldn't use anything not marked as stable in
production. That goes for CakePHP as well.

------
trurl123
_Unfortunately, PHP offers very little in terms of modern and agile MVC
frameworks._ There are many good MVC frameworks for PHP. Look at Zend
Framework (most popular in our region), Kohana, Yii.

------
devinfoley
I've been using Paraglide as well, and it is indeed very cool.

~~~
minouye
Any documentation out there for Paraglide? Did some searching and only pulled
up the GitHub repo.

~~~
bgoldman
Documentation is forthcoming. I didn't expect people to find out about this
yet :) If you follow the project on Github, I'll release updates in the near
future.

------
simonhamp
Brilliant post. These guys are running in a very similar way to us. Some
things in there for us to take hints from though. Will be checking Paraglide
out!

