Fog Creek Software
g
Discussion Board




Java—what's the point?

Can someone explain the point of Java to me?

I'm honestly not trying to troll.

What does it do that Perl, Python, or Ruby don't? It's just as slow as them, and they're just as portable as it is, plus, they're open source.

Where in the spectrum of C, .NET, and open source scripting languages like Perl, Python, and Ruby does Java fall? What need does it satisfy?

Mark, the Confused.
Friday, April 2, 2004

Java came before .NET, so why don't you back that a$$ up and ask a more informed question?


Friday, April 2, 2004

Under certian conditions Java is way faster than regular interpreted languages. For some operations its not far from nativly compiled languages.

Eric Debois
Friday, April 2, 2004

It supports true platform independence, provided you do avoid platform specific extensions and  with just in time compiling, it is faster. 

Then it gave you all this, when most Client/Server programmers were using C++.  Making it easy to transition from C++ to JAVA, while eliminating some of the less liked aspects of C++.

Anonanonanon
Friday, April 2, 2004

It's the worlds best programming languge for programming TV set top boxes.

pdq
Friday, April 2, 2004

I've asked myself this same question for a number of years.
Let's just face it, Java is crap.

If I was going to write UI, I would use VB or Python.
If I was going to write a server application I would use C++.

If I was a misguded manager/company owner who believed the amazing amount of hype surrounding Java, I would use Java for all of them. I dont see how having to write something.somethingelse.blah.wrapperobj("Hello World") is productive.
But I guess once it's written it can load like a sack of potatoes falling down the stairs on any platform.

Before you get the knives out, remeber this is my only opinion and it makes no difference to your highly payed Java gig.

The current Java wave is just like the ASP/ADO/Web guru wave of a couple of years ago, where are all those guys now?

Craig
Friday, April 2, 2004

What does Perl, Python, or Ruby do that Java doesn't?

Not nearly as confused as Mark
Friday, April 2, 2004

Visual Basic programmers had long got an inferiority complex. They somehow felt that they were kind of ape like. This is because Microsoft did not trust them with complex system stuff. Java meant that some of those apes could actually say "we evolved". This is because they can type great stuff like

import  blah blah blah and also type semicolons (";")

Never underestimate the power of making men feel like men. Thats the need java fulfills.

K
Friday, April 2, 2004

http://www.manageability.org/manageabilityWiki/WhyJavaIsBetterThanDotNet

genius
Friday, April 2, 2004

You don't see why it is more productive because you are a dumb-ass.  Do you think all the Java programmers are deluding themselves?

"My language is better than yours", "There is no point to your language", "I would choose these tools for this project".  These arguments are stupid and boring.  Almost all software produced, given away, bought or sold, sucks ass in a major way and I see no evidence that any of the popular languages or platforms handicap the process towards either more or less suckiness.

name withheld out of cowardice
Friday, April 2, 2004

Elements forming a good religious meme:

http://www.abarnett.demon.co.uk/atheism/meme.html

Make a religion out of anything!
Friday, April 2, 2004

"Under certian conditions Java is way faster than regular interpreted languages. For some operations its not far from nativly compiled languages."

It might be faster than interpreted languages; it might even be very close to compiled languages BUT it still uses an insane amount of memory.

Almost Anonymous
Friday, April 2, 2004

Why do you care?

son of parnas
Friday, April 2, 2004

So then, Java is a like a Chevy Suburban--big, powerful and bloated, uses a lot of gas, but can haul ass if it needs to?

And all the others are like Chevy Metros then?

Anon-y-mous Cow-ard
Friday, April 2, 2004

Its ok mark, Once you get more experience in the real world you'll see why there are languages like java and C#.

I loved perl and vb before I did java, I thought they were great.  But, you don't see massive systems written in perl. Theres a reason why the majority of big websites are written in java.  The small performance hit it takes over C++ is negated by the fact that for most projects, development time in java is significantly faster.  If you can, of course its better to write something in C++.  But for most large website and server side application, performance isn't as important as development time, readability, and modularity. 

