Linked by Thom Holwerda on Tue 12th Oct 2010 21:52 UTC
Java "Oracle and IBM today announced that the companies will collaborate to allow developers and customers to build and innovate based on existing Java investments and the OpenJDK reference implementation. Specifically, the companies will collaborate in the OpenJDK community to develop the leading open source Java environment."
Thread beginning with comment 444891
To read all comments associated with this story, please click here.
Why all the fuss about Java?
by rom508 on Wed 13th Oct 2010 09:17 UTC
rom508
Member since:
2007-04-20

I just don't see what all the fuss is about. Why is everyone so hung up on Java? It's as if Java is the only savior of the world wide web and nothing else could ever replace it.

Some of the reasons for avoiding Java:

1. It's owned by a large corporation, who are more than happy to sue you over patents, etc. when they don't like the competition.

2. The motto of Java - "Write once, run everywhere". Well that's just marketing nonsense, how many times have you seen problems with different JVMs or JDKs?

3. Java is bloated and a memory hog. Well there is no secret about that, if your aim is to develop fast, responsive software, then do not use Java.

These days Java is mainly used for web applications. How many C libraries are out there for developing web applications? Well, hardly any, is that because C is so much inferior to Java? Nonsense, that's because there are too many inferior programmers who think that way. Given the right set of libraries, you could develop a web applications in C in the same time as it would take you with Java.

In case some of you were asleep during your CS lectures, you can develop reusable software in plain C, using object oriented paradigm, just take a look at Solaris or Linux kernels.

Reply Score: -4

RE: Why all the fuss about Java?
by drstorm on Wed 13th Oct 2010 10:03 in reply to "Why all the fuss about Java?"
drstorm Member since:
2009-04-24

In case some of you were asleep during your CS lectures, you can develop reusable software in plain C, using object oriented paradigm.

You were awake when they said that C is not object-oriented, right?

Such arrogance and no knowledge to back it up.

Reply Parent Score: 2

rom508 Member since:
2007-04-20

I have enough knowledge to know that you don't need object-oriented language in order to use objects.

Reply Parent Score: 1

gilboa Member since:
2005-07-06

Such arrogance and no knowledge to back it up.


I'd suggest you take a couple of basic C courses, as your comment was -way- of the mark.

Nothing stops from implementing objects in pure C. Come to think about it, more-or-less any language that support functions, complex storage [e.g. arrays] and callback functions, can implement objects.
Heck, I can even implement objects (including inheritance) in BASH or assembly!

Now, whether -you- consider that true object oriented language (as it requires some additional foot work to implement objects), is irrelevant.

