Why do some people hate java?

D

David Segall

Jason Cavett said:
I could be wrong, but I'm not sure emacs even is technically an IDE
anymore than notepad would be considered an IDE. I *think* (again,
could be wrong) it's just an editor. Granted, it's a beefy editor,
but it's still an editor.
Just an editor! Shame on you. It even includes a psychologist. Now you
can talk to Eliza on the Internet
<http://abcguides.com/abcsoftware/eliza_js_frame.htm> but then you
needed one at hand to console you after trying to read someone else's
Lisp.
 
O

Oliver Wong

samir said:
Tell me what you linke about an IDE and I'll tell you you'll find it
in emacs :)

I like how Eclipse has a "Package Explorer" view which lets you
navigate into JARs, and shows you wish files are synced with CVS/SVN and
which are not, and which files have compiler errors and which have
warnings via icons and clever use of fonts. I.e. I don't have to mouse
over, or click on any particular class or anything like that. How do I get
emacs configured to do the same?

- Oliver
 
C

Chris Smith

samir said:
It's true that Python isn't as popular as Java, but it isn't also a
programming language that "no body uses". See this:

http://www.dedasys.com/articles/language_popularity.html

I think that Python is "the next leap" to the future: Simplicity,
freedom and some black magic when needed.

Beware of language attachment. You seem to have a case of it. Python
is a nice, well-designed language, to be sure. That doesn't really
promote it above dozens of other languages that are all rarely used.
"Not as popular as Java" is understating reality by about an order of
magnitude.

What really got me, though, was "the next leap" to the future. I still
haven't seen one significant language feature that originated in Python.
Can you enlighten me?
 
C

Chris Smith

samir said:
Outdated computers are the real test for any os/programming language.

I suppose that are the real test of something -- namely, how well the OS
or language works on an outdated computer. Extrapolating from that to
modern computers, though, is dangerous. Performance does not always
scale linearly with the resources of the computer in use, and poor
performance on an old machine does not indicate that the same will be
true of a newer machine. In the case of Java, this is significant
because the virtual machine is optimized for environments with an excess
of RAM. In other cases, problems arise because the nature of many
applications is that there are thresholds beyond which performance
degradation is noticable. If you cross that threshold, performance may
appear bad even though it will be unnoticable on a more realistic
system.
Not that bad :). I think that multiple inheritance just requires more
attention and discipline when programming.

Okay. There really isn't a standard by which one can judge these
things. I rarely, if ever, have found multiple inheritance advantageous
in languages like C++ that I've used which allow it. Because OO is a
fundemantally pragmatic idea which lacks a formal basis, though, I can't
extrapolate from that to a "good/bad" idea classification. It is a
trade-off; YMMV.
Explicit deallocation of
memory is good thing to keep track of your RAM usage. I think that
most people will say that garbage collection is a bad thing when it
comes to a language like Java.

This one I have more trouble with. You may be right that "most" people
will say garbage collection is bad, or you may not. I suspect not. In
either case, though, most people who know what they are talking about
will agree that garbage collection is quite a good idea for an
application programming language (which I assume is what you mean by a
language "like Java"?)
Like operator overloading?

Well, no. The two things are pretty well orthogonal. Templates and
operator overloading are only tangentially relevant to each other even
in C++, and only because they must coexist. A language could have one
or the other without both.
 
O

Oliver Wong

samir said:
Outdated computers are the real test for any os/programming language.

Your usage of the definite article "the" implies that you think there
is only one test for an OS or programming language. Perhaps you meant
"Outdated computers are a real test for any OS/programming language"?
Another good test for OS and programming languages are "ultra-modern super
computers": Is this particular OS/programming language able to squeeze out
every ounce of power that the computer provides, or is some of the power
wasted. Yet another "test" might be "the average desktop computer the
target customer base is running": does our OS/programming language bring
the greatest amount of utility to the greatest amount of people, etc.
Not that bad :).

Well, "bad" is an emotionally loaded word. I'd prefer to phrase it as
"If the solution to your problem is most elegantly expressed in terms of
multiple inheritance and explicit deallocation of memory, then you
probably shouldn't be using Java to solve that particular problem".
I think that multiple inheritance just requires more
attention and discipline when programming. Explicit deallocation of
memory is good thing to keep track of your RAM usage.

