Possible bug in Calendar

H

Harold Yarmouth

Arne said:
Well - the last one is something you added later.

No, it's something I made explicit later, but had implied from the start.
(because you have not understood

You will stop being insulting towards me in public. I clearly understand
better than you what is logically required for a simple and basic
date-builder object and what would be extraneous.
But it is already proven that your rule is not followed in the
Java API and you have not been able to mention any library that
does.

I mentioned that an awful lot of them do, and I'll thank you to stop a)
accusing me of being a liar and b) lying about me!
 
H

Harold Yarmouth

Arne said:
You mean that you don't know any examples and that you just made up your
claim and you don't have the character to admit it

No, I do not. I mean that I know of too many to list and that YOU are
the one "just making things up", including every single unpleasant
assertion that you've publicly made about me.

This newsgroup is supposed to be about Java programming, not about who
is or isn't a liar, a nincompoop, or whatever-else.

I'll thank you to begin abiding by this newsgroup's charter and
confining your discussions, and especially your wild speculations and
guesses, to the topic of Java.
 
H

Harold Yarmouth

Arne said:
There are 9 no-arg getInstance methods among those 44

I also never said I meant "only in the core Java API". I meant "in Java
code in general", as in ALL of it.

Please stop putting words in my mouth, or otherwise twisting what I've
said, in your zeal to "prove" that I'm whatever sort of idiot or liar
you seem to want to believe I am.

Not only is it evil, it's incorrect.

Not only is it incorrect, it's not even on topic in this newsgroup.

This is not the appropriate forum for you to vent your personal issues.
Find somewhere more appropriate or shut the heck up.
 
N

Nigel Wade

Arne,

You're wasting your time arguing with this idiot. Haven't you noticed the
remarkable similarity to the nuisance who previously used the ID of
(e-mail address removed)? Even down to the same ISP, same version of
Thunderbird and various other tells. Presumably he's popped up with a new
identity to get around kill-files.

It would be prudent to add this new identity to the same kill-file.
 
L

Lew

Arne,

You're wasting your time arguing with this idiot. Haven't you noticed the
remarkable similarity to the nuisance who previously used the ID of
(e-mail address removed)? Even down to the same ISP, same version of
Thunderbird and various other tells. Presumably he's popped up with a new
identity to get around kill-files.

It would be prudent to add this new identity to the same kill-file.

Arne is simply elucidating the point made by at least one of the gods
of Java, Mr. Bloch, /op. cit./, that 'getX()' factory methods
absolutely do not implicitly or explicitly denote the return of a
singleton, although sometimes they do return a singleton. There are
many others who read this group besides "Harold" (not his real name)
who can benefit by having the truth, who otherwise might be misled by
the misinformation promulgated to the contrary.
 
D

Daniel Pitts

Harold said:
If the code follows the specification, then there is no bug *in the
code*. There may still be a bug elsewhere. The code is not the whole of
a computer program; there is also the design and specification, and
those themselves may have flaws of their own, as is well known.
A flaw isn't necessary a bug. I happen to agree that the Calendar and
Date classes are highly flawed, but not buggy.
 
H

Harold Yarmouth

Joshua said:
Calendar is a case where core action code is locale-dependent, just like
lexicographical ordering.

Still split responsibilities. String.compareTo() is not locale-dependent
(imagine the chaos if it were!) and StringBuilder's behavior is not
locale-dependent; for locale-dependent lexicographic ordering of strings
we have a separate class dedicated to the purpose, Collator.

A similar design should probably have been chosen for dates and times --
Date and its no-frills builder (probably DateBuilder rather than
Calendar) using a default set of behaviors based on the commonest case
(Western calendar, UTC+0000 time-zone) and a separate class for
locale-dependent transformations and actions (probably Calendar, but
maybe with DateFormat folded in and certainly with a DateBuilder
separated out).

We'd then have this correspondence (with DateFormat *not* folded in):

String Date core ops
StringBuilder DateBuilder get, no-frills
MessageBundle DateFormat/etc. get with locale sensitivity
Writer w/encoding DateFormat/etc. write with locale sensitivity
Collator/etc. Calendar other operations w/locale sens.

This would give a better separation of responsibilities on the Date
side, mirroring the current division on the String side.
The interaction of "this time, next year" depends heavily on what
calendar we're talking about (it's different for solar calendars
and lunar calendars), just like where to stick "é" in a list.

The output of "one day in the future" or similarly does not.

(Also, please point out any business, especially a web business, that
uses a lunar calendar to reckon invoice overdue-ness, timestamp server
logs, track shipments, determine office hours of operation, timestamp
internal email, etc. -- I'd really like to know of one. If you can
actually find one.)
Note, though, that the question of "flawed contracts" is still open.

