Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Note: I know that none of you (probably) work for google, so this is a lot more of a conceptual question.

So yeah, i discovered that Gmail uses java and that got me thinking, Why?

I personally never really learned java and am familiar with C/C++, Python, Php e.t.c But what i dont understand is why do some websites use languages such as java? (Note: This is in no way a thread saying one language is better than the other). What i want to know is why do some websites such as Gmail use java and similar languages?What advantages/disadvantages come with using java/similar languages over languages such as php/python/ruby for web development?

Ps: I know that some sites prefer to compile their code for optimization(Like facebook's hiphop)

share|improve this question

closed as not a real question by gnat, MichaelT, Kilian Foth, GlenH7, mattnz May 6 '13 at 0:19

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Actually I've noticed quite a few googlers on SO. –  jozefg May 4 '13 at 12:37
Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask –  gnat May 4 '13 at 14:25
@jozefg Actually very many google searches in programming area leads to SO. –  m3th0dman May 4 '13 at 14:29
@m3th0dman Sorry I was unclear, Googlers as in people who work at google, that's what my friend refers to himself as. –  jozefg May 4 '13 at 16:03
add comment

1 Answer

up vote 6 down vote accepted

Because Java has a pretty good trade-off between productivity and performance; it is somewhere between PHP/Python which are very productive and C/C++ which are very performant.

Gmail is a large site which has lots of clients; here problems of scalability occur and Java is a more scalable language than PHP or Python.

Also Java has some very good frameworks good for web, being the first language used for web programming even if now is used more rarely, only in large systems such as Gmail reigning only in the enterprise area.

Take Twitter as another example; it was initially written in Ruby but has been migrated to Java for scalability.

share|improve this answer
I think Perl was very popular for writing web applications before Java but (even though I am not a Perl expert) I can imagine Perl suffers similar scalability problems as other scripting languages. –  Giorgio May 4 '13 at 12:24
@Giorgio Yes you are right; back then the web server was delegating requests to CGI scrips that delegated the work to executables; most of these scripts were written in Perl. Java was new because it allowed writing web servers that directly generated the response and handled the work and also allowed dynamic content in the browser with the Applets. –  m3th0dman May 4 '13 at 14:27
Well said. You can develop multi-threaded (1 process with multiple threads) apps with Java and you cannot with PHP. For server side development, this allows you to get more utilization out of the server so you need fewer servers to do the same amount of work that you could get when using PHP. –  Glenn May 4 '13 at 19:14
Is this answer conjecture, or based on pubished or first hand knowledge? –  mattnz May 6 '13 at 0:21
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.