# Java vs ASP vs PHP?



## hydroplant

I have a question about web development. I'm taking my second semester web development course which focuses on Dreamweaver for the most part. My question is what to study next - Java, ASP, or PHP. I just want to know which one is the most practical.


----------



## Ninjaboi

It would really depend on what your planning on accomplishing. What are you planning to do? A little information and I can try to recommend the best for you. They are all great for server-side tasks, so that hints as to what your wanting to do.


----------



## hydroplant

Ninjaboi said:


> It would really depend on what your planning on accomplishing. What are you planning to do? A little information and I can try to recommend the best for you. They are all great for server-side tasks, so that hints as to what your wanting to do.


Don't know exactly. I do want to build a site where people can create username+password accounts and upload photos.


----------



## vcjr

well PHP is the most used for what i know. If i'm wrong correct me.  
Java: Easily Scaled easily ported to other systems Performance???

ASP is used widely. 
*Advantages of ASP are:* 

* Script Language-independent: ASP allows to use VBScript, Jscript or Perl ("perlscript") and have it executed on the server without having to learn another scripting language. 
* Utilize COM components from your web server - reuse any functionality built using COM components for your company's software product can on your website through ASP pages. ASP is the connection between the conventional software and the web site. 
* ODBC links to any data source 
* No compilation (saves time, but also a disadvantage) 
* You can use server-side Active components (DLLS). 


*Disadvantages of ASP: * 

* Only on Windows NT / IIS 
* SLOW! Comparable ASP code even on a dual-processor 600 MHz Pentium III server will execute significantly slower than a php solution on a 133 MHz single processor machine. 
* No compilation - but compilers do find errors. Debugging is trial-and-error 




php was developed by a guy named Phil to improve his homepage. Thus the name php 'Phil's HomePage'). php originally based on perl, I believe. Most of php's syntax is borrowed from C, although there are elements borrowed from Perl, C++ and Java as well. 

*Advantages of php: * 

* easy connection to databases, connectivity to most databases including mysql, Oracle, Sybase and ODBC 
* open-source, cross-platform 
* close to the (Unix) operating system, most php functions are thin wrappers to familiar functions - if you are a C programmer, that is. 
* php is available as an Apache module (besides as a CGI binary) - the tight integration makes it execute faster than ASP scripting. 


Now perl - that's the language that I use for my personal sites, such as delphifaq.com and preview.org. 
*Advantages of perl* 

* Freely available for all platforms 
* Can be compiled into a C executable and then it is the fastest language in this article 
* Has been around longer than the competition - therefore hundreds of powerful packages have been developed and are available for free. (Not all of these packages are web-related.) 
* Very high level of functionality can save hundreds of lines of code - example "the ` operator": 
$listing = `dir`; 
This statement executes the dir command ("show directory") on your computer and reads the result into a string identifier $listing. To do this in Java, you need many lines of code. 


*Disadvantages of perl* 

* Very forgiving language - not an "industrial strength language" (as Java is) 
* perl code is possibly hard to maintain later 
* perl often allows several ways to write something and it can be difficult to read someone else's code. "Advanced perl" syntax can be cryptic and unreadable to the beginner. 



At work, I develop mostly with Java (and some perl for throw-away tools). Java can be used both server and client-side. I will concentrate on server-side execution here. 

*Advantages of Java are:* 

* Portable (cross-platform) without recompiling 
* Truly object oriented from ground up - no artificial "object oriented extensions" as in perl 
* Very suitable for advanced development techniques as distributed computing or multithreading 
* Java is a "real" language with type checking etc, highly secure and reliable 
* Can be used both for web development as for 'regular' applications. It is a nice thing to use one language for many or even all tasks. 
* Fast, if you use the right Java environment 


*Disadvantages of Java:* 

* May be a 'too-big' solution for some small sites 



*Conclusion & Recommendation* 

Java is the only language (in this article) that is suitable for large-scale development. I cannot recommend the other 3 languages discussed here for large programs or real time environments but especially perl is good for prototyping, little tools or web development. (Yes, that seems to contradict itself, web sites *can* be large projects). 

If you work in an environment that is tied to Microsoft already then you can take advantage of ASP because it lets you (maybe) reuse existing code from your applications. In this case, you will not really look into getting your web site hosted, but run your own web server on Windows NT. 


If you start fresh or work in a Unix environment and just want to develop a web site, then I would recommend php for smaller projects. Most of the cheap web hosting companies will offer an environment of Apache, php, perl, mysql for under $20 a month. They usually are very good at fine-tuning their machines. 

If you will develop code in a company that also does other application development, then I recommend Java, especially if you can use Java for the application development as well. Basically, the bigger the project, the more suitable is Java - it just scales better if you need more performance. 

If you have a small web site and you use already perl, then there is no reason to convert. I started my site with perl 4 years ago, have worked with the other tools but never re-wrote my whole site. It is not worth it and perl is still a good choice for this kind of job. 

If you want to use ASP for your personal site (I cannot recommend it, I cannot see much of a reason for it), then you have to look for the few, a little more expensive web hosts that proudly advertise "We run all Microsoft Software" - as if that was an advantage, haha. 

From this site 
Okay, hope the pro and cons really helps on what your trying to do and stuff.


----------



## -WOLF-

To put it simply, I'd call PHP for most web-based general coding... Java for perhaps web-based apps and such, and ASP for more serious development


----------



## Ninjaboi

Lol I think WOLF just summed it up there .


----------



## cagrinsoni

I wish I had taken an ASP course in College. If you know any Perl or C then I think PHP is kind of intuitive so it's easier to learn. I think ASP's functions look more object oriented, making it more powerful and scalable (correct me if wrong anyone). I'd be inclined to agree with Wolf!

I'd go with the ASP course. it might be easier to learn PHP and Java on your own later if you don't mind a little self-study.


----------



## jassmine12

I will choose PHP..


----------

