Why do you use PHP?

My nephew asked me ‘why do you use PHP’? Only one of my nephews can ask such a question, the other one is playing ice hockey in US and has no more interest in programming than the rest of the Clan. On Christmas Eve we all met for Christmas dinner, (the other nephew participated via Skype). Why PHP?

Year 2000 I was back working for Atlas Copco. Up until then I had only used SAS Institute software in Windows and Unix environments (I was a mainframe guy at heart still am if the truth should be told). I done some Bourne shell scripting and some Windows bat files and a bit of C and Java but nothing serious. At the time I was about to create a Business Intelligence system, I had lots of business people crying for better reports, but no one (top management) was willing to pay for a top notch SAS Institute BI system. I decided to go the other way, instead of spending big bugs I decided to go for a minimal budget, just for fun if nothing else.
I started with a scrapped PC where I installed a Mandrake Linux and Mysql. Since I had written the Mainframe ERP system myself I had no problem extracting the marketing and production figures the business people wanted to analyse. But how the ---- should I get the data into the MySql database? I needed a language with a MySql interface where I could express some rudimentary logic like signal if data loading into MySql failed.
I needed a simple language with a low step-in threshold, I didn’t have the time to learn enough C or Linux shell scripting, When I looked around I came up with two candidates Perl and PHP. I been playing with Perl but PHP was new to me. Perl was the obvious choice, I knew the language, it was mature and well suited for the task, PHP vs 4 beta was a primitive language for (simple) web server scripting a very awkward choice for what I had in mind. But PHP was new and unknown to me I just could not resist to try it out and I have a taste for betas, try out new functionality is fun. When the other kids on the block come screaming ‘look what I have done!’ I enjoy saying ‘I did it years ago’, it boosts my ego. And I like to go my own way. The BI system I created was against every IT policy the company had, I could not do it according to the company rules, either this new system or the old paper reports the users did not want. After some years my initial very simple PHP script had evolved into a new language ITL. So here I am year 2015 with a language of my own for a BI system based on PHP running on Linux. PHP has evolved and today it is a mature and in many ways a good language, it is hard to dynamically execute code, parallel execution is a bit odd and I do not know if asynchronous I/O can be done, but otherwise pretty much anything can be done with a simple hilevel syntax.
I would not do systems programming in PHP, for that I would use C,  assembler or the D language which I find very interesting.

Would I use PHP if I start all over again with my BI system? No there are new fresh languages out there waiting to be explored. Recently I have used Node.js, but Python or Perl6 is probably the language I would go for.
If I would do something in the area of Enterprise Integration an area I have taken an interest in lately, I would start with Erlang OTP, if I only could get my head around Erlang, the language seems to be made for guys smarter than me.

I have never regretted my choice of PHP, the language has evolved nicely and has an interesting future with new projects like Hack, the next version of PHP itself seems to be almost revolutionary in terms of performance. For each version PHP looks more and more like the scripting language next door, a bit boring maybe but it is good for the programming community and the world.

No comments:

Post a Comment