By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

PHP vs JAVA

P: n/a
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!
Jul 16 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Joe
In article <11*************************@posting.google.com> ,
ri*********@icn.siemens.com says...
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!

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
Jul 16 '05 #2

P: n/a
DJ Dev wrote:
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!


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

Jul 16 '05 #3

P: n/a
ri*********@icn.siemens.com (DJ Dev) writes:
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.
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.
Ultimate aim will be to create a web service using WSDL, XML etc.

It's actually more complex than it sounds.


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.
Jul 16 '05 #4

P: n/a

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.


Just out of interest, what would you say these are?
Martin Lucas-Smith www.geog.cam.ac.uk/~mvl22
www.lucas-smith.co.uk

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

& Webmaster, SPRI
Scott Polar Research Institute, University of Cambridge
Jul 16 '05 #5

P: n/a

"Bruce Lewis" <br*****@yahoo.com> wrote in message
news:nm*************@scrubbing-bubbles.mit.edu...
ri*********@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


C/C++ should be ok if coded to be reentrant.
Jul 16 '05 #6

P: n/a
Erwin Moller wrote:
....
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.
Of course, if you follow certain disciplines, you can code pretty complex
sites in PHP, too. Java enforces the discipline. PHP does not.
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.


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:
http://JobMarketIntelligence.com
A database of high-tech firms at your fingertips.

Jul 16 '05 #7

P: n/a
ri*********@icn.siemens.com (DJ Dev) wrote in message
news:<11*************************@posting.google.c om>...

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).


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
Jul 16 '05 #8

P: n/a
Martin Lucas-Smith <mv***@cam.ac.uk> writes:
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.


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


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.

Jul 16 '05 #9

P: n/a
Fred <fr**@jobmarketintelligence.com> wrote in message news:<qyL5b.355531$uu5.69483@sccrnsc04>...
Of course, if you follow certain disciplines, you can code pretty complex
sites in PHP, too. Java enforces the discipline. PHP does not.
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.


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.

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.
Jul 16 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.