Exploring this one was interesting. I am a JSP developer by practice and have a very short experience with PHP. The question is: While choosing a language/platform to build web applications what is a good choice - PHP or JSP:
Here are my two cents:
Market availability of resources:
One can find many PHP developers (esp in European Market), and probably more JSP developers in Indian market. The reason is simple - PHP is quick to learn and the stack of technology is not big as it is in JSP. Most of European universities have PHP as opposed to JSP in Computer science curriculum. However JSP/J2EE developers are paid more anywhere one goes. Why is this so: One would like to say that JSP/J2EE makes for a better enterprise application. That brings me to next important point to consider:
Requirements:
Requirements are key, in deciding what technology stack to use. However this is easier said than done for two reasons. The people from whom the requirements are going to come would most likely now know of any technology. Secondly, the requirements will keep evolving - an application which was meant for 10 users should now suddenly scale up for 200 users. The pace of new requirements will increase, and it will be expected of the development team to deliver new requirements fast and furious. However there shall be attrition in the team, and therefore a piece of code which was crystal clear earlier will now take a longer time to chnage.
If the requirement is a lightweight application with minimal database interaction and minimal transactional handling then PHP is the way to go. However one has to be careful in developing PHP pages - they should not grow monolithic to the point to 'I do not want to work on that feature'. There should be good separation by means of classes.
If one can afford a little luxury in terms of development time, then JSP is a good way to go, since one can easily use a MVC design pattern and keep the facets in the n tier application separate and easy to change later.
The common practice with PHP is to put all of your scripts in the page level. The common practice with JSP is to have a Controller or Servlet do most of the work, and use the JSP to simply render the data. Though you can write scriptlets in JSP, it is generally frowned upon and people will make fun of you if you do it. The other thing about JSP, very few people use it exclusively. JSPs are generally used as part of a larger framework (Struts/Spring/JSF/etc).
No comments:
Post a Comment