One nice thing about Java (from the perspective of large corporations)
is that it discourages a "lone cowboy" mentality. This is the mentality
where a programmer enjoys a good mental challenge, and thus seeks out
languages which "requires more attention and discipline when programming".
Corporations would rather programmers just do what they're told, solve
their programming problems in the traditional way, such that if one
programmer gets laid off, it's easy to replace them with another
programmer, as everyone does everything the same way, and it's easy(ier)
to pick up someone else's code if they didn't do anything unexpected or
"clever".
I think that
most people will say that garbage collection is a bad thing when it
comes to a language like Java.

Well, there are people who think all garbage collection is bad,
regardless of which language's implementation we're talking about, and
there are people who think all garbage collection is good, regardless of
which language's implementation we're talking about. The interesting case
(to me, anyway) would be people who generally think garbage collection is
good, but didn't like the way it got implemented in Java. Do any such
people exist? Would you still think that these category of people consist
of the majority?
Like operator overloading?

I think C++ templates and C++ operator overloading are pretty
orthogonal topics.

- Oliver
 
O

Oliver Wong

You can do things with multiple inheritance that can never be done
with interface implementations alone.

Nitpick, but I think Alan Turing would disagree with you
(http://en.wikipedia.org/wiki/Turing_completeness)
Can it be abused? probably.
Does that justify tieing the programmers hands? I would argue no.

And I would argue "yes". It sounds like you're looking at this from a
programmer's perspective (and more precisely, from a highly skilled
programmer's perspective): "I can handle C++, so there's no reason for a
programming language like Java to exist, or if Java must exists, there's
no reason for it to be significantly different from C++."

To determine whether something justifies a decision-maker's decision,
look at it from the perspective of that decision-maker: Sun wanted to
invent a new programming language that would be attractive to large
corporations. The majority of programmers at the time were using C++, so
its Java was designed with similar syntax. But Java didn't need to stay
backwards compatible with C, so they removed a lot of parts that the
Java-team deemed "ugly" which was probably mainly maintained in C++
primarily for backwards compatibility.

Additionally, the majority of programmers are mediocre (this is by
definition of "mediocre"), and were abusing and getting entangled in some
of C++ more complex parts. For these particular programmers, things like
multiple-inheritance and other such features were doing more harm than
good, and so they were removed from Java.

By creating and releasing Java, Sun did not "tie" anyone's hands in
the sense of "removing" freedom: Any programmers who want to program in
C++ are free to do so. Instead, they added freedom by allowing programmers
who wish to guarantee that they'll never need to encounter MI and other
"complex" features of C++ the freedom to do so: by working in Java
instead.
I find the statement that "explicit deallocation of memory is a bad
thing" to be laughable. It assumes that this MUST be done in C++. If
you look at boost shared pointers and the like you will find that
object lifetime can be easily and, more importantly, predictably
managed. There seems to be an implicit assumption in this rather
childish statement in the philosophy behind garbage collection that
memory is the only resource that must be managed. File handles,
network connections, and other resources that are just as important to
manage and must be managed in a way that is more deterministic that
can be done by relying on garbage collection. The result is that, if
you code a class in Java that must manage one of these resources, you
MUST add methods that allow the application to release the resources
and these MUST be invoked before the object reference is released.
So, tell me again, how does GC really help here??

It doesn't. GC is meant for collecting memory-related garbage. For
things like network connections and file handles, you'd typically use a
"try-finally" statement to release those resources.
There are a lot of other "features" of Java that I find very
annoying. Examples:

- Lack of unsigned integer types. I realise that, with two's
complement math, the math operations between signed and unsigned is
all the same. However, I find that not being able to use unsigned
types results in sign extension in places where it was not expected
and results in casting/masking operations that only serve to clutter
the source code.

Has anyone really ever claimed this to be a "feature"? I've
occasionally been annoyed by this: You know, like when I'm writing a game,
and I want some data type which can store a bit more than than an int, but
not so much as a long, and which will never store a negative value (e.g.
damage done via some weapon), and I feel a bit bad about wasting 4 extra
bytes for using a long instead of an int. But really, it's a minor
annoyance, and it usually passes as soon as I move onto other parts of the
game.
- Bit shift operations only appear to be implemented for the integer
type. The result: if I am trying to do bit shifts on something
smaller than an integer, a byte or a short, the arguments are promoted
to integers and the reslt of the shift is an integer. So in order to
assign that back to something smaller than an integer, guess what,
yet another cast is needed.

This may be just a personal perception, but bit-shifting seems like
one of those things which is getting "close to the hardware", and thus
outside of Java's area of expertise. The only domain I know where bit
shifting is really used from a mathematical (and thus machine-agnostic)
perspective is cryptography, but I understand that Sun provides some
library support for common cryptographic manipulations, so you shouldn't
need to write your own anyway. I've never used this part of the library,
so I don't know how good, or complete, they are, but from limited study of
cryptography I've done, the number one lesson seems to be that you
probably shouldn't be writing your own cryptography routines anyway.
Me measure of the "goodness" of a language or its implementation is
whether I can accomplish the task I set out to do without having to
fight the language or its implementation. If I have to litter my code
with cluttering casts simply to produce the correct results or to
satisfy the childish demands of the compiler, I become annoyed. If
the language hobbles me rather than allowing me to express the design,
it also becomes annoying. My personal experience is that Java is
cluttered with these kind of issues.

I think a lot of people feel the same way about, e.g., C++ or Python,
or any other language. E.g. "Memory leak? Can't the
compiler/runtime-environment/whatever see when I'm done with this object
and get rid of it for me?" or "I have to play with the whitespace to make
the compiler happy? WTF?"

I think until AI has progressed enough that natural language is viable
as a programming language, then for every programming language, there will
exist someone out there who will consider some of the "demands" of the
compiler to be "childish". Perhaps even with natural language, there will
be some pointy haired boss out there who will still consider certain
demands (e.g. logical self-consistency) to be childish. "Do what I mean,
not what I say".
It seems to be easy to forget that there are reasons for writing
programs that transcend the language or environment in which it is
developed. At the end of the day, my value to my employer is not in
the languages I have mastered but in what I can produce that can solve
our customers problems and/or needs. To the extent that the language
and/or environment facilitates that, it becomes a valuable tool. To
the extent that the language/environment fetters that, it becomes less
valuable and less likely to be chosen as a tool. No language or
environment is free from blemish. Java has some real advantages but I
do not consider it a replacement for what can be done in C++.

And I don't think Java is marketed as a replacement for what *can* be
done in C++. There are some programs which are better expressed in C++,
and there are some programs that are better expressed in Java. Because of
momentum, there are a bunch of programs which would be better expressed in
Java, but which are currently being written in C++. It's *those* programs
for which Java is being pushed as a replacement for C++.

- Oliver
 
J

Jason Cavett

Tell me what you like about psychotherapy and I'll tell you you'll find it in
emacs.

Heck, I'll tell you right now:
M-x doctor

-- Lew

Hahaha. That's awesome.

:: will never understand the craziness of Emacs ::
 
C

Chris Smith

Hi Oliver,

Oliver Wong said:
One nice thing about Java (from the perspective of large corporations)
is that it discourages a "lone cowboy" mentality. This is the mentality
where a programmer enjoys a good mental challenge, and thus seeks out
languages which "requires more attention and discipline when programming".
Corporations would rather programmers just do what they're told, solve
their programming problems in the traditional way, such that if one
programmer gets laid off, it's easy to replace them with another
programmer, as everyone does everything the same way, and it's easy(ier)
to pick up someone else's code if they didn't do anything unexpected or
"clever".

There are, of course, both good and bad sides to this. On the one hand,
intentionally obfuscated or unnecessarily complex code isn't good for
anyone. On the other hand, there are problems which are just plain
harder to express in some languages than others. Many times, it's not
easy to tell the difference between the two until you're familiar with
all of the options. So I'm not sure I'd entirely classify rooting out
this "lone cowboy" mentality as a benefit. The risk, of course, is that
companies will cease to derive any benefit whatsoever from hiring good
people.

As in all things, a balance must be found.
 
J

Jason Cavett

can I pause my java program, look at the stacks of my threads (and
navigate through all objects), if something is not running as I want
then change my code while the program is paused, and go on with the
program with the changed code in place?

Do this with a gui?
And with less than 10 clicks?
possible with emacs? I don't know it ... never used emacs for coding
can I pause my java program, look at the stacks of my threads (and
navigate through all objects), if something is not running as I want
then change my code while the program is paused, and go on with the
program with the changed code in place?

Yeah...the Eclipse debugger is pretty freaken amazing. I know there
are other debuggers out there, but, having been spoiled by Eclipse's
debugger, I still haven't found one I like better. I can't imagine
programming without it.
 
O

Oliver Wong

Joshua Cranmer said:
Looking at the CS curriculum and experiences of fellow students, I can
see why some people hate Java: it's the first programming language they
use and it's difficult for them. I know many people who get caught up in
one annoying bug and then blast it as a reason that XYZ "sucks" or
"should rot in hell", etc.

Indeed. I don't know why they don't start off with BASIC or some other
simple, imperitive language instead (simply don't teach the students the
"GOTO" keyword, and if they discover it via some other source, explain to
them that it's simply there for historical reasons, and its usage is
generally discouraged, and from then on, penalize their grades if it
starts showing up in their code).

The imperivative paradigm is much easier to grasp than the OO one, and
starting off with a language like Java means you either have to jump right
into OO, thus confusing them terribly, or do a lot of handwaving over the
keywords "public", "class" and "static", and say "Just always make
everything public, and make all your methods static. I'll tell you why
next year. Oh, and the compiler will let you declare variables inside of
classes, but outside of methods. But don't do that. Always declare all
your variables inside of methods. At least until next year, where you'll
then need to start declaring variables in the classes, and outside of the
methods, and they won't be static anymore."

Python (since it was mentioned several times in this thread) might
actually be a good beginner language, though I've never met anyone whose
first language was Python, so I don't have any empirical evidence to back
up this theory.

[...]
Python -- the most backwards-incompatible language I've ever seen.

While I've written a few simple apps in Python (mainly for coursework
back when I was in university), I don't know enough Python to have ever
encountered any backwards-incompatibility issues. Have you also used PHP?
Is it worse than the PHP4-PHP5 transition?

