View Single Post
  #23   Spotlight this post!  
Unread 07-04-2010, 00:39
LukeS LukeS is offline
4272 mentor, 1024 alumnus
AKA: Luke Shumaker
FRC #4272
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Indianapolis, IN
Posts: 60
LukeS is an unknown quantity at this point
Re: Ternary operators

Quote:
Originally Posted by FRC4ME View Post
See what some well-placed white space can do for readability? Granted, breaking after ternary operators is my personal preference, but you should at the very least surround your operators with spaces. "Well-placed white space will save mistakes!" Say it with me now...
Oh, I know, I'm our teams white-space nazi! (if you don't believe me, just check*) I just generally feel that ternaries should be a single line, although, looking at how you did it, I like how newlines looks with text strings. However, I still feel that for the others, a single line is more readable. Looking at the drive code in black, I would probably add more spaces, but with syntax highlighting, I think it's fine how it is.

Also, for text output, the reason the compressor line has NO spaces at all is that with 2 4-character tabs (class and method) we were squeezing for 80 columns (something which I am also a nazi for).

* although, it does look like some spacing got messed up when tweaking numbers in autonomous. I'll fix this and update it today or tomorrow. (that URL is always the newest version)