vince
Friday, April 2, 2004

Craig-

We're working on enterprise asp.net apps.  :)

Greg Hurlman
Friday, April 2, 2004

Java certainly has an object fetish -- why can't I do something simple like:
someString = "You are " + years + " old!";
(or like C++: cout << "You are " << years << " old!";)

instead I have to do:
// something like this:
system.out( "You are " + years.ToString( ) + " old!" );

Just do that stupid thing automagically.

MR
Friday, April 2, 2004

Uh, MR, you can do that in java.

blah
Friday, April 2, 2004

OH!  I must be thinking of C#?!

MR
Friday, April 2, 2004

It's the Libraries man, the *LIBRARIES*! ;)

Crimson
Friday, April 2, 2004

Put your question in the perspective of 1995 when it was released.  The hype of "Write Once, Run Anywhere" hooked alot of people.  Pluis it was/is much easier language to learn and become proficent than C/C++.  The whole applet craze got it going.  Back then no one cared if it was open source or not.

Bill Rushmore
Friday, April 2, 2004

Strong typing!  The compiler catches a whole class of bugs that don't show up until runtime in most of those other languages.

Ken Klose
Friday, April 2, 2004

vince,
I have been bouncing around the net for a while.  Most small site I see are PHP. There are a number of Perl based sites such as Slashdot (Slash Engine) and PerlMonks (Everything engine).  A number of Corprate sites are hard figure.  Some are java (.jsp) and some are aspx (dotnet) and some like Joel here uses asp original, but most are hard to tell they just generate html.  I have not seen the numbers lately but I have not seen a huge upswing in servlet based sites.  In other words, where are the numbers?

A Software Build Guy
Friday, April 2, 2004

Greg -

Touche! - I should of guessed :)

Craig
Friday, April 2, 2004

Ken, Python and Ruby (I don't know Perl, so I can't say) _are_ strongly typed languages.  What you are referring to is the dynamic/static typing thingie.

Giovanni Corriga
Friday, April 2, 2004

- large API
- security model which everyone disables but I'm sure someone uses
- semicolons 'n braces
- easier install
- good marketing
- a lot of complementary tools
- loads of docs
- co-opts Python through Jython

My reading of history is that Java was a primary driver of Python, since it surged in a number of new programmers who weren't obsessed with the S&M of C++, or the brevity of C.

Java is in the weird position of being both under- and overrated.

People who like static typing often cringe when Java is brought out as an example, because it does no type inferencing.

http://www.jwz.org/doc/java.html

Tayssir John Gabbour
Friday, April 2, 2004

Actually python is a great example of what I'm talking about.  Create a simple multiplication function:

def multiply(a, b):
    return a * b

Call multiply(4,5) it returns 20, great.  Call multiply("4", 5) and it returns "44444", probably not what you were expecting, and possibly the source of an insidious bug.  Call multiply(4, "5") and your program bombs at an exception when this code gets executed.  Java would have complained to you about this problem during compile, long before you ran it.

In java you would had to specify types for the arguments and return values of the function.  The java compiler would then enforce those types, ala strong typing.

Ken Klose
Friday, April 2, 2004

I've been working at top "Fortune 20" company for a number of years now and Java is one of the few languages/development platforms that natively address working with dozens if not hundreds of other developers around the world. 

For every Java application, you could build the same with another language but considering time, money and  Java is often the better choice. 

What happens when a company has to make MILLION OR BILLION dollar choices about software design and development?  I for one am glad I do not have to make that choice, but I can understand why Java is often considered.  Just pick the right language for the right job and it does not have to be Java.  But the more customers you have to more the choice is not about speed only, scale, manageability and scalability are prime factors.

P.S.  Java Servlets are in more places than you think.  In a correctly built environment that is not using J2EE, Servlets are often hidden from the client view, letting JSPs and HTML pages correctly handle the presentation.

-rln
Friday, April 2, 2004

Ken,

Your definition of strong/weak typing is incorrect. There are actually two axes to measure the "strength" of a type system, not one.