- Oliver
 
C

Chris Uppal

samir said:
Tell me what you linke about an IDE and I'll tell you you'll find it
in emacs :)

;-)

Which prompts the question -- why is there no email client plug-in for Eclipse
yet ? Or maybe there is, and I've missed it...

-- chris
 
C

Chris Uppal

Jason said:
Yeah...the Eclipse debugger is pretty freaken amazing. I know there
are other debuggers out there, but, having been spoiled by Eclipse's
debugger, I still haven't found one I like better. I can't imagine
programming without it.

Just curious, but what is it that strikes you as so special about the Eclipse
debugger ?

I may be missing a lot, since it just seems like a bog-standard debugger to me.

-- chris
 
C

Chris Uppal

Oliver said:
- Lack of unsigned integer types. [...]

[...]. But really, it's a minor
annoyance, and it usually passes as soon as I move onto other parts of the
game.

It's a Very Major Annoyance if you have to interwork with systems which use
unsigned quantities (and such systems are anything but rare). For instance if
you are reading 32-bit unsigned data from a database or from a network
connection then you have problems (solvable, but significant). If you are
reading 64-bit unsigned data from a database or network connection then you
have /serious/ semantic problems to surmount.

This may be just a personal perception, but bit-shifting seems like
one of those things which is getting "close to the hardware", and thus
outside of Java's area of expertise. The only domain I know where bit
shifting is really used from a mathematical (and thus machine-agnostic)
perspective is cryptography,

