mcclane400's Profile User Rating: -----

Reputation: 5 Worker
Group:
Active Members
Active Posts:
63 (0.03 per day)
Joined:
25-March 09
Profile Views:
1,539
Last Active:
User is offline Mar 26 2013 03:09 PM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Icon   mcclane400 has not set their status

Posts I've Made

  1. In Topic: When did while(boolVar = true) start compiling?

    Posted 26 Mar 2013

    View Postjon.kiparsky, on 26 March 2013 - 02:55 PM, said:

    View Postmcclane400, on 26 March 2013 - 03:48 PM, said:

    View Postmacosxnerd101, on 26 March 2013 - 02:26 PM, said:

    I'm not sure I understand your strong sentiments against this particular syntax. If you don't like it, just move the assignment outside of that part of the loop.


    You don't understand my strong sentiments against this:

    while(temp = true){
    }
    
    


    Without using a break, I've created an infinite loop.


    Well, infinite loops aren't such a problem. There are going to be times when you want to simply loop, and declaring some nonce condition isn't going to be the cleanest solution.


    Absolutely, I have no problem with infinite loops. My problem is that this code would suffice for an infinite loop:

    while(true){ }
    
    


    Why create a variable just to assign it to true? The only reason I brought up this question is that several beginning CS students want to compare a Boolean value to true and write this:

    while(temp = true){ }
    
    


    Which isn't what they wanted. Several forget to put == and put = instead. For some reason, I could have sworn this didn't compile in Java but I must have been mistaken.

    In the end, my question is answered. I must be thinking of something else. Thanks for the help.
  2. In Topic: When did while(boolVar = true) start compiling?

    Posted 26 Mar 2013

    View Postmacosxnerd101, on 26 March 2013 - 02:26 PM, said:

    I'm not sure I understand your strong sentiments against this particular syntax. If you don't like it, just move the assignment outside of that part of the loop.


    You don't understand my strong sentiments against this:

    while(temp = true){
    }
    
    


    Without using a break, I've created an infinite loop. EDIT: I don't want an infinite loop here though. I'm OK with infinite loops but the goal of the condition was to check if temp == true, not assign temp to true. I didn't make that clear.
  3. In Topic: Java oddity with +=

    Posted 24 Mar 2013

    View PostFallenG, on 24 March 2013 - 07:08 PM, said:

    EDIT:
    The forums are messing up the link for some reason:
    http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.26.2
    


    Perfect, that is exactly what I was looking for and couldn't find. So, I guess a += b is not exactly the same as a = a + b. How about that... Thanks for the link.

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private