Go to Post I would say FIRST is quite an addiction.............but one of the BEST addictions you'll ever have. - RoboMadi [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 01-25-2011, 10:41 PM
wdell wdell is offline
Registered User
AKA: William Dell
FRC #3999 (Shadetree Mechanics)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Killeen, Texas
Posts: 55
wdell has a spectacular aura aboutwdell has a spectacular aura about
Re: Bad Programming Practices

I go back to mine during the day, clean it up and add additional comments where necessary. I also try to comment as I go, so that when I go back and look at the mess I made during a flurry of lunchtime coding I can remember what I was trying to accomplish. You'd be surprised how much that helps you figure out why it isn't working when it actually gets uploaded to the bot.

Another good practice is good variable names. Mine get clear, descriptive names like spinGyro and tiltGyro, instead of something cryptic like m_gyroA1 (my gyro on analog port one? And does that one tell me if I'm turning or tipping over?) The FRC classes are really bad about that; I mean, who came up with the idea that the top line of the LCD should be named kMain6, instead of lcdLine1? Took me a lot of test messages to figure out which line was which (kMain6 is the top line, then they are kUser2 through kUser6 going down.)

I try to be aware that next year they might not have me to help them, but if the code is clear and well commented they won't have to start from scratch. There's a composition book of notes, diagrams, and explanations to go with it as well. Maybe I can get one of my students to type that up some day into something a little more legible.
Reply With Quote
 


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


All times are GMT -5. The time now is 08:36 AM.

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