And anything which has to interwork with external systems (which includes file
formats of all kinds as well as networking). And anything which needs
bit-level operations to express designs that /could/ be done another way, but
which -- for reasons of clarity[*] or efficiency -- should not be. In fact,
there are lots of applications for bit-twiddling...

But then, I find Java's bit-twiddling operations perfectly adequate, in both
theory and practise -- they are after all identical to what C or C++ provide
(with a few caveats about sign extension).

(The only real annoyance is that >> performs sign-extension, which is daft.)

[...] or "I have to play with the whitespace to make
the compiler happy? WTF?"

Presumably people who like white-space-is-significant languages (I have mixed
feelings myself) would say "I have to play with { and } to make the compiler
happy? WTF?" ;-)

-- chris


[*] It's instructive to read first Sedgewick's "Algorithms" book, which used
Pascal, and his criticisms of Pascal for a lack of bit-twiddling operations
which makes some important algorithms harder to think about or express in code.
 
J

Joshua Cranmer

samir said:
Tell me what you linke about an IDE and I'll tell you you'll find it
in emacs :)
Not hitting Ctrl, Alt, or Meta. I prefer vim, but I'll quickly duck out
before I start another vim/emacs war (there's already the seeds of an
eclipse/net-beans). Then again, this is from the person who uses at
least four different IDEs on a regular basis.
 
