POV-Ray : Newsgroups : povray.off-topic : Java Server Time
29 Jul 2024 16:22:59 EDT (-0400)
  Java (Message 14 to 23 of 23)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: Java
Date: 26 Sep 2011 18:34:05
Message: <4e80fddd@news.povray.org>
Le 2011/09/26 04:44, Invisible a écrit :
>>> Was it you that said something about "committing to backwards
>>> compatibility way too early"?
>>
>> Yep. That was the fundamental failure, caused by the whole "write once"
>> marketing campaign.
>
> I wouldn't mind, but it didn't even /work/.
>
> Like I said, I wrote an applet. It worked fine in IE. When I tried it
> with Netscape, it crashed with a null pointer exception. And, since it's
> an applet, I have no idea /where/ it crashed. You don't get a stack trace.
>
> I suspect this is probably related to the vagueness of the
> documentation. That means that others don't really know how to implement
> it correctly. Or, hell, maybe the documentation just doesn't actually
> match what Sun implemented...

It may be that some bug in the implementation under IE is effectively 
hiding another bug...
It may be that you get the crash on the correct implementation and you 
did something wrong that made it work on a faulty implementation.

Remember the imfamous "it's not a bug, it's a feature" that Microsoft 
spun to cover actual IE bugs instead of correcting them.

>
>>> I notice Office no longer comes with any documentation at all, just a
>>> link to an online forum.
>>
>> It has documentation. It just mixes it in with the online forum. I think
>> you have to chose to install it locally, tho, which is what you might be
>> seeing.
>
> Oh well. Almost never non-trivial Office task usually involves finding
> an Office MVP anyway...
>
>> I've lost track of closing braces....
>
> ...which is why every open bracket should always start a new indentation
> level...
>


Post a reply to this message

From: Darren New
Subject: Re: Java
Date: 26 Sep 2011 20:11:33
Message: <4e8114b5@news.povray.org>
On 9/26/2011 15:34, Alain wrote:
> It may be that some bug in the implementation under IE is effectively hiding
> another bug...

 From experience in exactly this field (java applets in the early days) I 
can pretty much guarantee f'ups were Mozilla and not Microsoft.

-- 
Darren New, San Diego CA, USA (PST)
   How come I never get only one kudo?


Post a reply to this message

From: Invisible
Subject: Re: Java
Date: 27 Sep 2011 04:04:59
Message: <4e8183ab$1@news.povray.org>
On 27/09/2011 01:11 AM, Darren New wrote:
> On 9/26/2011 15:34, Alain wrote:
>> It may be that some bug in the implementation under IE is effectively
>> hiding
>> another bug...
>
>  From experience in exactly this field (java applets in the early days)
> I can pretty much guarantee f'ups were Mozilla and not Microsoft.

Considering the applet only makes a handful of AWT calls before doing 
lots of compute-bound stuff to generate a fractal... I'm pretty sure it 
was just some unimplemented library call returning null or something 
like that.


Post a reply to this message

From: Invisible
Subject: Re: Java
Date: 17 Nov 2011 04:26:57
Message: <4ec4d361$1@news.povray.org>
On 24/09/2011 04:37 PM, Darren New wrote:

> What would be in C#
>
> var z = from y select z where z.id = myID
>
> in java becomes
>
> List<OrganizationIndividualRelationshipEntity> z =
> Lists.ImmutableCopyOf(
> Lists.filter(y, new
> Predicate<List<OrganizationIndividualRelationshipEntity>() {
> @override boolean apply(OrganizationIndividualRelationshipEntity x) {
> return x.id = myID;
> }
> }
> )
> }
>
> I've lost track of closing braces....
> )

Haskell has crazy type signatures too.

Haskell also has mechanisms for defining shortcuts. :-P


Post a reply to this message

From: Darren New
Subject: Re: Java
Date: 17 Nov 2011 22:25:41
Message: <4ec5d035$1@news.povray.org>
On 11/17/2011 1:26, Invisible wrote:
> On 24/09/2011 04:37 PM, Darren New wrote:
>
>> What would be in C#
>>
>> var z = from y select z where z.id = myID
>>
>> in java becomes
>>
>> List<OrganizationIndividualRelationshipEntity> z =
>> Lists.ImmutableCopyOf(
>> Lists.filter(y, new
>> Predicate<List<OrganizationIndividualRelationshipEntity>() {
>> @override boolean apply(OrganizationIndividualRelationshipEntity x) {
>> return x.id = myID;
>> }
>> }
>> )
>> }
>>
>> I've lost track of closing braces....
>> )
>
> Haskell has crazy type signatures too.
>
> Haskell also has mechanisms for defining shortcuts. :-P

You don't understand. Those *are* the shortcuts in Java.
No, I am not exaggerating.  For example, "Lists" is nothing but a static 
class full of static routines that are shortcuts for actually shortcuts for 
the more full-bodied declarations including all the generic types.

-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

From: Invisible
Subject: Re: Java
Date: 18 Nov 2011 04:21:43
Message: <4ec623a7@news.povray.org>
>> Haskell has crazy type signatures too.
>>
>> Haskell also has mechanisms for defining shortcuts. :-P
>
> You don't understand. Those *are* the shortcuts in Java.

IT BURNS!! >_<


Post a reply to this message

