Discussion: PHP versus JSP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kevin

    Discussion: PHP versus JSP

    Hi! I recently completed a graduate level Java class at a local
    university. For our class project my group built a web-based
    application. Basically, the application would let a manufacturing
    company sell any 'extra' inventory to any authorized user via the
    internet. The users could log in, view the inventory available, and
    make a bid on any of the inventory available. At the end of the day,
    the highest bidder 'wins' that inventory and would receive an email
    saying as much. The customer could then log in again and enter a
    purchase order number and a sales order would be generated.

    This application was pretty basic. We used MySQL, Tomcat, and JSP. I
    especially liked working with JSP (give me JSP over servlet
    programming anyday!). However, a friend of mine said that he would
    rather use PHP for web-based apps and asked me what I thought of
    re-doing the app using PHP. Well, I've never really done a lot with
    PHP (other than go through one of those 'Learn PHP in 24 hours' books)
    so I'm not sure what the advantage or disadvantage would be in doing
    that. I'm not even sure if PHP could be used to acess MySQL or other
    databases (my book didn't get into that).

    This brings me to my question: What are your thoughts on JSP versus
    PHP? I'm not an expert on either one, but I'd be interested in the
    thoughts of others on these two different web development tools.

    Thanks and have a great week!

    Kevin
  • Yoyoma_2

    #2
    Re: Discussion: PHP versus JSP

    Kevin wrote:[color=blue]
    >
    > This brings me to my question: What are your thoughts on JSP versus
    > PHP? I'm not an expert on either one, but I'd be interested in the
    > thoughts of others on these two different web development tools.[/color]

    Well first my thoughts about the PHP + mysql combination. Php and MySql
    are great languages for small web sites, but fail at the enterprise
    level. MySql is not a "true" dbms, it doesn't support sub queries,
    triggers, refferential integrity and stored procedures. The fact that
    it doesn't support triggers can lead to corruption of the database quite
    easily. The fact that it doesn't support stored procs means that on
    your database front end application AND in your web components, you have
    to mantain 2 sets of queries. You can't change the database without
    changing the code, which is a pain. But MySQL is a FAST dbms, it can
    handle 3000 queries in a page without a huge slowdown.

    I used to work for a development firm that did websites for fortune 500
    companies. We used both PhP and J2EE (although we did not use
    Enterprise Java Beans, we developed our own technology).

    Developing a web site in java is a lot more expensive than developing it
    in PHP. I'me not only talking about license costs. A PhP developer can
    be bought for as low as 12$/hr, even if your doing OO in PhP (which is
    the way it should be done to insure portability and scallability).

    Java programmers are usually more expensive to get. Java uses some
    methodology and advanced OO ideas that aren't exactly common to most "i
    learnt how to program at home" programmers. Typically, in Ottawa at
    least, Java programmers were paid 45K to 65K CAD. PhP programmers were
    paid 35K to 55K. It is also a lot harder to find qualified java
    personel, compared to php developers.

    Also java is a purist language, it requires a purist attitude to writing
    code. This means that in your project, two things may happen.
    1) Beautiful, well documented code, well scallable, well designed code
    has been written
    2) The programmer didn't know how to lay it out properly so he "made it
    work", it is now unscallable.

    It's really hit or miss, more so than in other languages i find. Java
    also takes more time to write than php, but it does have a more
    extensive library support so you have to take that into account.

    in either case, on the PHP and the Java side, both should be seperated
    in an MVC type of arrangement (or at least, business logic and
    presentationlog ic). This type of thing will let you build a component
    that can be displayed differently on many pages. Services have to be
    created in any case for general things like logging, database managment,
    component properties etc.

    Hope it helps :)
    [color=blue]
    >
    > Thanks and have a great week!
    >
    > Kevin[/color]

    Comment

    • nos

      #3
      Re: Discussion: PHP versus JSP


      "Kevin" <javarox2000@ho tmail.com> wrote in message
      news:620f860e.0 403290615.3f61f 42@posting.goog le.com...[color=blue]
      > Hi! I recently completed a graduate level Java class at a local
      > university. For our class project my group built a web-based
      > application. Basically, the application would let a manufacturing
      > company sell any 'extra' inventory to any authorized user via the
      > internet. The users could log in, view the inventory available, and
      > make a bid on any of the inventory available. At the end of the day,
      > the highest bidder 'wins' that inventory and would receive an email
      > saying as much. The customer could then log in again and enter a
      > purchase order number and a sales order would be generated.
      >
      > This application was pretty basic. We used MySQL, Tomcat, and JSP. I
      > especially liked working with JSP (give me JSP over servlet
      > programming anyday!). However, a friend of mine said that he would
      > rather use PHP for web-based apps and asked me what I thought of
      > re-doing the app using PHP. Well, I've never really done a lot with
      > PHP (other than go through one of those 'Learn PHP in 24 hours' books)
      > so I'm not sure what the advantage or disadvantage would be in doing
      > that. I'm not even sure if PHP could be used to acess MySQL or other
      > databases (my book didn't get into that).
      >
      > This brings me to my question: What are your thoughts on JSP versus
      > PHP? I'm not an expert on either one, but I'd be interested in the
      > thoughts of others on these two different web development tools.
      >
      > Thanks and have a great week!
      >
      > Kevin[/color]

      I am surprised that they offer java as a graduate level course.
      Kids today learn this in high school.


      Comment

      • Roman

        #4
        Re: Discussion: PHP versus JSP

        You could integrate PHP with PostgreSQL, there is library support for it and
        PstgreSQL supports all the features mentioned above by Yoyoma.
        It is faster to prototype in PHP than java and there is no need for
        complicated context management for the PHP application in comparison to
        Servlets on Tomcat or any other servlet engine. PHP has some other problems
        though, one of which is it is a stateless language, you can not store
        information persistently easily. The only way to achieve that is to use the
        SESSION variable and when your script finished executing there is nothing
        left. This might be important if you want to maintain persistent
        connectivity with some resources or serve out some persistent data, etc.
        This is where Java could be more powerful than PHP, in applications that
        require persistence.

        "nos" <nos@nospam.com > wrote in message
        news:WK4ac.1278 22$1p.1745804@a ttbi_s54...[color=blue]
        >
        > "Kevin" <javarox2000@ho tmail.com> wrote in message
        > news:620f860e.0 403290615.3f61f 42@posting.goog le.com...[color=green]
        > > Hi! I recently completed a graduate level Java class at a local
        > > university. For our class project my group built a web-based
        > > application. Basically, the application would let a manufacturing
        > > company sell any 'extra' inventory to any authorized user via the
        > > internet. The users could log in, view the inventory available, and
        > > make a bid on any of the inventory available. At the end of the day,
        > > the highest bidder 'wins' that inventory and would receive an email
        > > saying as much. The customer could then log in again and enter a
        > > purchase order number and a sales order would be generated.
        > >
        > > This application was pretty basic. We used MySQL, Tomcat, and JSP. I
        > > especially liked working with JSP (give me JSP over servlet
        > > programming anyday!). However, a friend of mine said that he would
        > > rather use PHP for web-based apps and asked me what I thought of
        > > re-doing the app using PHP. Well, I've never really done a lot with
        > > PHP (other than go through one of those 'Learn PHP in 24 hours' books)
        > > so I'm not sure what the advantage or disadvantage would be in doing
        > > that. I'm not even sure if PHP could be used to acess MySQL or other
        > > databases (my book didn't get into that).
        > >
        > > This brings me to my question: What are your thoughts on JSP versus
        > > PHP? I'm not an expert on either one, but I'd be interested in the
        > > thoughts of others on these two different web development tools.
        > >
        > > Thanks and have a great week!
        > >
        > > Kevin[/color]
        >
        > I am surprised that they offer java as a graduate level course.
        > Kids today learn this in high school.
        >
        >[/color]


        Comment

        • Silvio Bierman

          #5
          Re: Discussion: PHP versus JSP


          "Kevin" <javarox2000@ho tmail.com> wrote in message
          news:620f860e.0 403290615.3f61f 42@posting.goog le.com...[color=blue]
          > Hi! I recently completed a graduate level Java class at a local
          > university. For our class project my group built a web-based
          > application. Basically, the application would let a manufacturing
          > company sell any 'extra' inventory to any authorized user via the
          > internet. The users could log in, view the inventory available, and
          > make a bid on any of the inventory available. At the end of the day,
          > the highest bidder 'wins' that inventory and would receive an email
          > saying as much. The customer could then log in again and enter a
          > purchase order number and a sales order would be generated.
          >
          > This application was pretty basic. We used MySQL, Tomcat, and JSP. I
          > especially liked working with JSP (give me JSP over servlet
          > programming anyday!). However, a friend of mine said that he would
          > rather use PHP for web-based apps and asked me what I thought of
          > re-doing the app using PHP. Well, I've never really done a lot with
          > PHP (other than go through one of those 'Learn PHP in 24 hours' books)
          > so I'm not sure what the advantage or disadvantage would be in doing
          > that. I'm not even sure if PHP could be used to acess MySQL or other
          > databases (my book didn't get into that).
          >
          > This brings me to my question: What are your thoughts on JSP versus
          > PHP? I'm not an expert on either one, but I'd be interested in the
          > thoughts of others on these two different web development tools.
          >
          > Thanks and have a great week!
          >
          > Kevin[/color]

          Hello Kevin,

          JSP is an attempt from the Java camp to achieve an ASP/PHP like programming
          level for Java. JSP can be combined with Java classes which enables a more
          structured approach to development making large systems more manageable than
          when working with PHP (although many PHP advocates will contradict this they
          are wrong). PHP adds nothing to what JSP offers. You win some deployment
          ease at the cost of poor libraries, an inferiour programming language and
          reduced scalability.

          Although there is little wrong with programming a dynamic website with
          JSP/ASP/PHP it really scales poorly, even when combined with taglibraries
          and plain Java classes. JSP introduces more development issues than it
          solves (generating HTML or sometimes XML) because of the new principles
          introduced by the combination mechanics. If you want to build a serious
          web-application going the servlet way in combination with some
          template-library or other class library that takes care of the HTML/XML is a
          much more structured and scalable approach.

          When talking about Java Servlets are the real thing and JSP is entry level
          stuff blown up into more than it actually is. Stay pragmatic and rethink
          your strategy for each project. Asking advice is alway a good idea.

          Silvio Bierman


          Comment

          • Kevin

            #6
            Re: Discussion: PHP versus JSP

            javarox2000@hot mail.com (Kevin) wrote in message news:<620f860e. 0403290615.3f61 f42@posting.goo gle.com>...[color=blue]
            > Hi! I recently completed a graduate level Java class at a local
            > university. For our class project my group built a web-based
            > application. Basically, the application would let a manufacturing
            > company sell any 'extra' inventory to any authorized user via the
            > internet...[/color]

            Thanks, everyone, for the great information and comments. You've
            really broadened my horizons, so to speak, and I'm exploring a few
            ideas that I've come up with while reading your comments.

            Again, thank you so much!

            Kevin

            Comment

            • scjp

              #7
              Re: Discussion: PHP versus JSP

              Right... just like they learned VB and C in high-school in the past.

              The fact is: learning a language syntax (Java) means jack.

              USING Java means you understand OO, have read GoF (at least), and probably
              use ANT, JUnit and Log4j. That's not the subject in high-school
              class-rooms.

              Keep the "High-school students use this technology" in the Microsoft forum.
              That's where it belongs.

              "nos" <nos@nospam.com > wrote in message
              news:WK4ac.1278 22$1p.1745804@a ttbi_s54...[color=blue]
              >
              > I am surprised that they offer java as a graduate level course.
              > Kids today learn this in high school.
              >
              >[/color]


              Comment

              Working...