POV-Ray : Newsgroups : povray.general : POV-CSDL (or Java Binding?) : Re: POV-CSDL (or Java Binding?) Server Time
10 Aug 2024 13:22:55 EDT (-0400)
  Re: POV-CSDL (or Java Binding?)  
From: Nieminen Juha
Date: 13 Mar 2000 04:36:29
Message: <38ccb69d@news.povray.org>
Jon A. Cruz <jon### [at] geocitiescom> wrote:
: Guess what? Those are many things that I specifically like about Java, and think
: they help you to write good code:

  I still don't understand how.

:>   - The enum type has been left out:

: This one is maybe so-so. I've seen it used well, but then again I've seen it
: abused.

  This is the typical answer. A feature has been left out because it can be
abused.
  It makes little sense to me. Everything can be abused. I myself have written
so awful java-code that it will probably make you puke. For example one
thing that I really abused were static public class variables. Making a
variable public is a BAD THING. Making it static, and thus more or less is
a WORSE THING. Making tens of them is the WORST THING.
  However public static variables have not been removed from java. Why not?
If they remove something as handy as enums, why they didn't remove that?
Actually static public class variables are a lot more dangerous than enums.
In practice they are global variables.
  It makes no sense to me.

: Overloaded operators make things a lot harder to read

  Again a typical answer. I said "without operator overloading you have to
make explicit method calls, which can make the code very hard to read".
  The fact that you can make an operator to do something that is not
expected is NOT a reason to drop it out. In the exact same way you could
make a method called Multiply(x,y) which calculates the substraction of the
two arguments. If you can abuse method names in this way, should we drop
out method names?

: Bad. Can be very powerfull in the hands of an expert, but then far more damage can
: be done by it's use.

  Again the "let's limit what a professional programmer can do in order to
prevent beginners from doing something wrong" effect.

: Actually, it's quite clear. In Java all primitives are passed by value.

  No, it's not clear. There's nothing in the syntax that helps you see
whether a variable is a reference or not. At least in C++ you immediately
see from the definition of a function that "this parameter is a value and
this parameter is a reference".
  On the other hand, as I said in the previous article, _everything_ in java
are references, so once you get used to that it's not so big deal (the basic
types are passed by value, but you can see it from the type of the parameter).

: Java programming mindset, it's very simple. As opposed to C++ where these would do
: two different things:

:     void F(int x)
:     { x = 5;
:     }

:     void F(int &x)
:     { x = 5;
:     }

  I don't understand what do you mean. It can be quite clearly seen (once
you know the syntax, of course) that the second one changes the original
value while the first one doesn't.
  And by the way, the second one is impossible to do in java.

:>   - No templates:

: Again, a very good thing.

  Why? I said why it's a bad thing. You didn't say why it would be a good
thing.

  I have heard all those typical answers hundreds of times. I would like to
understand them some time.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.