The first is "strong vs. weak." In a strongly typed system, any attempt to operate on a value contrary to it's type will cause an error. A weakly typed system will, on the other hand, happily assume that any value can do anything, and will proceed to do whatever it's told. Python, Eiffel, and Smalltalk are all examples of strongly-typed languages. Tcl, older basics, Perl, and C/C++ when using void *'s are examples of weakly typed language.

The other axis is the "static/dynamic" axis. The strong/weak axis says if an error will be caused. The static/dynamic axis talks about *when* that error will be reported. Static languages report errors at compile time. Dynamic languages report them at run time. Python is a strongly typed, dynamic language. Java is a strongly-typed, mostly static language (I say mostly static because you have to do lots of casting to deal with the Java collection libraries, so those errors aren't caught until runtime). C is actually a fairly weakly typed, completely static language, as the language does effectly no run-time checking at all.

As for your specific Python example, the "*" operator is defined on strings (all sequences, actually) so it's not a type error. Wether the choice of "*" as the sequence repetition operator was a good idea, that's a different discussion.

Chris Tavares
Friday, April 2, 2004

When all is said and done, it's just assembler.  So what's the point of a flame war.

Just dump these stupid high-level languages, and let's go back to PL1.

Capn' Kirk
Friday, April 2, 2004

Chris you are correct about strong vs weak and static vs dynamic.  However the point still holds that for large systems, static typing probably helps with correctness even though it is less flexable than dynamic typing.

MikeMcNertney
Friday, April 2, 2004

I assume that for most people
"Strong Typing"
means
"The static type-checker catches your errors."
and
"Weak Typing"
means
"You can't statically check your program because your
language is pants. Welcome to RunTimeErrorsBurg."

Arguing that Lua or LISP are - according to academia -
"Strongly Typed" misses the point entirely.

Ali
Friday, April 2, 2004

It's not an academic argument; it's a very practical one about the productivity of your programming language. Dynamic languages are more productive than statically typed ones.

The big advantage of statically typed languages are supposedly the error checking at compile time. However, to get that error checking, you pay by putting a lot of extra stuff in your code. Not only do you need to add all the type declarations, but you also now need to spend a lot more time designing type hierarchies and figuring out how to work AROUND the type system to do what you need.

And in the end, what happens? You still need to do thorough unit testing. If you've got to do testing anyway, and you can get done faster without the statically typed languages, why bother with them? They don't really buy you anything but a false sense of security, and they cost a lot in the process.

Now, if you were arguing that statically typed languages can be compiled more efficiently by more naive compilers, that I'd buy.

Chris Tavares
Friday, April 2, 2004

"It's not an academic argument; it's a very practical one about the productivity of your programming language. Dynamic languages are more productive than statically typed ones. ... Now, if you were arguing that statically typed languages can be compiled more efficiently by more naive compilers, that I'd buy."

So you are saying that ML and Algol60 are so much less
productive than B and LISP? No, ML and LISP are more
productive than B and Algol. The difference in power of
representation between the high level languages vs the
low level ones massively outclasses the gain you allege
you'd get from going from dynamic to static. If you allege
that going from LISP to ML makes your programming
slow to a crawl, I don't believe you. Since the basic types
are words, numbers, logic and functions, and they perform
completely different tasks, I just can't see why you would
need to confuse them in a sane design. If I had a type
clash, that would seem to me to be trivially erroneous,
and if I needed to override the type system, that would
seem to me the symptom of a buggy design.

Ali
Friday, April 2, 2004

You know the best answer I've heard to that question so far has to have been "It helps large organizations write spaghetti code."

I have to admit I concur with that point in so many ways ... there are large number of freely available libraries, implementations can be easily hidden to confuse remote programmers, a ridiculous backwards compatibility story (1.0 methods still in the API ?).  I think you would be hard pressed to conceive of a language from scratch that would facilitate the sprawl that Java does.

disclaimer: I write spaghetti code for large organizations ....

John
Friday, April 2, 2004

Dynamic vs Static. Productivity vs execution speed. Compile time errors vs run time errors.  Read what Bruce Eckel has to say:

http://mindview.net/WebLog/log-0052
http://mindview.net/WebLog/log-0053

fool for python
Saturday, April 3, 2004

For me, Java was a big step up from C because of garbage collection and good built-in libraries.

If I was starting a project from scratch today, I'm not sure whether I'd pick Java or Python. Python has a better syntax, and it's definitely better for small projects. With a bare-bones editor, programming Python would make sense.

However, with a good IDE like Eclipse, I can be very productive working on long-term projects in Java. Automatic refactoring and real-time error detection are fantastic features made possible by static typing.

I don't know whether my effectiveness with improve or diminish with a dynamically typed language.

Julian
Saturday, April 3, 2004

What does Java offer?

Hype! Hype! Hype!

During the Internet boom, Sun Microsystems managed to generate a lot of hype around Java, because it could run in the browser.

Duh!
Saturday, April 3, 2004

Most organizations, especially large non-software companies, generally aren't very good at unit testing. They often don't do any formal or automated unit testing at all. For the most part, a class isn't really tested until it is compiled into the testing environment and the users start banging away at it.

Of course, that often means most classes will have some methods that never get executed at all before production, because the users and the data haven't met the specific set of conditions that would cause those methods to get executed.  And then when it is executed for the first time ever in production ...........!!!!!!!!!???????

The point of Java essentially boils down to this:

- Most programmers are minimally competent or incompetent.
- Most IT managers are minimally competent or incompetent.
- Programmer incompetence means we have to disallow certain features that would be powerful for good programmers but destructive with bad programmers, like multiple inheritance.
- IT manager incompetence means that they can't be trusted to institute adequate testing, review, and documentation procedures to ensure that all programmers how to interact with each other's work and enforce the quality of their own work. The larger the organization, the worse those problems become. Therefore, we must build much of this testing and communication into the language via features like compile-time type checking and automatic garbage collection.

And to a large extent, I agree with those points.  Most programmers are buffoons, as well as managers.  As much as I may get occasionally frustrated by the constraints or extra verbosity that Java sometimes involves, I do appreciate the ways in which in it helps to protect me from the incompetence of other programmers.  Other features like Eiffel's design by contract would make it even more useful in that regard; I hope they eventually add it to Java.

I would probably prefer to work in another language if I only worked with code that was written by a small group of very competent programmers, but I work for a Fortune 500 non-tech company so that ain't gonna happen anytime soon.

T. Norman
Saturday, April 3, 2004

"majority of big sites written in Java..."

What a sorry piece of marketing crap.

Egor
Saturday, April 3, 2004

Chris Tavares:

"It's not an academic argument; it's a very practical one about the productivity of your programming language. Dynamic languages are more productive than statically typed ones."

I've tried working in Smalltalk and based on my limited experience I would agree - build times are obviously going to be shorter (because you don't have those interface interdependencies causing rebuilds - you just recompile at the method level). Refactoring is a lot easier, because you can move things around a lot more while still having an executable application (OK, you're working in the image, but I think you know what I mean).

"...Not only do you need to add all the type declarations, but you also now need to spend a lot more time designing type hierarchies and figuring out how to work AROUND the type system to do what you need."

Indeed! :-)

