Why use Java
1) Cross platform
Perl, PHP, Python, Java, Tk/TCL are all cross platform languages.
Despite Microsoft pretending the opposite, C# (and whole .NET/IL stack) is NOT cross platform dur to some core libraries which only exists on Microsoft windows
2) Helps keeping the program clean
No multiple inheritance, no pointers and some other java's features help you to NOT do spaghetti code.
Some say that python does the same because it forces you to properly indent code... which is plainly non-sense. A simple missing tab may be an algorithmic error without triggering a syntax error (unlike C/C++/Perl/Java/PHP/... with their { } pairs)
Using implementation instead of multiple inheritance give you ONE axis to follow to find inherited functions (and no problem of function defined in multiple parent classes)
No pointers means no tricky pointer arithmetic, the first cause of error in C/C++
Exception mechanism force you to explicitely manage all exception returned (either using try/catch or returning it to caller function)
Javadoc *should* help you create a proper class documentation (well, L2J don't have any javadoc) which is an important reference document when other people join the project (DOxygen allow the same under many other langages like C/C++/PHP/Perl/...)
3) Slow startup but runs quite fast.
The impression that Java is slow comes from the startup which takes some time. But a server should (nearly) never restart so that is a one time problem...
Once Java is running, it's quite fast. Some big profile web sites use JSP and Java servlets.
4) Safe language
Java runs in a virtual machine. You may create security profiles and such to further restrict what the program can do, the JAR file can be signed,...
I don't know how it'll be going, but during SUN time (before buyout by Oracle), security in JVM has always be the uppermost priority, before bells and whistles (unlike some other software companies)
5) freely available
Some langages require a rather expensive developping environment that most people don't have available (Windev anyone ?), Java developper kit is free.
Java vs other languages
C/C++ :
lots of portability problems for the network access... Many libraries may come to your help and offset that problem.
Pointers are a real nightmare... and lead to many errors (and remote exploits)
PERL :
PERL is great... but you'll have some trouble finding people who can do good programming in PERL... Also, it's a rather difficult to learn langage (with lots of implicit variable magic and such)
PHP :
while it's well used on the web, it's nearly never used for stand alone applications. It's quite simple to use but I doubt it'll behave well for a crowded server... although it should be possible to do it.
C# :
Basically, it's nothing other than a bastardized Java which lose it's cross-platform aspect.
Python :
Python is easy to program, and easy to make obscure errors that will take hours to find...
Code: Select all
if (a==b) : if (c==d) : f1() f2() if (a==b) : if (c==d) : f1() f2()
Both snippets are valid and won't trigger the syntax analyser... first call the 2 functions if a=B AND c=d. second call the first function if a=b and c=d then the second if a=b. Only difference is A WHITE SPACE !!!
there are other problems with python, but this one is the more serious for any project which will lead to big and complex code.