From: nemesis
Subject: Re: Java
Date: 18 Nov 2011 10:55:29
Message: <4ec67ff1$1@news.povray.org>
Darren New escreveu:
> On 11/17/2011 1:26, Invisible wrote:
>> On 24/09/2011 04:37 PM, Darren New wrote:
>>
>>> What would be in C#
>>>
>>> var z = from y select z where z.id = myID
>>>
>>> in java becomes
>>>
>>> List<OrganizationIndividualRelationshipEntity> z =
>>> Lists.ImmutableCopyOf(
>>> Lists.filter(y, new
>>> Predicate<List<OrganizationIndividualRelationshipEntity>() {
>>> @override boolean apply(OrganizationIndividualRelationshipEntity x) {
>>> return x.id = myID;
>>> }
>>> }
>>> )
>>> }
>>>
>>> I've lost track of closing braces....
>>> )
>>
>> Haskell has crazy type signatures too.
>>
>> Haskell also has mechanisms for defining shortcuts. :-P
> 
> You don't understand. Those *are* the shortcuts in Java.
> No, I am not exaggerating.  For example, "Lists" is nothing but a static 
> class full of static routines that are shortcuts for actually shortcuts 
> for the more full-bodied declarations including all the generic types.

problem is that you're trying to make java look worse than it is (and I 
agree it is bad) by programming it in a functional style it simply is 
not meant to.  Java is all about imperative programming at its worse, 
but at least it makes some sense when programmed that way.

I'm not quite natural to java, but I guess the correct way to program:

var z = from y select z where z.id = myID

in it would be something like:

List<OrganizationIndividualRelationshipEntity> y, z;
for (OrganizationIndividualRelationshipEntity x : y)
   if (x.id = myID) z.add(x);

that doesn't look half as bad as trying to program C in Object-Oriented 
fashion.  Still, not as fun as without type declarations.  I suppose if 
the code snippet was inside some generics method you could call 
"OrganizationIndividualRelationshipEntity" "T" and have:

List<T> y, z;
for (T x : y)
   if (x.id = myID) z.add(x);


Post a reply to this message

From: Darren New
Subject: Re: Java
Date: 19 Nov 2011 01:08:08
Message: <4ec747c8@news.povray.org>
On 11/18/2011 7:55, nemesis wrote:
> problem is that you're trying to make java look worse than it is

Well, it's the way this particular project at google was written. But yes, 
making Java functional without lambdas is messy.

I went thru something like 300 classes in this particular hugely 
overengineered project and didn't find a single noun in the bunch of them. 
They were all stuff like "CustomerUpdater" and "StorageManagerImplementor" 
and such.  I think it comes from doing too much networking, since networks 
don't do a real good job of shipping objects around. I've been trying to 
introduce the team to the wonders of actually having the code and the data 
in the same class. :-)

> var z = from y select z where z.id = myID
>
> in it would be something like:
>
> List<OrganizationIndividualRelationshipEntity> y, z;
> for (OrganizationIndividualRelationshipEntity x : y)
> if (x.id = myID) z.add(x);

Yep.

-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

From: Le Forgeron
Subject: Re: Java
Date: 19 Nov 2011 04:33:52
Message: <4ec77800$1@news.povray.org>
Le 19/11/2011 07:07, Darren New nous fit lire :
> I've been trying to introduce the team to the wonders of actually having
> the code and the data in the same class. :-)

Well, from the old relational database experience... they shouldn't.
At least, they shouldn't be too tighly coupled until the code is
specific to the data and the data are usable only by the code.

Have a SQL schema (data) and only stored procedures usually ends up in
nightmare.

Data should have their invariants and rules.
Code should be in charge of transforming the data with respect to the
rules and adding new pieces of data which also match the rules.

But you're right, having data in very distant classes from the ones
which have the code is also a PITA. (and from an isolation point of
view, the code classes should not be friend of data class, so no ugly
shortcuts...)


Post a reply to this message

From: Darren New
Subject: Re: Java
Date: 19 Nov 2011 12:20:15
Message: <4ec7e54f@news.povray.org>
On 11/19/2011 1:33, Le_Forgeron wrote:
> Le 19/11/2011 07:07, Darren New nous fit lire :
>> I've been trying to introduce the team to the wonders of actually having
>> the code and the data in the same class. :-)
>
> Well, from the old relational database experience... they shouldn't.
> At least, they shouldn't be too tighly coupled until the code is
> specific to the data and the data are usable only by the code.

Well, the data in the database shouldn't be exposed to the user at all, any 
more than if your web site is stored in a database the browser should need 
to know that.

What I'm saying is that if you have a routine that (for example) marks a 
video as having been watched by the current user, it shouldn't be in some 
third class called "VideoWatcherRecorder" taking an integer video number and 
a long user ID. It should be in the video class and take a reference to a 
user object, or vice versa. Otherwise, you're just writing procedural code 
in Java.

> Data should have their invariants and rules.

Yep. And that's very hard to do without doing OO programming. Or relational 
programming. And if you're using an OO language like Java, it should be 
enforced in the objects that interface to the database (along with the 
database, if possible, which it isn't in this case).

> Code should be in charge of transforming the data with respect to the
> rules and adding new pieces of data which also match the rules.

Sure. But the difference is where that code live. Is it in some other 
package or compilation unit, or is it in the same class that reads and 
writes the database?

-- 
Darren New, San Diego CA, USA (PST)
   People tell me I am the counter-example.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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