Re: Newbie question - Disadvantages of java

From: Thomas Gagné (tgagne_at_wide-open-west.com)
Date: 10/26/03


Date: Sat, 25 Oct 2003 18:09:38 -0400

The disadvantages of Java have a lot to do with the (existence)
treatment of primitive types. Null couldn't be an object because
primitives exist, as well as special types, and as was pointed out
earlier, they couldn't be assigned back and forth. Even if Null were a
reference type you wouldn't be allowed to subclass it because TPTB would
have forseen no reason to, and would have declared it final. Or perhaps
for optimization reasons they would have made it final the same way as
String.

Learning Java I think may be especially difficult for COBOL programmers.
 My first class of COBOL programmers wondered why anyone was interested
in bytes, shorts, longs, floats, doubles, etc. What possible business
reason was there to know how many bits were used?

That some variables were treated differently than other variables
(primitives v. reference types) was similarly confusing.

Oddly (or not) they took quite naturally to Java's use of static method
classes to operate on objects rather than imparting functionality to the
objects themselves through instance methods.

Thomas G. Marshall wrote:

>
>Well, I hate the hoops we all have to jump through just to understand it.
>
>Being the person that opened up this pandora's null box, I'd still like to
>know precisely /why/ null need be of type null.
>
>My long winded musings in a prior post aside, just what would have been so
>bad about having null as a literal of object (reference) type, the way true
>and false are of boolean?
>
>

-- 
.tom
remove email address' dashes for replies
opensource middleware at <http://isectd.sourceforge.net>
http://gagne.homedns.org


Relevant Pages

  • Re: Tcl Threads
    ... The next stage is concurrency. ... but mostly to the problem with Java threads. ... The problem with Java is that the real primitives were hidden behind ... mutex/condition vars ...
    (comp.lang.tcl)
  • Re: How to make Forth interesting?
    ... talking about JAVA and talking about Forth and Java. ... "I think it is simply a case that Chuck designed a language to ... If a specialised task works a lot better with some new primitives added ... might be multiple million dollar a year licenses with the cost of the ...
    (comp.lang.forth)
  • Re: Generics are cool
    ... > If Java primitives ... > semantics vs. reference semantics. ... Smalltalk -- is exacerbated by the dynamic nature of its type system making it ... problem with integer overflow (I still can't understand why Java -- supposedly ...
    (comp.lang.java.programmer)
  • Re: programming concepts > specific languages
    ... Then we'd only have references and we could avoid ... The people who say Java passes objects by ... >to learn Rule A for objects and Rule B for primitives (and Rules C-Z ... >explicit pointers. ...
    (comp.programming)
  • Re: Java ready for number crunching?
    ... I don't like boxing and unboxing primitives as there is a space and speed penality (or is there? ... There is generally little to no "penalty" for boxing and unboxing. ... Please let Sun, IBM, NIST, the academy, or any authors of java numerical software know of your insight. ... Just for information, looping over an array of ten million ints and adding them up took me ~30 ms. Doing the same with an array of Integers and using auto-unboxing took me ~55 ms. So, 25 ms to unbox ten million ints, or 2.5 ns to unbox one. ...
    (comp.lang.java.programmer)