Today we are going to talk about PHP and Java and we are going to compare the two. So I have been working with both of these languages for a number of years. Java is a little bit less than PHP but I think they are fairly equal. When does it make a sense to use one on the other this is actually interesting.
Java, when you compare to PHP, is a scripting language which is one of the absolute favorites of everyone. An interesting thing about Java is that its all about types. These types are so important and so nice to work with and people absolutely love them.
PHP is not which is a big minus very big minus. However, Java has a constant thread running, PHP does not. PHP reads from the files which leave with issues of memory leaks are not that common in PHP but they are fairly not common in PHP but they do happen in Java which is a bit of hassle and if you ever have to divide them depending on memory leaks or memory issues, you know probably what I am probably talking about.
There could still have bugs but I think that the types make a lot of a big difference.
Anyhow, so the big plus with Java is that it has the typing and whether or not you consider it the bonus, you have JAR files which are very nice and very easy to deploy on. On the other hand, PHP is not that complicated to deploy either. I just think that Java having a single JAR file or any other file whichever you are building, it’s fairly modules if you learn and I think that’s actually really great.
And then you have PHP when it comes to web applications. I actually prefer here even though you may have given the impression that I am leaning for Java and I absolutely do it, if you are making it in API like you are doing something the banking industry, automotive, anything that is corporate level size API s anything like that you should be doing it in Java, I highly encourage you to do Java.
But if you are making a web page, a webshop anything at all that doesn’t really necessarily doesn’t really need to leverage types in the same way. I think you should do it in PHP because I can only speak from experience and maybe there are other ways of doing it but I really don’t like doing front end work or web server work in Java.
Having to deploy your JAR and so forth it’s maybe I am addicted to working in node.JS and you know its React and web servers and so forth. I really really think at least for my own I like rather than think I really like having a fast iterative process when I am working with web work because when you are doing graphics, the interface does it you know you make a tweak to the CSS and you know you have to wait for a few seconds and you know in some case even minutes depending on your working environment before you see the change and that’s just too slow for me and people go little bit crazy when that happens and that’s a really strong case for PHP. I don’t think I have any language that has the nice when it comes to like just doing iterative changes to the code just refreshing your web pages and you will immediately see the change. That’s a strong case for PHP.
I think PHP is probably one of the nicest languages out there when it comes to doing web development. It’s very difficult for me to speak between node.JS and PHP because if we talk about the development experience, PHP has a really nice development experience.
When we compare these two languages, if you are making corporate stuff when there is accuracy, robusticity, and precision and all that stuff is important, do it in Java. If you are doing a web page something like that do it in PHP, that’s my opinion.