Home arrow static arrow Java Programming [Archive] - java constructors drive me mad
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - java constructors drive me mad
This topic has 219 replies on 15 pages.    « Previous | 1 | ... 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Next »

Posts:835
Registered: 2/12/01
Re: java constructors drive me mad  
Jun 21, 2004 4:14 AM (reply 150 of 219)



 
You really are a **** head aren't you.

Especially for you I have repeated it 1000 times.

Fields of a record must be independent and can be populated in ANY order.
 

Posts:835
Registered: 2/12/01
Re: java constructors drive me mad  
Jun 21, 2004 4:16 AM (reply 151 of 219)



 

I initialize it
root = new Node(",./")

This means nothing because, the parent has
not been initialized
, so you cannot initialize a
local field. (cf. JLS).

What is a parent? A collection of derived fields? What is your considerarion to initialize a Person (fname, sname, bdate, knife) record?
 

Posts:835
Registered: 2/12/01
Re: java constructors drive me mad  
Jun 21, 2004 4:17 AM (reply 152 of 219)



 
Post 150:

If you cannot deliver correct points, what is the point?

Especially for you I have repeated it 1000 times.

Fields of a record must be independent and can be
populated in ANY order.
 

Posts:2,830
Registered: 9/1/03
Re: java constructors drive me mad  
Jun 21, 2004 4:17 AM (reply 153 of 219)



 
In the OP, "root" field is initialized before it is
passed to the super().

No, it is not

if the example compiled, root would be initialised before 'super' executes.
 

Posts:205
Registered: 6/15/04
Re: java constructors drive me mad  
Jun 21, 2004 4:20 AM (reply 154 of 219)



 
In the OP, "root" field is initialized before it
is
passed to the super().

No, it is not

if the example compiled, root would be
initialised before 'super' executes.

Yes, if the code was legal Java it would compile, in which case root would be initialised before 'super' executes, however the code is not legal Java code and therefore will not compile, hence root is not initialized before super is called.
 

Posts:205
Registered: 6/15/04
Re: java constructors drive me mad  
Jun 21, 2004 4:21 AM (reply 155 of 219)



 
Fields of a record must be independent and can be
populated in ANY order.

repeat as much as you like. The Java Language Specification says what is and what is not allowed in Java, not you, and not me.

As it stands you cannot initialize a local field prior to all fields further up the hierarchy being initialized. Therefore, whether you understand it or not, in Java you cannot populate in any arbitrary order.
 

Posts:2,830
Registered: 9/1/03
Re: java constructors drive me mad  
Jun 21, 2004 4:31 AM (reply 156 of 219)



 
In the OP, "root" field is initialized before it
is
passed to the super().

No, it is not

if the example compiled, root would be
initialised before 'super' executes.

Yes, if the code was legal Java it would
compile, in which case root would be
initialised before 'super' executes, however the code
is not legal Java code and therefore will not
compile, hence root is not initialized before super is
called.

uhh, if the code doesn't compile obviously nothing is executed, its
not even worth talking about :)

ps: valjok, i apologise for being very rude earlier, but lets drop the insulting
each other ...
 

Posts:205
Registered: 6/15/04
Re: java constructors drive me mad  
Jun 21, 2004 4:43 AM (reply 157 of 219)



 
ps: valjok, i apologise for being very rude earlier,
but lets drop the insulting
each other ...

I'm sure I tried this tact already once ... c'est la vie!

Desgraciadamente, nuestro amigo no aparece tener ninguna manera todo lo que.

Esta persona no descansar´┐Ż hasta que el mundo concordar´┐Ż con su punto de vista particular de "wonky".

Good luck :o)
 

Posts:835
Registered: 2/12/01
Re: java constructors drive me mad  
Jun 21, 2004 7:06 AM (reply 158 of 219)



 
Fields of a record must be independent and can be
populated in ANY order.

repeat as much as you like. The Java Language
Specification says what is and what is not allowed in
Java, not you, and not me.

As it stands you cannot initialize a local
field prior to all fields further up the hierarchy
being initialized. Therefore, whether you understand
it or not, in Java you cannot populate in any
arbitrary order.