J

Joshua Cranmer

Oliver said:
Indeed. I don't know why they don't start off with BASIC or some other
simple, imperitive language instead (simply don't teach the students the
"GOTO" keyword, and if they discover it via some other source, explain to
them that it's simply there for historical reasons, and its usage is
generally discouraged, and from then on, penalize their grades if it
starts showing up in their code).

Discouraged thanks to Dijkstra's "Goto considered harmful in
programming." I'd be fine with BASIC, except it has 1-based arrays,
which means making BASIC/C, BASIC/Java, etc. jumps difficult. I can't
think of any suitable language that looks reasonably like C, C++, Java,
Python, etc. is imperative, and yet shields users from caveats (like C
pointers: not a good thing for CS neophytes).
The imperivative paradigm is much easier to grasp than the OO one, and
starting off with a language like Java means you either have to jump right
into OO, thus confusing them terribly, or do a lot of handwaving over the
keywords "public", "class" and "static", and say "Just always make
everything public, and make all your methods static. I'll tell you why
next year. Oh, and the compiler will let you declare variables inside of
classes, but outside of methods. But don't do that. Always declare all
your variables inside of methods. At least until next year, where you'll
then need to start declaring variables in the classes, and outside of the
methods, and they won't be static anymore."

Python (since it was mentioned several times in this thread) might
actually be a good beginner language, though I've never met anyone whose
first language was Python, so I don't have any empirical evidence to back
up this theory.

[...]
Python -- the most backwards-incompatible language I've ever seen.

While I've written a few simple apps in Python (mainly for coursework
back when I was in university), I don't know enough Python to have ever
encountered any backwards-incompatibility issues. Have you also used PHP?
Is it worse than the PHP4-PHP5 transition?
I've used PHP4 and PHP5, so I know about that horrible transition, but
my point about Python is that the bytecode is incompatible, not the
actual language itself, so that opens up more cans of worms. It took
around an hour trying to figure out why a code compiled with python-2.3
wouldn't run with code written with python-2.4 (at the time, we didn't
know there was a difference). The error's didn't help, although I must
admit, PHP's was pretty bad. At the very least, version 4 to version 5
implies a big change, where as 2.3 to 2.4 doesn't imply such a change.

On second thought, gcc changed its name-mangling scheme too at some
point, so maybe I should retract my statement in favor of clarity. Ah well.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

samir said:
Outdated computers are the real test for any os/programming language.

Depends on your criteria.

I find small foot print programs interesting from an engineering
point of view.

But from a practical/commercial point of view it is not
relevant (unless for special cases like embedded).

DOS 6.22 and TP 7 is not that useful today.
Not that bad :). I think that multiple inheritance just requires more
attention and discipline when programming. Explicit deallocation of
memory is good thing to keep track of your RAM usage. I think that
most people will say that garbage collection is a bad thing when it
comes to a language like Java.

No. Look at all the new languages. GC is becoming the standard.

The reason is that it is unrealistic to expect all programmers
to have "attention and discipline".
Like operator overloading?