If part of its contract is "providing the simplest way to get a specific
date in international standard form" then it does not make that as
simple as possible. That might be considered a flaw in how well it
implements that particular function. But it really does look to me like
that functionality belongs separate from the locale-dependent
functionality, or at least fixed up so the output Dates aren't prone to
having a random tiny variation from one another.

I'd argue that, at least, the most-specific-possible "set" method (just
by being so) has an implied contract to completely determine the output.
If so, that contract clearly IS violated.
 
H

Harold Yarmouth

Arne said:
Which is why all Java developers above the absolute beginners level

These constant jabs and digs are becoming tiresome. If for some reason
you cannot be civil, please be silent.
You are completely missing the point.

No, I am not; you are.

If for some reason you cannot be civil, please be silent.
Which has been proven to be wrong.

No, it has not.

If for some reason you cannot be civil, please be silent.
 
H

Harold Yarmouth

Arne said:
Your mistake !

No. If there is any mistake there, it was made by the IDE's developers,
and I was not involved. That IDE is NetBeans, so if you think their
built-in documentation display should behave differently, I respectfully
suggest that you take it up with them and stop insulting me in public.

Regardless -- if for some reason you cannot be civil, please be silent.
 
H

Harold Yarmouth

Arne said:
Very simple answer.

Because there are only one StringBuilder and multiple Calendar's.

That's begging the question.

Yes. They mixed "just get me a stock Date for this day, month, and year"
functionality and "do all these whiz-bang locale-dependent presentations
and manipulations" functionality in one place. Whereas for Strings we
have separate StringBuilder (simple construction of an instance),
Collator (locale-dependent collations), MessageBundle (get
locale-dependent strings), various I/O classes with character encodings
(input and output in a locale-dependent way), and so on. With Date, they
stuffed almost everything for the above sorts of functionality into
Calendar, which became a mess, and a little bit into DateFormat.
Try read the documentation of the Calendar class again.

Try read Emily fucking Post again! Your rudeness is becoming incredibly
tiresome. Learn to be polite in public!
If you care about milliseconds you need to set milliseconds.

However, if you DON'T care, the above should completely determine the
output. Otherwise you get surprises if you later test them for equality.

Really, set(year, month, day, hour, minute, second) done twice with the
same values should produce results that compare equal. It really is that
simple, and in all of this arguing over locales and other nonsense, that
one point, the ORIGINAL point, has somehow gotten overlooked.

Yes. See above.
programmers that does not read the documentation produce lousy code.

My code is not lousy.

If for some reason you cannot be civil, please be silent.
 
H

Harold Yarmouth

Arne said:
Another good example of where you completely misses the point.

NO. I do not, and I must insist that you stop this gratuitous rudeness
at once. This latest post of yours does not contain a single piece of
Java-related information that wasn't quoted from someone else. The ONLY
original material in it is a personal attack. That is completely
unacceptable.

If for some reason you cannot be civil, please be silent!
 
H

Harold Yarmouth

Joshua said:
Missing in that quote is the fact that you took out a line.

A line that could not be interpreted without knowing Latin, and that
therefore is irrelevant to the matter of *how that paragraph would be
perceived by some guy reading it*.
It is obvious to me that Lew was referring to the person whose text was
linked to

Well, perhaps you know Latin and it actually was obvious TO YOU.
However, most people do not know what any given piece of Latin means,
especially when it's abbreviated instead of spelled out.
 
H

Harold Yarmouth

Arne said:
Glad you agree with me.

I do not! And that is a complete misquotation of what I wrote.

As you can CLEARLY see, I was "agreeing" that you had forgotten to check
your confrontational attitude at the door, not agreeing with your
vicious and uncalled-for personal attacks.

If you EVER pull a dishonest stunt like that little bit of "creative
quoting" AGAIN I will have your HEAD. Have I made myself clear???
Sorry - nobody will believe that.

Is that intended as a threat?

If this is a declaration of your intent to smear my professional
reputation in public if I don't knuckle under to some as-yet-unstated
set of demands, well all I can say is "see you in court". It will be a
defamation lawsuit if you make good on that threat. And I won't knuckle
under, regardless.

Regardless, you are in no position to assert what other people will or
will not believe. Other people will make up their own minds and I doubt
you are anywhere near as influential as you apparently think you are.
You don't read documentation.

I do.
You don't understand object oriented principles.

I do. Better than you do, apparently. You clearly don't get separation
of concerns, nor when to use names like "getInstance", versus
"newInstance" or a constructor. I do, and you got mad when you found out
that I know some things you don't. And threw a childish temper-tantrum
in public, hurling abuse and name-calling and generally behaving like a
six-year old that got told he couldn't have some candy because his
grades were too poor on his report card.

