Go to Post It is the team that they build that is the important accompliishment.. - Wayne C. [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
View Poll Results: Who uses white space?
Yes, i make it so people can read my code 39 69.64%
Yes, i make it so i think that others can resd it 7 12.50%
No, only I can read my code 3 5.36%
I think that only i can read my code 3 5.36%
I don't understand the question. 4 7.14%
Voters: 56. You may not vote on this poll

Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-17-2009, 11:47 PM
ChuckDickerson's Avatar
ChuckDickerson ChuckDickerson is online now
Mentor / Bayou & CMP Division LRI
FRC #0456 (Siege Robotics)
Team Role: Mentor
 
Join Date: May 2004
Rookie Year: 2004
Location: Vicksburg, MS
Posts: 877
ChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond reputeChuckDickerson has a reputation beyond repute
Re: "White space"

Quote:
Originally Posted by virtuald View Post
Why wouldn't you use white space?
It adds too much weight to the robot. Each space = ~0.0001327 oz. Tabs are either 4 or 8 times that depending on your editor settings. Count up all the white space in your code sometime and calculate how much weight it adds.


  #2   Spotlight this post!  
Unread 03-18-2009, 07:38 AM
swamp_child's Avatar
swamp_child swamp_child is offline
Registered User
AKA: Cody
FRC #0179 (Children Of The Swamp)
Team Role: College Student
 
Join Date: Dec 2005
Rookie Year: 2005
Location: riveria beach
Posts: 100
swamp_child is a name known to allswamp_child is a name known to allswamp_child is a name known to allswamp_child is a name known to allswamp_child is a name known to allswamp_child is a name known to all
Re: "White space"

Quote:
Originally Posted by DeepWater View Post
It adds too much weight to the robot. Each space = ~0.0001327 oz. Tabs are either 4 or 8 times that depending on your editor settings. Count up all the white space in your code sometime and calculate how much weight it adds.


for the same reason we usually don't use comments.
__________________
2009 Florida Champions thanks to 233 and 1649!
2008 UCF finalists thanks to 69 and 342
2007 world Finalist, thanks to 233 and 71, we love you guys
2007 Archemedies undefeated champions, thanks to 233 and 71
2007 UCF finalists thanks to 1902 108 and 386

  #3   Spotlight this post!  
Unread 03-18-2009, 07:47 AM
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: "White space"

I love whitespace! If the OP is trying to argue against it, he's in for a surprise if he ever gets a programming job. Even if you can read non-whitespaced code, nobody else can.

Some kids I've mentored in the past didn't use tabs at all, and it was painful to look at. It was impossible to tell, at a glance, when functions started, the scope of loops, etc. It was all either memorization or bracket-counting.
  #4   Spotlight this post!  
Unread 03-18-2009, 09:21 AM
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: "White space"

This year I found the majority of compilation errors that I helped my students fix were due to mismatched braces (usually with inconsistent indention). Whitespace is good, especially if you want quick help.

Helpful Windriver tip: Select your code and press Ctrl-I to auto indent your code
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
  #5   Spotlight this post!  
Unread 03-18-2009, 02:18 PM
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: "White space"

Quote:
Originally Posted by DeepWater View Post
It adds too much weight to the robot. Each space = ~0.0001327 oz. Tabs are either 4 or 8 times that depending on your editor settings. Count up all the white space in your code sometime and calculate how much weight it adds.


I sincerely hope you're joking. Extra code doesn't add any weight.
  #6   Spotlight this post!  
Unread 03-18-2009, 04:01 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: "White space"

Quote:
Originally Posted by basicxman View Post
Extra code doesn't add any weight.
Right. It's the other way around. The erased state of flash memory is a logic one, so adding code actually removes bits.
  #7   Spotlight this post!  
Unread 03-18-2009, 04:04 PM
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,595
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: "White space"

Quote:
Originally Posted by Alan Anderson View Post
Right. It's the other way around. The erased state of flash memory is a logic one, so adding code actually removes bits.
Bah, the weight savings of a few electrons in flash are nothing. We added a few vandegraph generators to the bot to remove some real electrons!
  #8   Spotlight this post!  
Unread 03-18-2009, 04:25 PM
billbo911's Avatar
billbo911 billbo911 is online now
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,334
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: "White space"

Quote:
Originally Posted by EricVanWyk View Post
We added a few vandegraph generators to the bot to remove some real electrons!
And you wonder why we are getting static charge build up this year.

__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #9   Spotlight this post!  
Unread 03-18-2009, 07:46 PM
writchie writchie is offline
Engineering Mentor
AKA: Wally Ritchie
FRC #2152 (Team Daytona)
Team Role: Coach
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Daytona Beach, Florida
Posts: 148
writchie has a reputation beyond reputewritchie has a reputation beyond reputewritchie has a reputation beyond reputewritchie has a reputation beyond reputewritchie has a reputation beyond reputewritchie has a reputation beyond reputewritchie has a reputation beyond reputewritchie has a reputation beyond reputewritchie has a reputation beyond reputewritchie has a reputation beyond reputewritchie has a reputation beyond repute
Re: "White space"

Quote:
Originally Posted by Alan Anderson View Post
Right. It's the other way around. The erased state of flash memory is a logic one, so adding code actually removes bits.
Ahhh, but the process of writing a "zero" is done by injecting electrons into the float gate. So a programmed device has the mass of these electrons (which is of course negligible).
  #10   Spotlight this post!  
Unread 03-18-2009, 09:22 PM
dooey100 dooey100 is offline
Registered User
FTC #3037
 
Join Date: Feb 2009
Location: Fernie
Posts: 47
dooey100 is on a distinguished road
Re: "White space"

You are missing an option on that poll:

"I can't even read my own code"
  #11   Spotlight this post!  
Unread 03-19-2009, 12:18 AM
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: "White space"

Sorry I didn't specify, adding or removing code does not change the weight!!

Anyways, here's some sample code from my joystick for FTC, this is how I like things whitespaced

Code:
while (true) { //whitespace after an important conditional or loop

  getJoystickSettings(joystick); //single linebreak for basic commands and function calling
  setMotors("default"); //double linebreak when another main conditional is about to appear

  if (joystick.joy1_y1 > 40 || joystick.joy1_y1 < -40) { //single linebreak for a final conditional in nests
    motor[motorD] = joystick.joy1_y1; 
  }

}
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Championship Event - Where the "Random" Match Sorting Really "Shines" Travis Hoffman Championship Event 57 04-19-2007 08:06 AM
New NEMO White Papers! "Creating a Killer Packet" and "25 Ways to Sponsor" Jessica Boucher Team Organization 0 08-10-2005 10:55 AM
Team 1126 "Crazy Wheels" white paper Alex Cormier Technical Discussion 1 10-25-2004 03:54 PM
"Thunderbirds" Vs. "Team America" Which one will rule the box office? Elgin Clock Chit-Chat 3 09-07-2004 07:53 PM
Transcript: "The Space Shuttle Columbia Accident: What's Next?" DanL General Forum 2 03-03-2003 09:35 PM


All times are GMT -5. The time now is 11:13 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi