Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33084

Re: Java primitive variable objects

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Java primitive variable objects
Date 2015-11-10 23:30 +0000
Organization A noiseless patient Spider
Message-ID <n1tuml$man$1@dont-email.me> (permalink)
References (8 earlier) <n1rn6o$qov$1@dont-email.me> <n1spqc$30v$1@dont-email.me> <n1t91s$6kk$1@dont-email.me> <n1tin5$8b8$1@dont-email.me> <b7c9d1c7-9899-4f9b-bb9a-991de67dfaed@googlegroups.com>

Show all headers | View raw


On Tue, 10 Nov 2015 13:21:44 -0800, Eric Douglas wrote:

> On Tuesday, November 10, 2015 at 3:08:31 PM UTC-5, Martin Gregorie
> wrote:
>> Thats sort of what I'm saying, I think. Learning the syntax of a
>> language is pretty much rote learning and gets ingrained by repetitive
>> use, while OO techniques are a higher level abstract skill set that can
>> be much more widely employed.
> 
> C++ language was horrible with pointers allowing people to write code
> that didn't do what they expected it to do.  The basic abstract OO
> concept that your variable is now a container which may have other
> variables inside it as well as methods to execute some code should be
> easy.  The trickier part would be recognizing that an instance variable
> is not an object but a pointer to that object, so if you pass an object
> variable into a method you get 2 pointers to the same container, and I
> did write one memory leak myself, keeping links to objects using private
> variables in other objects so I was unable to access the linked objects
> myself and they were unable to be garbage collected.

As I've said, I don't much like C++ for a number of reasons. Finding that

   #include <iostream> 

   int main()
   {
      std::cout << "\nHello, World\n";
   }

compiled to 800kB with Borland C3.0 while

   #include <stdio.h>

   int main(int argc, char **argv)
   {
      printf("Hello, World\n");
   }

was compiled to around 1400 bytes with the same compiler didn't exactly 
impress me. Things have moved on though: the figures for the current GNU 
compiler are much closer at 7684 and 7304 bytes respectively.

However, my main objections are that:

- like Python and Perl, it is only an optionally OO language. By that I
  mean that, as shown above, you can write an entirely non-OO program
  with it, and indeed none of the few large-scale C++ programs I've
  looked at defined any objects at all. They were all nothing but ANSI C
  with  "// comments" instead of "/* comments */" and .cpp source file
  extensions.

- I found its syntax somewhat contrived and over-complex. Java is much
  closer to the minimal approach of C than to the elaboration of C++ and
  is easier to read as a direct consequence.

- Since K&R's "The C Programming Language" is such an excellent book 
  as a teach-yourself C text, of course my first move was to get a copy of
  Stroustrup's "The C++ Programming Language". But I found it very poor: 
  not nearly as well organised, harder to read and with the concepts 
  not nearly as well described and illustrated.
 
Somewhat later I was introduced the Java: granted there doesn't seem to a 
Java book that can match K&R, but I found the one I got (Ivor Horton) to 
be considerably better and much more understandable than Stroustroup and, 
as a major plus, Java didn't introduce all those unmemorable operators.

So, that's my personal take on why I don't like C++ and prefer Java to 
the other OO languages I've looked at. 

Of course, it goes without saying that YMMV.
  

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-02 10:11 -0800
  Re: Java primitive variable objects Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-02 14:15 -0500
    Re: Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-02 13:03 -0800
      Re: Java primitive variable objects Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-02 16:29 -0500
  Re: Java primitive variable objects Jan Burse <janburse@fastmail.fm> - 2015-11-02 22:46 +0100
    Re: Java primitive variable objects Jan Burse <janburse@fastmail.fm> - 2015-11-02 22:52 +0100
    Re: Java primitive variable objects Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-02 17:47 -0500
  Re: Java primitive variable objects Joerg Meier <joergmmeier@arcor.de> - 2015-11-05 22:19 +0100
    Re: Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-05 13:31 -0800
      Re: Java primitive variable objects Arne Vajhøj <arne@vajhoej.dk> - 2015-11-07 22:21 -0500
        Re: Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-09 04:52 -0800
          Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-09 08:54 -0500
            Re: Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-09 07:27 -0800
              Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-09 10:51 -0500
                Re: Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-09 08:28 -0800
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-09 11:57 -0500
                Re: Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-09 10:13 -0800
                Re: Java primitive variable objects Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-09 13:28 -0500
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-09 14:53 -0500
                Re: Java primitive variable objects Nigel Wade <nmw@ion.le.ac.uk> - 2015-11-10 09:27 +0000
                Re: Java primitive variable objects "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2015-11-09 10:44 -0800
                Re: Java primitive variable objects Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-09 18:59 +0000
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-09 15:02 -0500
                Re: Java primitive variable objects Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-09 22:57 +0000
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-09 19:16 -0500
                Re: Java primitive variable objects Arne Vajhøj <arne@vajhoej.dk> - 2015-11-09 20:55 -0500
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-09 22:13 -0500
                Re: Java primitive variable objects Arne Vajhøj <arne@vajhoej.dk> - 2015-11-09 20:40 -0500
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-09 22:23 -0500
          Re: Java primitive variable objects Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-09 14:00 +0000
            Re: Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-09 07:18 -0800
              Re: Java primitive variable objects Arne Vajhøj <arne@vajhoej.dk> - 2015-11-09 20:43 -0500
          Re: Java primitive variable objects Arne Vajhøj <arne@vajhoej.dk> - 2015-11-09 19:38 -0500
            Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-09 20:26 -0500
              Re: Java primitive variable objects Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-10 02:10 +0000
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-09 22:12 -0500
                Re: Java primitive variable objects Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-10 13:01 +0000
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-10 12:23 -0500
                Re: Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-10 10:10 -0800
                Re: Java primitive variable objects Arne Vajhøj <arne@vajhoej.dk> - 2015-11-10 22:08 -0500
                Re: Java primitive variable objects Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-10 20:05 +0000
                Re: Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-10 13:21 -0800
                Re: Java primitive variable objects Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-10 23:30 +0000
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-10 20:58 -0500
                Re: Java primitive variable objects Gene Wirchenko <genew@telus.net> - 2015-11-10 22:30 -0800
                Re: Java primitive variable objects Arne Vajhøj <arne@vajhoej.dk> - 2015-11-10 21:58 -0500
              Re: Java primitive variable objects Arne Vajhøj <arne@vajhoej.dk> - 2015-11-10 21:56 -0500
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-10 22:19 -0500
                Re: Java primitive variable objects Arne Vajhøj <arne@vajhoej.dk> - 2015-11-10 22:42 -0500
                Re: Java primitive variable objects Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-10 23:07 -0500
            Re: Java primitive variable objects Eric Douglas <e.d.programmer@gmail.com> - 2015-11-10 06:06 -0800
  Re: Java primitive variable objects Lew <lewbloch@gmail.com> - 2015-11-16 14:47 -0800

csiph-web