No, I said that the object charged with the responsibility of being the
no-frills Date builder should be simple and straightforward, and need
not be polymorphic (and thus should not, given the simplicity requirement).
I got it
Good.

you do not even know about the "is a" principle.

A lie.

It's just that it's not relevant to the issue of how to implement a
simple Date builder, anymore than it's relevant to the implementation of
StringBuilder.
You really should start reading.

Since you evidently had nothing civil or Java-related to say here,
perhaps you should have kept your trap shut.
Yes.

You have completely misunderstood

No. YOU have completely misunderstood the purpose of this newsgroup. Its
purpose is to enable intelligent adults discuss Java in a civil and
levelheaded fashion, not to enable little children whose parents don't
monitor their use of the Internet to flame and get into childish pissing
contests.

Now pull the plug and tell your Mommy you want a sledgehammer for
Christmas so you can smash up your modem and eat it, and then, without
the distraction of coming here to post gratuitously insulting and
largely non-Java-related trash-talk at other people, focus on your
studies and improve your grades so you can ace fourth-grade Reading
Comprehension and, especially, not flunk English Lit *again*.
Calendars are much more different than just timezone and
language for names.

Calendars for use in ordinary business-programming situations are not.
Anything else belongs outside the core date/time classes. Same way
String does not have the functionality of Collator or MessageBundle
built-in, nor does StringBuilder.
 
H

Harold Yarmouth

Arne said:
Harold said:
Arne said:
Harold Yarmouth wrote:
Lew wrote:
Of course it's not returning a singleton, since the javadoc of the
getInstance method explicitely says that "The Calendar returned is
based on the current time [...]".

Which could, perversely, be referring to the time the documentation
was being written. Stranger things have happened.

You will not get nominated twice !

Excuse me?

For "the most lame argument posted to cljp in 2008".

Oh, no matter. I wouldn't have won that one anyway.

You might, though.
 
H

Harold Yarmouth

Tom said:
Harold said:
Arne Vajhøj wrote:
Harold Yarmouth wrote:
Lew wrote:
Of course it's not returning a singleton, since the javadoc of the
getInstance method explicitely says that "The Calendar returned is
based on the current time [...]".

Which could, perversely, be referring to the time the documentation
was being written. Stranger things have happened.

You will not get nominated twice !

Excuse me?

For "the most lame argument posted to cljp in 2008".

Can trolls even be nominated for that?

The only troll here is Arne, whose posts "shed more heat than light" and
seem designed to get his victims to respond in their own defense to his
repeated public slights.
 
H

Harold Yarmouth

Arne said:
It has to include the milliseconds because it has to convert
to and from Date which contains milliseconds.

Why? It could conceivably instead just be precise to the nearest second,
with conversion from Date losing (usually useless) information and
conversion to Date filling those in with zeros.

It should either do so, or provide a seven-argument set method, or the
sixth argument set method should zero out the milliseconds. One of those
three.
 
J

Joshua Cranmer

Harold said:
A line that could not be interpreted without knowing Latin, and that
therefore is irrelevant to the matter of *how that paragraph would be
perceived by some guy reading it*.


Well, perhaps you know Latin and it actually was obvious TO YOU.
However, most people do not know what any given piece of Latin means,
especially when it's abbreviated instead of spelled out.

I see a link. A link is followed by the line "When gods speak, mortals
should listen." Does that line refer to the text immediately preceding
it or the text a while back? In the English language, proper grammatical
structure dictates that modifiers appear as close to the statements
being modified as possible.

I don't know any Latin; I don't even know what `op. cit.' means (well, I
just looked it up on Wikipedia). But that doesn't stop me from
connecting the fact that a) the link is an important reference and b)
the subsequent text will be making reference to the link.
 
L

Lew

I see a link. A link is followed by the line "When gods speak, mortals
should listen." Does that line refer to the text immediately preceding
it or the text a while back? In the English language, proper grammatical
structure dictates that modifiers appear as close to the statements
being modified as possible.

I don't know any Latin; I don't even know what `op. cit.' means (well, I
just looked it up on Wikipedia). But that doesn't stop me from
connecting the fact that a) the link is an important reference and b)
the subsequent text will be making reference to the link.

Exactly so. The fact that I really am a god of Java is just a
coincidence.
 
L

Lars Enderin

Harold Yarmouth wrote:
[some refined variant of Twisted's usual rants]

Each posting from "Harold Yarmouth" makes me more confident that
"Harold" is the same person who uses/has used the aliases Twisted,
Scuzzbuster, Twerpinator, zerg, etc.
You have tried to appear reasonable, but you cannot hide your true nature.
It must be exasperating to try in vain to be accepted as a competent
contributor, only to be tripped up by reacting the way you do. I guess
you can't help it, so maybe I should feel sorry for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top