It is not polite to ask me for my point then. Furthermore, it is not tactful to speak in the lang that people do not understand.

I knew this your fact about the restriction in JLS many years before you've become (java) programmer. I repeat once again, all we know about JLS requirement. This topic was started in order to obtain the reasons of this java limitation from authority experts, because this constraint brings irregularity into the language (prohibits use of initialized fields), disables any activity (params preparation and chacking) in constructors before super(). In addition, this irregularity does not protect against using not initialized vars. Therefore, it is frustrating and causes opposition inside me.
jsalonen has made his autority point (the JLS 12.5 has historical and implentation reasons) at the time you've entered (silk.m, billy.boy). In your examples you were trying to extend this restriction of java on phisical objects, logic rules. When your arguments fail you always come up JLS.

Nobody so far could explain why my code is wonky, besides it does not conform JLS. Should I explain to non-java programmers that the requirement to call super() constructor first is a good OOP practice? I think no, it is not. We just should learn them not to forget to call super in contructors and destructors (in not managed envirenments).

 

Posts:205
Registered: 6/15/04
Re: java constructors drive me mad  
Jun 21, 2004 7:15 AM (reply 159 of 219)



 
many years before you've become (java) programmer.

Sorry, I forgot you know me, and you know my personal history, and you know when I did what, and you also know exactly what I did.

If you know all the answers, why post the questions? You are a fool. Who does not know what he claims to.

I would wish you luck, but you do not need that from me or from anyone.

It is not polite to ask me for my point then.

I don't recall asking you for your point.

Furthermore, it is not tactful to speak in the lang that people do not understand.

This is fine coming from you -I mean commenting on what is tactful and what is not.
 

Posts:835
Registered: 2/12/01
Re: java constructors drive me mad  
Jun 21, 2004 7:45 AM (reply 160 of 219)



 
I don't recall asking you for your point.
Post 148: If you cannot deliver correct points, what is the point?
My point was approved by jsalonen(replies 34, 35). Should i compare your histories? If you claim that my code is bad OOP practice, be ready to explain (all your attempts so far had a fiasco).
 

Posts:6,750
Registered: 1/25/04
Re: java constructors drive me mad  
Jun 21, 2004 8:47 AM (reply 161 of 219)



 
So valjok, what have you decided to do? Submit a bug report (you described this as a bug in the JLS, after all)? Use the workaround, or switch to a different language that allows what you want to do?
 

Posts:37,103
Registered: 3/30/99
Re: java constructors drive me mad  
Jun 21, 2004 8:58 AM (reply 162 of 219)



 
I agree, because that class has been initialised ...
in our case we are assigning
fields in a class that has not been
initialised
.

What do you mean "a class that has not been initialized"? I'm not sure what it means to "initialize a class." Can you be more specific about what exactly that entails?
 

Posts:37,103
Registered: 3/30/99
Re: java constructors drive me mad  
Jun 21, 2004 9:04 AM (reply 163 of 219)



 
In the OP, "root" field is initialized before it is
passed to the super().

No, it is not

In current Java, no it is not. Valjok seems to be saying: "Why can't Java allow it to be initialized like this?"
class Tree extends JTree {    private final DefaultMutableTreeNode root;    Tree() {        super(new DefaultTreeModel(root = new DefaultMutableTreeNode("Download Manager")));    }

I think we all understand that the above doesn't initialize root because it's not legal Java. Valjok seems to be asking: Why shouldn't it be legal?
 

Posts:37,103
Registered: 3/30/99
Re: java constructors drive me mad  
Jun 21, 2004 9:06 AM (reply 164 of 219)



 

When will you start to understand that you are an
incredibly rude person!
I'm not diplomatic;

It goes beyond "undiplomatic." You're insulting, condescending, and rude.

therefore, it often prevents me to
deliver correct points to mistaken people. Espesially
when they are offended when I call ther sophisticated
schemes of memory allocation in constuctors
"nonsence".

Nobody's offended by any technical points you're offering, but there's no reason for the attitude.
 
This topic has 219 replies on 15 pages.    « Previous | 1 | ... 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Next »