Hi guys & gals, Have a quick question. We have a new project to consider. It will require coding from scratch. If we have resources equally skilled in PHP and C++. Can anybod tell me why you would not write a web app in C++ but rather in PHP. I'm NOT refering to ease of coding. I'm talking about server/software performance. Would there be any negative issues arising from writing it all in C++ (something like the gcc compiler) Thanks
C++ faster, php can be more manageable. But think on scalability too. I recommend making php extensions to speed-up critical parts.
C++ is a subset of C and can be used to program pretty much anything: operating systems, games, instant messengers, web servers . . . anything! PHP (written in C++) is a serverside language that interprets PHP files to output HTML, interact with the server / database, et cetera so is used to serve dynamic content on a HTTP web server. So, PHP is a specialist language so what it does it does well and you can develop in it quickly. But you probably already knew that. PHP is an interpreted language whereas your C++ would be a compiled executable. In theory, your C++ app would be faster (as long as your code was well-written).
I have a good idea that the C++ would be faster, my only worry is that PHP handles some parts of the http/seb server side better then C++. But I guess if I have a php file for each page, I can have a compiled C++ file for each page too. Any ideas on how the multitasking will be handeled. I know I can call a PHP file simultenously from many diffeent clients. Are there any stricter restrictions on this from the web side.
So long as you get a good web library for C, you shouldn't have a problem. The benefit of PHP over 'raw' C is the fact that you don't have to worry about writing code for session management, cookie management, HTTP headers and so on. All of that stuff is practically transaparent in PHP. If I were you, I'd go with what MrSupplier suggested: PHP, with C-based PHP extensions for your hardcore stuff.
use custom PHP extensions use memcached for keeping app state use nfs or/and mysql cluster for shared storage use php's session_mysql for session persistance among hosts gl!