Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
it was really hard for me to get accustomed to that part of the spacing... especially in the "for" loops and "import" statements. however, i do see how it makes life a lot easier in the long run. look at the example programs in the style guide if you are not sure about a particular spacing issue. i used it this morning to check on one of my programs. they do not specifically point out a couple cases that i wondered about, but those issues are included in the programs. i also look at the instructor's solutions to see how paul handled some of the things.
Just looked at the style guide again and noticed that spaces before semi-colons is sometimes used, sometimes not: foo( i ); start(); int theTick = 5 ; ++count ; Doesn't matter? Only if after an identifier? I think I've been playing it safe and always used it, so haven't gotten picked...
The spacing issue that I stumbled over was something like this if ( !done ) which according to the style guide should be if ( ! done ) But I stared and stared and couldn't see it. Read through the style guide again. Resubmitted and got the same nitpick back. The nitpick was "Spacing!" -- When I finally saw the problem, I asked Marilyn if the exclamation point in the nitpick was a special clue, but she said no.
Originally posted by Pauline McNamara: Just looked at the style guide again and noticed that spaces before semi-colons is sometimes used, sometimes not: <snip> Doesn't matter? Only if after an identifier? I think I've been playing it safe and always used it, so haven't gotten picked...
Me too. I've been putting a space in before semi-colons regardless of what comes before the semi-colon, and noone's said boo. It's taken some getting used to, but overall I really like the JavaRanch spacing conventions. (It makes my code so light and airy!)
i think the answer is that you should put a space anytime you have a vairable or identifier that can be changed... int i = 0 ; if( ! done ); because you can go back and change "done" to "finished"... but if you did not have a space, you would need to type the "!" as well. not really a big deal, but that is how i think about it. obviously, you do not need a space after the ")" in an if statement or for loop because you are only changing what is inside the "( )". the one that really got me was not putting a space after an import statement. [This message has been edited by Greg Harris (edited July 16, 2001).]
I think I must be the Number One[ dubious rank ] 'spacing' offender. I am doing Servlets-2 and still get rapped around for spacing issues. I am sorry Marilyn , it does make me feel guilty about your unnecessary workload. I take care of spacing and stuff only when sending email. I am in a hurry to complete the program first. I am learning, I swear because of resubmitting assignments.