PHP vs JAVA

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

    PHP vs JAVA

    Hi All,

    I have to build a web application for my project. This web application
    will be basically calling some functions written in C/C++.
    Basically, the process involves getting user input file, passing the
    file information to the C/C++ function, Getting the result from C/C++
    function etc.
    Ultimate aim will be to create a web service using WSDL, XML etc.

    It's actually more complex than it sounds.
    My question is that which language should I choose - PHP or Java(JSP &
    Servlets).
    I have a bit of learning curve for Java stuff though.
    Can anybody tell me which is the right way for me to go?
    Thanks!
  • Joe

    #2
    Re: PHP vs JAVA

    In article <1169423e.03090 31559.27de85c@p osting.google.c om>,
    ricky.arora@icn .siemens.com says...
    [color=blue]
    > It's actually more complex than it sounds.
    > My question is that which language should I choose - PHP or Java(JSP &
    > Servlets).
    > I have a bit of learning curve for Java stuff though.
    > Can anybody tell me which is the right way for me to go?
    > Thanks!
    >[/color]


    From what it sounds like, if PHP has less of a learning curve for you,
    I'd go with PHP.






    --
    "It is impossible to be unjust or unfair to the rich and powerful"
    -- Harry Britt

    Comment

    • Erwin Moller

      #3
      Re: PHP vs JAVA

      DJ Dev wrote:
      [color=blue]
      > Hi All,
      >
      > I have to build a web application for my project. This web application
      > will be basically calling some functions written in C/C++.
      > Basically, the process involves getting user input file, passing the
      > file information to the C/C++ function, Getting the result from C/C++
      > function etc.
      > Ultimate aim will be to create a web service using WSDL, XML etc.
      >
      > It's actually more complex than it sounds.
      > My question is that which language should I choose - PHP or Java(JSP &
      > Servlets).
      > I have a bit of learning curve for Java stuff though.
      > Can anybody tell me which is the right way for me to go?
      > Thanks![/color]

      Hi DJ,

      I only code Java and PHP. (and some ASP, but I don't want to talk about
      that)
      My general advise would be: If you want a simple quick start, use PHP, no
      question about it.

      PHP is intiutive and give quick results, where Java needs a few months of
      works before you get right on the track and made the mistakes you should
      make before becoming a good Java-programmer.
      J2EE is a lot more complicated and harder to learn than PHP.
      BUT... If you expect your application to grow, and become really complex,
      Java will be a better choice.

      By the description you give I would say: PHP.
      PHP can handle your 'systemcalls' to C and can handle XML.

      And PHP is getting more mature every release (dooh), they now have libaries
      (PEAR) and such, making PHP a safe bet for the future too for you.

      But I must say: I like Java more. :-)
      Matter of taste, I guess.

      Hope this helps. :-/

      Regards,
      Erwin

      Comment

      • Bruce Lewis

        #4
        Re: PHP vs JAVA

        ricky.arora@icn .siemens.com (DJ Dev) writes:
        [color=blue]
        > Basically, the process involves getting user input file, passing the
        > file information to the C/C++ function, Getting the result from C/C++
        > function etc.[/color]

        Two points for PHP: File upload comes standard with PHP. With Java you
        need to go out and get a file upload servlet. For the C/C++ interface,
        I don't know how it works in PHP, but it has to be better than JNI.
        [color=blue]
        > Ultimate aim will be to create a web service using WSDL, XML etc.
        >
        > It's actually more complex than it sounds.[/color]

        Only danger, then, is whether the C/C++ functions are safe to call from
        multiple processes at the same time (or multiple threads in the case of
        Apache 2).

        If you've learned C, you should have no trouble with PHP. The things
        that make PHP hard for newbies are a subset of the things that make C
        hard for newbies.

        Comment

        • Martin Lucas-Smith

          #5
          Re: PHP vs JAVA


          [color=blue]
          > If you've learned C, you should have no trouble with PHP. The things
          > that make PHP hard for newbies are a subset of the things that make C
          > hard for newbies.[/color]

          Just out of interest, what would you say these are?


          Martin Lucas-Smith www.geog.cam.ac.uk/~mvl22


          Senior Computing Technician (Web Technician)
          Department of Geography, University of Cambridge (01223 3)33390

          & Webmaster, SPRI
          Scott Polar Research Institute, University of Cambridge


          Comment

          • Phil...

            #6
            Re: PHP vs JAVA


            "Bruce Lewis" <brlspam@yahoo. com> wrote in message
            news:nm9oey0d6f 0.fsf@scrubbing-bubbles.mit.edu ...[color=blue]
            > ricky.arora@icn .siemens.com (DJ Dev) writes:
            > snip
            > Only danger, then, is whether the C/C++ functions are safe to call from
            > multiple processes at the same time (or multiple threads in the case of
            > Apache 2).
            > snip[/color]

            C/C++ should be ok if coded to be reentrant.


            Comment

            • Fred

              #7
              Re: PHP vs JAVA

              Erwin Moller wrote:
              ....[color=blue]
              > I only code Java and PHP. (and some ASP, but I don't want to talk about
              > that)
              > My general advise would be: If you want a simple quick start, use PHP, no
              > question about it.
              >
              > PHP is intiutive and give quick results, where Java needs a few months of
              > works before you get right on the track and made the mistakes you should
              > make before becoming a good Java-programmer.
              > J2EE is a lot more complicated and harder to learn than PHP.
              > BUT... If you expect your application to grow, and become really complex,
              > Java will be a better choice.[/color]

              Of course, if you follow certain disciplines, you can code pretty complex
              sites in PHP, too. Java enforces the discipline. PHP does not.
              [color=blue]
              > By the description you give I would say: PHP.
              > PHP can handle your 'systemcalls' to C and can handle XML.
              >
              > And PHP is getting more mature every release (dooh), they now have
              > libaries (PEAR) and such, making PHP a safe bet for the future too for
              > you.
              >
              > But I must say: I like Java more. :-)
              > Matter of taste, I guess.[/color]

              It's a matter of the right tool for the job. I find PHP more natural for web
              development than Java. I would say if you are in an enviroment where you
              have a sizable team of developers, web slingers, and the like where work
              must be divided up, then Java/JSP/Struts is the way to go. If you are a
              small team (or sole player), then PHP is definitely better. And there are
              PHP libraries which will allow you to do the equivalent of JSP.

              One of the big wins for me with PHP is the near-seamless way session
              tracking is implemented. It simply does not care whether or not cookies are
              enabled on the client. Simple and painless.

              Also, serialization of PHP objects is MUCH easier to deal with than
              serialization of Java objects. PHP objects are serialized to strings,
              making them eaiser to stuff into a database, etc. And I don't have the mark
              the object as 'serializable' ahead of time as you do with Java.

              On my next project I will be using PHP, Java, and Python, exploiting each
              for its strengths. PHP to deliver dynamic web content, Java for interactive
              applets that can't be done with PHP, and Python to do batch processing on
              the back-end database. Each language doing what it does best.

              -Fred

              --
              Shameless plug:

              A database of high-tech firms at your fingertips.

              Comment

              • Nikolai Chuvakhin

                #8
                Re: PHP vs JAVA

                ricky.arora@icn .siemens.com (DJ Dev) wrote in message
                news:<1169423e. 0309031559.27de 85c@posting.goo gle.com>...[color=blue]
                >
                > I have to build a web application for my project. This web application
                > will be basically calling some functions written in C/C++.
                > Basically, the process involves getting user input file, passing the
                > file information to the C/C++ function, Getting the result from C/C++
                > function etc.
                > Ultimate aim will be to create a web service using WSDL, XML etc.
                >
                > It's actually more complex than it sounds.
                > My question is that which language should I choose - PHP or Java
                > (JSP & Servlets).[/color]

                Why can't you just write the whole thing in C/C++? All you need
                to figure out is how to get inputs via HTTP.

                Also, if your ultimate goal is to create Web services, why don't
                you take a look at readily available libraries for creating Web
                services? PHP has NuSOAP, other languages have to have similar
                things...

                Cheers,
                NC

                Comment

                • Bruce Lewis

                  #9
                  Re: PHP vs JAVA

                  Martin Lucas-Smith <mvl22@cam.ac.u k> writes:
                  [color=blue][color=green]
                  > > If you've learned C, you should have no trouble with PHP. The things
                  > > that make PHP hard for newbies are a subset of the things that make C
                  > > hard for newbies.[/color]
                  >
                  > Just out of interest, what would you say these are?[/color]

                  Syntax errors due to missing semicolons; = vs ==; expecting an error to
                  be thrown rather than knowing they need to check a return value. I even
                  saw an error that was due to using | instead of ||. Just follow this
                  newsgroup and you'll see plenty.

                  Comment

                  • Dai Ichi

                    #10
                    Re: PHP vs JAVA

                    Fred <fred@jobmarket intelligence.co m> wrote in message news:<qyL5b.355 531$uu5.69483@s ccrnsc04>...
                    [color=blue]
                    > Of course, if you follow certain disciplines, you can code pretty complex
                    > sites in PHP, too. Java enforces the discipline. PHP does not.
                    >[color=green]
                    > > By the description you give I would say: PHP.
                    > > PHP can handle your 'systemcalls' to C and can handle XML.
                    > >
                    > > And PHP is getting more mature every release (dooh), they now have
                    > > libaries (PEAR) and such, making PHP a safe bet for the future too for
                    > > you.
                    > >
                    > > But I must say: I like Java more. :-)
                    > > Matter of taste, I guess.[/color]
                    >
                    > It's a matter of the right tool for the job. I find PHP more natural for web
                    > development than Java. I would say if you are in an enviroment where you
                    > have a sizable team of developers, web slingers, and the like where work
                    > must be divided up, then Java/JSP/Struts is the way to go. If you are a
                    > small team (or sole player), then PHP is definitely better. And there are
                    > PHP libraries which will allow you to do the equivalent of JSP.[/color]


                    What a woos. :) I too program PHP and Java. I prefer Java (in the
                    form of JSP) to PHP any day of the week. Don't know Java? Learn it.
                    It makes you a better web developer in the long run IMO.

                    PHP is just fine too. But "easy" doesn't cut it for me... Java is (as
                    you've said) a much longer-term (career-wise) solution. Learning Java
                    gives you a foundation for writing desktop applications, server
                    applications, mobile phone applications, web applications, etc. too...
                    it's a far better multi-purpose tool for your resume toolkit than PHP
                    is.

                    Comment

                    Working...