Interview With the Father of Java 107
Eh-Wire writes "The Globe & Mail interviews James Gosling after a keynote talk to Sun developers in his home town of Calgary. His thoughts and comments regarding the 'dead end' oil industry, disconnected Telco strategist, and unleashing 'creative weirdoes' makes for an interesting read." From the article: "Java is evolving. It's sort of embedded in the social experiment that is the Internet. There's been tremendous adoption of Java for building large-scale enterprise apps. It's worked tremendously well there. There's been all kinds of growth lately in cellphones and more and more embedded systems. It's all about making the environment around us more intelligent."
Embedded and Java shouldn't be seen together! (Score:4, Informative)
As an unfortunate software developer on one of Sun's high profile embedded Java projects, OCAP, it irks me to see Java and Embedded listed in the same sentence. I could rant for days on the shortcomings of Java and it's unsuitability for an embedded environment but to name some of my biggest peeves...
1. Any language without unsigned primitive types doesn't belong in embedded land. Embedded systems frequently use unsigned data types. Making me cast up to a bigger primitive size and doing all kinds of bit manipulation gyrations to make unsigned byte data come out right is just wrong.
2. Most embedded implementations don't have room for a JIT compiler. So you end up interpreting everything or precompiling on the way down to the embedded device. Most embedded devices these days still have pretty lame CPUs in them so everything Java is extra extra slow even relative to a desktop counterpart. Especially if you're doing an app with any kind of graphics. As for pre-compiling...this simply isn't an option in some deployments...say OCAP for instance!
3. Many embedded environments use multithreading to process various IO tasks etc. Having what amounts to a critical section for your only means of synchronization (and yea Java 5 tries to solve this but most embedded devices are still back on 1.x implementations of Java) leads to one heck of a deadlock nightmare if you aren't very careful with your design. I need not cite the performance hit here either if you're lazy with your syncs. I also need not mention that the thread scheduling is left unspecified so your app may run OK on one JVM but when you port ot another there's no telling...
4. Java requires a lot of memory if you really want to do something useful. Especially anything graphics related. Most embedded devices don't abound with a ton of memory. As such you end up garbage collecting more and running into problems. Garbage collection can be a costly operation per #2 above. And finding a memory leak in a Java program ain't no picnic either. Especially on an embedded device where you may or matynot be able to get tools in there to see what's going on.
Yeah you can circumvent some issues if you're smart about your design and don't do stupid things but so far most embedded Java developers I've met are imports from desktop/server land and don't think about this stuff so you can imagine the mess you end up with.
Just my two cents...
Java bloat (Score:1, Informative)
Now I know I am going to get mod down, tossed to the wolves, raked over the coals with an inbox full of your nuts -- but here goes because after spending 4 years in Java I now have an opinion.
Java is bloatware and sells hardware. It is great on a desktop as an applet or even as a program running locally where you have 2GB or ram and dual procs to itself. But it has no freaking business on a server. In fact, those writing server apps in Java are plain utterly stupid.
Lets do the math... I have 600 users on a machine using C/C++ based programs, runs quite confortable with a DB and 8GB of RAM.
Now some Java replacement, needs 256MB per user. 256MB * 600 == happy salesperson. T2000 are nice machines, but to run much of that Java code you need many of them.
Ya, I know Java is threaded... how many developers know that and server 600 users out of one instance? Even if it is nicely threaded with apache, if you have to restart the VM for some reason you kick all users off. Messy.
I hear someone say Java runs as fast as C... if I ever meet them I hope they are a betting person.
Java is for those too lazy to learn C/C++.
Unsigned types (Score:2, Informative)
Oh and on this subject, there should be a built-in simple way to convert a byte[] into a plain old hexadecimal string. They have ways of doing pretty much everything, including manipulating zip files, URL-encoding, on and on, but no built-in way to convert a string to hex.
Don't get me wrong, Java really is an excellent language for low-level network coding, and in fact a DNS server I wrote in pure Java was able to out-perform BIND, so it is a great language for this stuff. It's just that I always find myself getting stuck occasionally on bit twiddling.
Anyway, one of things that hurt Java was there was too much hype for running it on the desktop, when the reality was... AWT. At this point, with Java 6, Swing is getting quite excellent. I now think that Java is also a first-class desktop app development language. ----------
Contact management, sales automation, time zones, mobile alerts [contempo.biz]
Um, what? (Score:5, Informative)
I think you probably don't understand how Java server stuff works. Your reference to Apache being part of a Java server deployment shows that. It used to be, back in the old days a few years ago, that people often installed Tomcat and Apache together using a connector. I don't know anyone who still does this. Tomcat 5 servers static content about as fast as Apache.
As for threading: If you're writing a web application, you don't need to write any threads. You need to give a little bit of thought to threads, because your Servlets are objects and they can be used by multiple threads at the same time. Handling this is quite trivial: you just don't touch any instance variables from methods in your servlet. If you don't want to try to figure out threading, that's all you need to know. Tomcat will do all the rest.
Again, I have no clue where you got that 256mb per user, but I'll clarify a few points. In a typical Java Servlet application, which would use Tomcat (or similar) to serve an application where users log in, do stuff, and data are stored in a DB, this is how resource use will work:
I really don't think you understand how these things work, and if you have real-world experience with Java webapps, then the ones you are thinking of were written by clowns.
-----------Contact management, calendar management, sales automation [contempo.biz]