Why PHP? A brief history of the resurrection of Button Men Online
For anyone who knows anything about web development, it may seem odd that we are using PHP for our back-end, especially since we made the decision in 2012, when there were many other feasible languages available. Here is the story of how we started out, and how we incidentally ended up being stuck with PHP.
12 Nov 2012
I broached the subject of resurrecting the Button Men Online site on the Buttonmen Site Outage News group, after nine months of downtime of the old site. One of the things that I left open was the choice of programming languages.
13 Nov 2012
After getting a bit of interest, I posted a suggestion on November 13 that we go with Python and PostgreSQL. Brooks chimes in that he is a Zend certified PHP developer, and suggests that Python frameworks may not be as robust as the Apache backend, and that the Apache backend is more widely supported on cloud architecture. He also mentions Pagodabox, which he uses for his PHP projects. Chaos posts that she knows Python best, but is also okay with PHP, and suggests that we use virtual machines hosted by Amazon. Ethan, a web developer, recommends that we use Python and Django, or possibly Ruby/Rails. He also mentions that shared hosting should also be available for Python, but that the general concept may be problematic because the software that we require may not be installed. He also likes the idea of being able to host the whole site locally on developers' laptops, instead of having everything always centralised.
14 Nov 2012
I set up a developer forum so that we could have a place for developers to discuss things that wouldn't necessarily interest others on the outage group.
15 Nov 2012
On the initial wrangling thread, I invited the developers to argue for their choice of PHP or Python, and I posted a poll. The poll came out (in my mind) overwhelmingly in favour of Python.
18 Nov 2012
Brooks asks whether there is anyone who is prepared to act as lead programmer who can teach/mentor others in Python and Django.
22 Nov 2012
Ethan agrees with Brooks that there needs to be a lead programmer (but not him!), and further suggests that the lead programmer should have their choice of programming language. Brooks responds and volunteers himself to be the lead, but states that he has no experience with Django. He also states that neither PHP nor Python has any major failings that the other language doesn't have.
23 Nov 2012
I ask if anyone is prepared to step up and be a lead programmer who knows something about Django.
27 Nov 2012
No one posts, so Brooks gets the role as lead programmer, and we end up going with PHP. The following developers start working on BM Online: Chaos, Julian, and me, with Brooks in an advisory role. Chaos is in charge of infrastructure including Pagodabox and Github, while Julian and I split the back-end programming role.
29 Nov 2012
We start using Github.
13 Dec 2012
Brooks makes his last commit on Github.
6 Jan 2013
Brooks posts that he's busy and getting busier, and we never hear from him again. We forge ahead without a lead programmer.
15 Jan 2013
We have basic classes for representing dice, buttons, and games, but as yet no interface to the database and no front-end. Julian moves to working on the back-end full time, and I shift to working on the front-end.
5 Mar 2013
Julian commits his back-end code, and lets us know that he's getting busy so he'll need to drop out for the moment. That puts me as default lead programmer, and Chaos as responsible for the database and the infrastructure.
6 Mar 2013
We have a basic front-end, using faked responses from the back-end.
26 Sep 2013
Chaos takes over responsibility for the front-end, meaning that I can focus on the back-end and interface code.
25 Nov 2013
We declare BM Online alpha open for closed testing.
With the benefit of hindsight, I'm pretty sure that I should have made a far stronger case to go with Python instead of PHP, had I known what I know now. Now, I have no qualms in strongly disagreeing with Brooks' comment on Nov 22 that Python and PHP are basically just as good as each other. From my experience with PHP, the thing that has caused me the most grief is that PHP really doesn't do object orientation properly, especially in the way that it handles encapsulation (e.g., public/protected property visibility). Also, it doesn't really handle iterating over empty arrays in a sensible way. Add to that the fact that I feel extremely uncomfortable with the errors that can be introduced due to the fact that PHP has loose typing, and you'll see that I think that Python has many substantial advantages over PHP.
We did consider switching over from PHP to Python early in 2013, but I didn't want to disrupt the forward momentum that we had established, and we still had the somewhat ominous thing that is Django hanging over our heads. Plus, I had already invested a lot of my brain power into learning PHP from scratch and getting comfortable with it. I think that continuing in PHP was the right call at the time, and we did somehow manage to get a functional alpha site up and running in a year.
That doesn't stop me wondering what the backend would look like if we had started with Python.
12 Nov 2012
I broached the subject of resurrecting the Button Men Online site on the Buttonmen Site Outage News group, after nine months of downtime of the old site. One of the things that I left open was the choice of programming languages.
13 Nov 2012
After getting a bit of interest, I posted a suggestion on November 13 that we go with Python and PostgreSQL. Brooks chimes in that he is a Zend certified PHP developer, and suggests that Python frameworks may not be as robust as the Apache backend, and that the Apache backend is more widely supported on cloud architecture. He also mentions Pagodabox, which he uses for his PHP projects. Chaos posts that she knows Python best, but is also okay with PHP, and suggests that we use virtual machines hosted by Amazon. Ethan, a web developer, recommends that we use Python and Django, or possibly Ruby/Rails. He also mentions that shared hosting should also be available for Python, but that the general concept may be problematic because the software that we require may not be installed. He also likes the idea of being able to host the whole site locally on developers' laptops, instead of having everything always centralised.
14 Nov 2012
I set up a developer forum so that we could have a place for developers to discuss things that wouldn't necessarily interest others on the outage group.
15 Nov 2012
On the initial wrangling thread, I invited the developers to argue for their choice of PHP or Python, and I posted a poll. The poll came out (in my mind) overwhelmingly in favour of Python.
18 Nov 2012
Brooks asks whether there is anyone who is prepared to act as lead programmer who can teach/mentor others in Python and Django.
22 Nov 2012
Ethan agrees with Brooks that there needs to be a lead programmer (but not him!), and further suggests that the lead programmer should have their choice of programming language. Brooks responds and volunteers himself to be the lead, but states that he has no experience with Django. He also states that neither PHP nor Python has any major failings that the other language doesn't have.
23 Nov 2012
I ask if anyone is prepared to step up and be a lead programmer who knows something about Django.
27 Nov 2012
No one posts, so Brooks gets the role as lead programmer, and we end up going with PHP. The following developers start working on BM Online: Chaos, Julian, and me, with Brooks in an advisory role. Chaos is in charge of infrastructure including Pagodabox and Github, while Julian and I split the back-end programming role.
29 Nov 2012
We start using Github.
13 Dec 2012
Brooks makes his last commit on Github.
6 Jan 2013
Brooks posts that he's busy and getting busier, and we never hear from him again. We forge ahead without a lead programmer.
15 Jan 2013
We have basic classes for representing dice, buttons, and games, but as yet no interface to the database and no front-end. Julian moves to working on the back-end full time, and I shift to working on the front-end.
5 Mar 2013
Julian commits his back-end code, and lets us know that he's getting busy so he'll need to drop out for the moment. That puts me as default lead programmer, and Chaos as responsible for the database and the infrastructure.
6 Mar 2013
We have a basic front-end, using faked responses from the back-end.
26 Sep 2013
Chaos takes over responsibility for the front-end, meaning that I can focus on the back-end and interface code.
25 Nov 2013
We declare BM Online alpha open for closed testing.
With the benefit of hindsight, I'm pretty sure that I should have made a far stronger case to go with Python instead of PHP, had I known what I know now. Now, I have no qualms in strongly disagreeing with Brooks' comment on Nov 22 that Python and PHP are basically just as good as each other. From my experience with PHP, the thing that has caused me the most grief is that PHP really doesn't do object orientation properly, especially in the way that it handles encapsulation (e.g., public/protected property visibility). Also, it doesn't really handle iterating over empty arrays in a sensible way. Add to that the fact that I feel extremely uncomfortable with the errors that can be introduced due to the fact that PHP has loose typing, and you'll see that I think that Python has many substantial advantages over PHP.
We did consider switching over from PHP to Python early in 2013, but I didn't want to disrupt the forward momentum that we had established, and we still had the somewhat ominous thing that is Django hanging over our heads. Plus, I had already invested a lot of my brain power into learning PHP from scratch and getting comfortable with it. I think that continuing in PHP was the right call at the time, and we did somehow manage to get a functional alpha site up and running in a year.
That doesn't stop me wondering what the backend would look like if we had started with Python.
Comments
Post a Comment