PHP & C/C++
Hello all,
I've been mulling over the PHP vs. C/C++ debate for quite some time and am just looking for some outside thoughts and suggestions on the subject matter.
I'm in the process of building a centralized code library to be used for a potentially large number of web programming projects and I've been trying to decide what would be the best approach as far as programming languages are concerned. PHP, of course, is the language of choice for such things however since the code base can and will vary in complexity depending on our needs, I have been leaning towards the use of C/C++ for the hardcore code and keeping PHP simply for the interface.
PHP is pretty darn robust for what it is these days, and I don't doubt that we can do 100% of our code in PHP, but the problem arises in the fact that PHP is a scripting language. When one gets into trying to create a centralized code base it becomes overly difficult to separate 'essential' code from 'useful' code that you don't necessarily want to automagically make available to every PHP page. C/C++, being compiled, only contains the code it needs to function in the binary, so technically the server has less to worry about when running the code. Also, from an OO point of view, C/C++ is much better at handling objects (although PHP is making leaps and bounds in that department!)
So, I guess my questions are... what do you guys do? :) What works best in real world situations? Is there an advantage in speed and scalability in running just PHP versus both heterogeneously?
Thanks for your input!
I've been mulling over the PHP vs. C/C++ debate for quite some time and am just looking for some outside thoughts and suggestions on the subject matter.
I'm in the process of building a centralized code library to be used for a potentially large number of web programming projects and I've been trying to decide what would be the best approach as far as programming languages are concerned. PHP, of course, is the language of choice for such things however since the code base can and will vary in complexity depending on our needs, I have been leaning towards the use of C/C++ for the hardcore code and keeping PHP simply for the interface.
PHP is pretty darn robust for what it is these days, and I don't doubt that we can do 100% of our code in PHP, but the problem arises in the fact that PHP is a scripting language. When one gets into trying to create a centralized code base it becomes overly difficult to separate 'essential' code from 'useful' code that you don't necessarily want to automagically make available to every PHP page. C/C++, being compiled, only contains the code it needs to function in the binary, so technically the server has less to worry about when running the code. Also, from an OO point of view, C/C++ is much better at handling objects (although PHP is making leaps and bounds in that department!)
So, I guess my questions are... what do you guys do? :) What works best in real world situations? Is there an advantage in speed and scalability in running just PHP versus both heterogeneously?
Thanks for your input!