"And in the end, what happens? You still need to do thorough unit testing. If you've got to do testing anyway, and you can get done faster without the statically typed languages, why bother with them?"

OK, this all seems entirely reasonable, but what are your experiences regarding big systems built with dynamic languages? I am thinking of something the size of an ADA or C++ compiler, a shrinkwrapped CAD application, a webserver or a distributed banking system.

Don't get me wrong - I'm enthusiastic about the role of extensive unit testing in software development. I have seen and continue to see that this approach reaps benefits.

The thing is, while all the systems I've worked on using this approach have been large scale, they've mostly been written in C++ - which is (with caveats) strongly typed and statically typechecked.

I have no idea whether things might have worked out differently if we had done things with just as much unit testing but without static typechecking.


A penny for your thoughts: what are your (or anybody else's) experiences with this?

I'm interested in how things work out on the other side of the typechecking fence with big systems.


PS: language zealots - can we all take it as read that C++ does have deliberate holes in its type system and that yes, templates are not as good as parametric polymorphism in all those 'nice' languages out there. No, the run-time semantics aren't closed wrt the language definition either, and metaprogramming is just an accidental byproduct of the language definition.

You could say C++ is a Swiss Army knife language, one that's been left rusting in a dank puddle for a long time - if you don't mind getting your hands dirty, you can get a lot done when you use it.

I don't mind getting my hands a bit dirty for the right money. ;-)

Regards,

Gerard
Saturday, April 3, 2004


I just want to support what 'Vince' has said up there.

I think is the most correct and neutral opinion said.

Jose Juan Montes
Saturday, April 3, 2004

Here's the crap that Vince is spouting: "But for most large website and server side application, performance isn't as important as development time, readability, and modularity. "

Our number one complaint from users about our large web based app is that it's TOO SLOW. We had to shelve plans to migrate to java because tests showed that the parts we had migrated to java were much slower than the old code.

When reading discussions about languages, the java people often claim that performance doesn't matter for web or server based apps. All I can say is - tell it to our users - they think it matters and I value their opinion more than yours.

RB
Saturday, April 3, 2004

I must add a qualifier - you can write java code that performs well. But most java coders seem to roll out the "performance doesn't matter" and proceed to write slow code. That's what I find so annoying and frustrating.

(And I didn't write the slow java code to which I was referring)

RB
Saturday, April 3, 2004

BTW, would anyone care to explain (Vince maybe?) what exactly makes Java score well on development time, readability, and modularity, as far as web development is concerned?

It may do well against C or C++ on some of these points, but how is it more readable, faster to develop, and more "modular" than Perl/PHP/Pyton? My impressions were quite the opposite.

Egor
Saturday, April 3, 2004

"Almost all software produced, given away, bought or sold, sucks ass in a major way and I see no evidence that any of the popular languages or platforms handicap the process towards either more or less suckiness. " -- name withheld

Going in the quote file that is.

Tony Chang
Saturday, April 3, 2004

"Java Servlets are in more places than you think.  ... Servlets are often hidden from the client"

Ah yes, the old standby of  arguing from lack of evidence. Nice example. If correctly done, it's invisible. Thus the fact that you can't find any means they are ubiquitous.

Tony Chang
Saturday, April 3, 2004

95% of the Java detractors are most likely small timers who never worked for true global company with millions of users and offices in hundreds of countries.  When you people join the big leagues, you will develop a more moderate view about Java, balancing the good with the bad.  --nuff said!

From Left Field
Saturday, April 3, 2004

>We had to shelve plans to migrate to java because
> tests showed that the parts we had migrated to
> java were much slower than the old code.

When you profiled your application where was the
time being spent?

son of parnas
Saturday, April 3, 2004

> 95% of the Java detractors are most likely small timers who never worked for true global company with millions of users and offices in hundreds of countries...

Then again, maybe we work for the most successful software company in the world, with more users than anyone else.

Java was a good idea but it suffered from being run by Unix heads, and then becoming popular among the "enterprise" crowd and the consulting firms.

Java is a marvelous revenue generator for outsourcers because you need so many developers for anything, and the program ends up all over the place with dependencies everywhere, so no-one can easily take it over.

Java could have been great. Now it will linger in the enterprise market about five years until .net takes over.

JM
Saturday, April 3, 2004

"Java could have been great. Now it will linger in the enterprise market about five years until .net takes over. "

Please. It's more likely that Java will survive in some form or another as an alternative to Microsoft. Nature abhors a vacuum, just as Microsoft abhors any perception that they lack competition. So it wouldn't surprise me if Microsoft ends up propping Java in some manner just as they did Apple.

The Contrarian
Saturday, April 3, 2004

"When you profiled your application where was the
time being spent?"

Everywhere was slow - it was obvious that performance was not built into the design. The only solution was to throw it away and redesign. We could have refactored everything - but that's the same thing as a rewrite.

Now when we interview java coders who claim that performance doesn't matter for web apps - we reject them because they're not living in the real world. They're living in Java land where people don't care about having to wait for code to execute because every second of waiting can be spent  blissfully thinking about how wonderful java is.

RB
Sunday, April 4, 2004

I used to work for a big Ecom company, you know the kind, pre dot com bust, full of ASP hacks and Java fanatics.
I'll never forget going into the server room one day, the guy I was with pointed at a small cluster of computers and said "These machines handle our web serving", then he turned and pointed at a huge row of rack mounts. "These run our Java apps".

Raw speed counts, Java is by no means slow compaired to say Python. But well written C++ is much faster.
When you are serving perhaps 1000's of clients, little things suddenly take on a new magnitude.

The good thing about Java is the libraries, this is what leads to the "productivity gains" as far as I can tell. The language itself... well it's debatable. The shame is that Java was a great idea, take C++ make it so you can't blow off your leg and supply utilitles which are platform agnostic. But the execution of the idea was crap.

Some good Java applications are starting to appear. Take the Eclipse project for example, great idea, but all but unusable on the Linux platform because it's so damm slow.

Good ideas do not need this level of hype and justification to catch on (C, HTML, SQL, Python) people just start using them because they are good.

Craig
Sunday, April 4, 2004

"Good ideas do not need this level of hype and justification to catch on (C, HTML, SQL, Python) people just start using them because they are good."

If that were true, we'd all be programming in Lisp.

Justin Johnson
Sunday, April 4, 2004

On the Amiga platform right?

Craig
Sunday, April 4, 2004

Now you're getting it.

I think Java's interesting just because of the confusion between the essential benefits and drawbacks of the language, the VM, and the libraries; and the perception of it among developers created by all the hype and marketing and acceptance among the corporate IT world.

But I wasn't kidding about Lisp.  I've never heard anyone serious quibble with the ideas--hell, the ideas behind Lisp are almost universally regarded as correct.  Arguments against Lisp always focus on practical matters: performance, compilers, libraries.  A good idea isn't enough.  Like it or not, Java is where it is because it hit the right middle ground on a bunch of issues at the right time.  It struck the right balance, which is much more important that just being right.

Justin Johnson
Sunday, April 4, 2004

Nobody that knows what they're doing uses Java.

/factually correct troll


Sunday, April 4, 2004

If you flip through a copy of say Lynch's distributed algo book, it becomes easy to want others to use a language like Java, where it takes skill to write a program which is easily r00ted.  Because you don't want a lot of malicious processors in the world.  Err on the side of safety, even when it hurts the ability to write a well-crafted program.  In a number of ways, the VM, hype, language-for-buffoons, etc, makes Java seem the product of a company which at least tried to craft the right product at the right time.  (As Justin above mentioned.)

O'Reilly explains at conferences that the distributed world is different from the desktop.  So I think it requires a different context under which to judge it.

Tayssir John Gabbour
Sunday, April 4, 2004

Get over it already !

James
Monday, April 5, 2004

Java is slow.  Right.  http://www.osnews.com/story.php?news_id=5602

Not that I really follow benchmarks closely.  But that article is about as factually correct as most of the opinions in this thread ;-)

i like i
Monday, April 5, 2004

Read the numbers all you "Java Haters"!  If you exclude trig witch most of you web application developers do not use every day, means Java is on par with C and C++!

anonymous
Monday, April 5, 2004

Well, why are we even having this debate then? Why do Java fans have to do tests showing Java is "nearly" as fast as C++ (if you exclude the UI?) Oops.

Dan
Monday, April 5, 2004

"Never underestimate the power of making men feel like men. Thats the need java fulfills."

You only make a man feel like a man if you give him his own keys to the gun-locker. That's the need that *pointers* fulfil.

Woodentongue
Wednesday, April 7, 2004

Real men program in machine language.

James B.
Wednesday, April 7, 2004

*  Recent Topics

*  Fog Creek Home