PDA

View Full Version : Coding for Front end and Backend



letom
03-28-2013, 07:26 PM
Is it a better idea that developing an apps by doing front end in one language and back end in other language. it have any demerits ?

If not what are benefits for using these two different languages in both end/ or which is best language we can use in back end (asp.net, java, ... ) if my apps is developing with php front end

djr33
03-28-2013, 08:27 PM
It depends on the situation and your goals. On average, I'd say it's best to use the same language so that everything interacts easily. But there may be situations where you need to mix two languages.

An example would be a case where PHP does not have a feature available; you might also run Java or C++ on the server and use PHP to send and receive information back and forth. But that's rare.

The other situation I can think of is for speed-- PHP (and other specialized languages like it) tend to be much slower than low-level languages like C. So if you need it to be very very fast (which is often not a practical concern), then you might want to send some of the most intense processing to a different language. I think I've read that PHP is 1/3 the speed of C. But that will only be a problem if you're doing a LOT of processing-- maybe generating images, or some other very processor-intensive operation.

letom
03-29-2013, 04:18 AM
Thanks can we write c++ extensions in PHP ?

djr33
03-29-2013, 05:19 AM
No. You'd write a separate program in C++ then interact with it by executing system commands, probably with exec().