... I'd think twice before calling someone arrogant.
(Keep in mind that I don't really agree with the OP)

- Gilboa

Edited 2010-10-13 13:26 UTC

Reply Parent Score: 6

jessesmith Member since:
2010-03-11

You can still use object oriented concepts in a language which doesn't (strictly speaking) support objects. C is a great example of one of those languages.

If you really want to, you can even create a sort of object in C, using a structure with data and pointers to functions.

Granted, if you're doing so, it's probably best to switch to C++...

Reply Parent Score: 2

Sparrowhawk Member since:
2005-07-11

These days Java is mainly used for web applications.


It was my understanding that most Java development nowadays was middleware, backend and mobile, rather than Web (or desktop for that matter).

Is that not the case? I don't do any Java work any more (not for several years now) so I genuinely don't know.

Reply Parent Score: 2

vodoomoth Member since:
2010-03-30

I think they could be right, based on what I've seen in my professional moments. Web mostly.

Reply Parent Score: 1

ricegf Member since:
2007-04-25

Java is used quite heavily in mobile, yes, both the "official" Java ME and Google's Dalvik variant (which has different but mappable operations in its virtual machine). You might have heard of those newfangled Blackberry and Android phones. ;-)

Java is also used *very* heavily for developing corporate applications, many of which use web clients but many of which use Java fat clients. Either way, the business logic layer is commonly Java. (It's illegitimate child C# is doing pretty well, too, or so I hear.) And, of course as mentioned elsewhere, Java is very popular for server-side web programming.

By the way, Java is back in the top spot this month on the TIOBE Programming Community Index (a ranking of programmer community interest in a language, more or less), after briefly being matched by C. The fastest rising languages, however, are Objective-C (used by Apple's iProducts), Python (my personal favorite), and C# (Steve Ballmer's personal favorite ;-).

Reply Parent Score: 3

Moochman Member since:
2005-07-06

It was my understanding that most Java development nowadays was middleware, backend and mobile, rather than Web (or desktop for that matter).

Is that not the case? I don't do any Java work any more (not for several years now) so I genuinely don't know.


It's not web applications like you are thinking--or at least like I think you are thinking. We're not talking about Java applets like in the old days--we're talking about using Java to serve HTML pages, via Servlets (Java classes which read and write HTML directly to the HTTP socket), JSP (Java Server Pages, think the Java version of PHP--code is embedded directly into pseudo-HTML and interpreted on the fly) and Java Server Faces (component-based UI framework written in XML, with HTML output and plain Java running the show in the background). Also, Google has its own quite popular Java-based platform called GWT (Google Web Toolkit) in which you program using a component-based UI framework, in pure Java, and it gets "compiled" into an HTML/JavaScript web application.

On top of that, as you mention Java is used a lot in middleware; e.g. to support legacy applications--but of course increasingly there is demand for these old applications to get HTML front-ends, enabled by (you guessed it) Java. Java also provides some nice tools (e.g. Apache Axis) for creating and consuming SOAP-based web services (i.e. the defacto means of communicating between applications on the web using XML and HTTP).

(Disclaimer: This is all stuff that .NET does too, just in a monolithic, non-cross-platform, closed manner.)

Now does Java's relationship to the web begin to make sense?

Edited 2010-10-14 21:26 UTC

Reply Parent Score: 3

Kebabbert Member since:
2007-07-27

3. Java is bloated and a memory hog. Well there is no secret about that, if your aim is to develop fast, responsive software, then do not use Java.

These days Java is mainly used for web applications.

Java is extremely fast, and mostly used for backends today. The large servers. Not web anymore. Several of the large Stock Exchange systems are developed in Java. The worlds(?) fastest stock exchange system at NASDAQ is developed in Java.

You obviously dont work with large Enterprise servers with huge demands on performance and latency.

Reply Parent Score: 4

rom508 Member since:
2007-04-20

I obviously (like many others) don't have infinitely deep pockets to run a small cluster of mainframes that Java needs to achieve those levels of performance that you're implying.

But hey, what the hell, these days it's the taxpayer who bails out banks and other financial institutions, no wonder nobody gives a shit how much the IT infrastructure costs (amongst other things...).

Reply Parent Score: 1

rom508 Member since:
2007-04-20

This is a follow up on how fast Java is, compared to C. I did a quick benchmark - create hash table, insert 100K integers, lookup all those integers, then remove them from hash table.

One program is Java, using Java's HashMap. Another program is C, using my own hash table implementation. Both test were run on dual Pentium 3 machine, running NetBSD and native openjdk7-1.7.0.92.20100521nb1. Each program was run several times to warm up CPU cache and get average time values.

Java program time:
time /opt/pkg/java/openjdk7/bin/java -hotspot test
0.58 real 0.39 user 0.14 sys

Here is the time for C program:
p3smp$ time ./test.exe
0.08 real 0.05 user 0.02 sys

C program is about 7 times faster than Java.


Below is the source code for both programs:

import java.util.*;
import java.io.*;

public class test
{

public static void main(String args[])
{
/* Create hash table */
HashMap htab = new HashMap(100000, 0.75f);

/* Create array of integer objects */
Integer[] int_obj = new Integer[100000];

for(int i = 0; i < 100000; i++)
int_obj[i] = new Integer(i);

/* Hash table insert */
for(int i = 0; i < 100000; i++)
{
htab.put(int_obj[i], int_obj[i]);
}

/* Hash table lookup */
for(int i = 0; i < 100000; i++)
{
if(htab.get(int_obj[i]) == null)
{
System.out.println("Error: htab.get() returned null");
}
}

/* Hash table remove */
for(int i = 0; i < 100000; i++)
{
htab.remove(int_obj[i]);
}
}
}


#include "htab.h"
#include <stdlib.h>
#include <stdio.h>

int main(void)
{
int i;
uint32_t *int_obj;
htab_t htab;
union htab_key key;
union htab_val val;

/* Create hash table */
if(htab_init(&htab, 100000, 0, 0, 0.75, HTAB_UINT32_CMP, NULL) != 0)
{
printf("Error: line=%d\n", __LINE__);
exit(1);
}

/* Create array of integers */
if((int_obj = malloc(100000 * sizeof(int))) == NULL)
{
printf("Error: line=%d\n", __LINE__);
exit(1);
}

for(i = 0; i < 100000; i++)
int_obj[i] = i;

/* Hash table insert */
for(i = 0; i < 100000; i++)
{
key.uint32_key = int_obj[i];
val.uint32_val = int_obj[i];

if(htab_insert(htab, &key, key.uint32_key, NULL, &val, 0) != 0)
{
printf("Error: line=%d\n", __LINE__);
exit(1);
}
}

/* Hash table lookup */
for(i = 0; i < 100000; i++)
{
key.uint32_key = int_obj[i];

if(htab_lookup(htab, &key, key.uint32_key, NULL, &val) != 0)
{
printf("Error: line=%d\n", __LINE__);
exit(1);
}
}

/* Hash table remove */
for(i = 0; i < 100000; i++)
{
key.uint32_key = int_obj[i];

if(htab_remove(htab, &key, key.uint32_key, NULL, NULL) != 0)
{
printf("Error: line=%d\n", __LINE__);
exit(1);
}
}
}

Reply Parent Score: 1

StephenBeDoper Member since:
2005-07-06

It's as if Java is the only savior of the world wide web and nothing else could ever replace it.


According to whom? Wired & BYTE Magazine circa 1997?

Reply Parent Score: 2

nt_jerkface Member since:
2009-08-26


Some of the reasons for avoiding Java:


4. Native integration

This is really why so many Windows developers switched to .net. By refusing to use native controls and fonts Java resigned itself to a second class citizen. It took them forever to get Swing looking OK in XP but now with Vista and 7 they are back to the same problem.

5. JRE distribution

They finally cut the JRE down to size but it is too late. Now they have a new problem which is that people do not want to install the JRE unless they have to. Those Java updates are freaking annoying.

Fuck Java, it's a waste of time.

Reply Parent Score: 1

RshPL Member since:
2009-03-13

"
Some of the reasons for avoiding Java:


4. Native integration

This is really why so many Windows developers switched to .net. By refusing to use native controls and fonts Java resigned itself to a second class citizen. It took them forever to get Swing looking OK in XP but now with Vista and 7 they are back to the same problem.
"
And Java GUIs on Linux are still barely responsive and butt ugly

Reply Parent Score: 2