PHP or Java? Positives and negatives [closed]

-4

I've been using PHP a while ago, and even using a framework, enjoying Object Orientation I have the perception of seeing the language limitations. For example, if one language supports more connections than the other, or if one is easier to create a system sure.

Situation

Let's say that I own a set of colleges (FI). I have 4 faculties in the 4 corners of SP. I left my bd centralized in a single point and I want to create exclusive pages and access pages for the faculty to mark events, tests, works and etc. For the students, all control of notes, work, and be aware of the events that will occur in the 4 colleges.

    
asked by anonymous 12.09.2014 / 17:50

1 answer

9

That said, for your question if PHP is always faster than Java, the answer is depends. Any comparison between two distinct languages will probably have this answer.

See that your simple test leaves out many things that can directly interfere with the result. The fact that you compared a web application (php running on Apache) with a "standalone" program (Java running directly on jre) and with a C program (compiled, and therefore "naturally" faster). You would have to, at the very least, be comparing JSP running on Tomcat (which is the web face of Java) with PHP to have a test that starts "roughly equivalent".

And that's just the beginning, but I will not go into trouble with your test method. Remember that all of these languages apply optimizations that can make a lot of difference in certain scenarios.

I'll focus on your question of which language is most appropriate, and the answer again is: it depends. I'll assume we're talking about web apps (php, jsp, apache, tomcat).

The question that remains is: why do you need a system that responds so quickly? Why is speed the most important factor for you, at the expense of safety, reliability, robustness, ease of maintenance? A large portion of web applications and websites (99% percent would say, but I have no respect respect) do not need to respond quickly as desktop applications respond, even more if we consider the variation in quality and speed of networks (Broadband, 3G, Fiber).

If you have equivalent knowledge of Java and PHP, then I simply suggest you use both. Nothing prevents you from working with two different languages, especially if you are a freelancer. At the time you do the project analysis, you can decide, based on the scope, what you are going to use. The good thing is that you will always be "training" each of them, which can be useful when any project or job requires any of them specifically.

The biggest though, as far as I know, is a higher consumption of processing and memory in the case of Java (especially if it is web), which makes hosting with Java more expensive, but otherwise I would say that both are equivalent in capabilities and capabilities (considering, of course, differences in syntax, structure, and deployment).

Finally, choose the one that feels good (or both) and be happy. And, when you want, change.

    
12.09.2014 / 17:56