Re: Why do some people hate java?



Jon wrote:
On Mar 12, 6:41 pm, Arne Vajhøj <a...@xxxxxxxxxx> wrote:
I think most agree that multiple inheritance and explicit deallocation
of memory is a bad thing.

C++ templates can do some things that Java generics can not. And
vice versa. They are simply relative different concepts.

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
.



Relevant Pages

  • Re: Whats the best language to learn...
    ... on processors designed to run Lisp and Lisp OSes. ... byte-addressed memory, has native support for variable-sized value types, ... popular OO language, rather a language about like that of Delphi would have ... lisp, java, ruby, etc. ...
    (comp.programming)
  • Re: Forth is broken by culture?
    ... and say exactly how much it costs. ... They're surely not spending very much for that memory, ... the language, in order to save 50 centsper box on memory when you're ... Java makes me cry. ...
    (comp.lang.forth)
  • Re: How come Ada isnt more popular?
    ... bother with *manual* memory management neither. ... Today manual memory management is a low-level thingy that you don't have to care about, unless you *really* want to. ... The problem is that few programs rely on only memory and in a typical case there are lots of resources that are not memory oriented and they have to be managed, ... When GC is a shiny center of the language, those other kinds of resources suffer from not having appropriate support. ...
    (comp.lang.ada)
  • Re: Why do some people hate java?
    ... programming language like Java to exist, or if Java must exists, there's ... The majority of programmers at the time were using C++, ... and other resources that are just as important to ...
    (comp.lang.java.programmer)
  • Re: Popularity of programming languages
    ... and the penalty for it is a language that is generally much ... A much bigger difference than GC between Java and C++ is the object ... Lisp-like uniform object referencing, but manual memory management ... and nobody can do JIT compilation right (probably because the ...
    (comp.lang.lisp)