That is not really related to templates.

But that is another feature C++ has that Java does not.

It would be relative risk free to add it to Java. But not that
important in my opinion.

Of course << and >> should not be used for IO.

Arne
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Jon said:
You can do things with multiple inheritance that can never be done
with interface implementations alone. Can it be abused? probably.
Does that justify tieing the programmers hands? I would argue no.

It is very rare to have a need for multiple inheritance.

And experience has shown that the dreaded DoD often surprise
people.
I find the statement that "explicit deallocation of memory is a bad
thing" to be laughable. It assumes that this MUST be done in C++. If
you look at boost shared pointers and the like you will find that
object lifetime can be easily and, more importantly, predictably
managed. There seems to be an implicit assumption in this rather
childish statement in the philosophy behind garbage collection that
memory is the only resource that must be managed. File handles,
network connections, and other resources that are just as important to
manage and must be managed in a way that is more deterministic that
can be done by relying on garbage collection. The result is that, if
you code a class in Java that must manage one of these resources, you
MUST add methods that allow the application to release the resources
and these MUST be invoked before the object reference is released.
So, tell me again, how does GC really help here??

You can write "laughable" and "childish" many times.

Any programmer who have worked with C/C++ knows that
there is almost always some team member than manage
to create a memory leak.

If all programmers were perfect, then GC would not be necessary.
Except for the improved performance.

That automatic memory release does not handle non memory resources
is not particular surprising. But I can not see it as an argument
against automatic memory release.
- Lack of unsigned integer types. I realise that, with two's
complement math, the math operations between signed and unsigned is
all the same. However, I find that not being able to use unsigned
types results in sign extension in places where it was not expected
and results in casting/masking operations that only serve to clutter
the source code.

- Bit shift operations only appear to be implemented for the integer
type. The result: if I am trying to do bit shifts on something
smaller than an integer, a byte or a short, the arguments are promoted
to integers and the reslt of the shift is an integer. So in order to
assign that back to something smaller than an integer, guess what,
yet another cast is needed.

I agree.
It seems to be easy to forget that there are reasons for writing
programs that transcend the language or environment in which it is
developed. At the end of the day, my value to my employer is not in
the languages I have mastered but in what I can produce that can solve
our customers problems and/or needs. To the extent that the language
and/or environment facilitates that, it becomes a valuable tool. To
the extent that the language/environment fetters that, it becomes less
valuable and less likely to be chosen as a tool. No language or
environment is free from blemish. Java has some real advantages but I
do not consider it a replacement for what can be done in C++.

C/C++ will exist for many years. It may outlive Java and C#. But the
usage of C/C++ is going to be small in the next decade compared
with Java, C# and the scripting languages.

Arne
 
L

Lew

Chris said:
... I'm not sure I'd entirely classify rooting out
this "lone cowboy" mentality as a benefit. The risk, of course, is that
companies will cease to derive any benefit whatsoever from hiring good
people.

That risk, expressed as an absolute like that, is zero. The risk can be seen
from two sides: the companies' and the programmers'. Generally the risk is
that the benefit to companies / opportunity for programmers in good
programming will diminish, but it really cannot cease to exist altogether.

Programming is a wicked problem - its solutions depend on problem inputs and
chaotic variables like the character of the developers. It seems not even
theoretically possible to automate programming completely because it involves
mapping mental or linguistic spaces to computer actions. It seems not even
theoretically possible to simplify programming to where managers can do it,
because the social nature of the problems to solve changes. Evolution in the
understanding of software development affects the solution spaces, as do the
capabilities of the electronic systems involved. Emergent phenomena from the
growth of high-speed wide-area networks and other technologies affect the space.

The risk is that the space of problems that require wicked awesome developers
will shrink, relegating most to day-laborer tasks. The likelihood is that
there will always be significant demand for truly skilled programmers to keep
pushing the envelope.

As was pointed out by a writer I cannot recall to attribute (may have been in
/Programming Pearls/ or /The Psychology of the Computer Programmer/), when
considering the fate of systems to automate programming, consider also who is
developing those systems.

-- Lew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top