Go to Post We can not close our eyes, ears and minds from March to December. - Dave Campbell [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

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-11-2005, 16:00
coastertux coastertux is offline
Penn State Class of 2010!
AKA: Steve
FRC #1640 (sab-BOT-age)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Downingtown, PA
Posts: 264
coastertux is just really nicecoastertux is just really nicecoastertux is just really nicecoastertux is just really nicecoastertux is just really nice
Send a message via AIM to coastertux
Programming Organization

Last year we only had 2 students programming so we both worked on the same piece of code and didn't worry too much about conventions, etc. This year it looks like we will have about 8 people on the programming team and were wondering how we can manage that many people. What types of conventions like indents, variable names, function names, constants, and comments can we require? Also, how can we divide the programming and then get it all back together into one easily?

Thanks!
  #2   Spotlight this post!  
Unread 22-11-2005, 16:20
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Programming Organization

First off, I'd recommend setting up a CVS (Concurrent Versions System) server. Concurrent Version System - Wikipedia, the free encyclopedia

As head programmer (which I'm assuming you are), I would setup a set of standard header files. These would be included in the necessary source files, with each header file being completely independent and modular. Say you need to use PID control in a source file, you should just have to include pid.h and it should cover everything you need.

To be honest, I wouldn't worry too much about indent size/function names/etc. Have enough of a standard to make it readable, but not enough to hinder a persons programming time because they have to look up whether it's Function_Name or function_name.

With that being said, I admit to being a perfectionist. This is my current self-standard:
All brackets are placed on next line
Code:
// Good
if(foo == bar)
{
return;
}

// Bad
if(foo == bar){
return;
}
Constants are referred to in capitals, all others in lower case.
Code:
// Good
#define PI 3.14
unsigned int some_variable;

// Bad
#define pi 3.14
unsigned int SOME_vArIABLE;
Variables/Functions use underscores to replace spaces.
Code:
// Good
void Read_Encoder(void)

// Bad
void ReadEncoder(void)
Use short, clear and concise variable/function names.
Code:
// Good
unsigned int left_encoder_clicks = 0;
void Update_Encoder_Count(void)

// Bad
unsigned int amount_of_clicks_back_from_the_encoder = 0;
void Update(void)
Use double slash comments.
Code:
// Good
/* Bad */
Like I said, try to not have super-harsh standards. These are my own, and I realize that they probably are pretty strict... but they are for myself only. If I were to work with a programming team, they would be much more lax.

EDIT: I'd just like to add that I change my standards a lot... just because I'm a perfectionist like that.
The great thing about standards is there are so many to choose from.
-Anonymous
__________________
http://www.mikesorrenti.com/

Last edited by Mike : 22-11-2005 at 16:23.
  #3   Spotlight this post!  
Unread 22-11-2005, 17:06
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: Programming Organization

Plan plan plan plan plan and plan your code before writing it. Agree on interfaces between code bits ahead of time. C is a loose and rather permissive language so it is important to agree on coding standards. A CVS is a good idea. Document the code well. Maintain change logs. Document everything where reasonable. Abstract and encapsulate where reasonable. Modular code helps with group projects. It is one thing to be able to write code that you understand. It is another to write code that can be easily modified and understood by others.

I have a guide NOT to follow: How to write unmaintainable code
__________________
1139 Alumni

Last edited by Rickertsen2 : 22-11-2005 at 17:11.
  #4   Spotlight this post!  
Unread 22-11-2005, 17:09
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Programming Organization

Quote:
Originally Posted by Rickertsen2
I have a guide NOT to follow: How to write unmaintainable code
On a somewhat-kinda-related tangent, visit TheDailyWTF and make sure not to do anything you see there
__________________
http://www.mikesorrenti.com/
  #5   Spotlight this post!  
Unread 23-11-2005, 17:30
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,998
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Programming Organization

Quote:
Originally Posted by Rickertsen2
Document the code well. Maintain change logs.
Both are excellent ideas, and will save you a ton of grief when things don't work right.

I personally document every line of code, and usually my code has more comments than code. Comments should be sufficient for anyone moderately familiar with code to understand completetly and fully what a line is supposed to be doing.

Cange logs are harder to enforce, but literally writing down every change (was Foo == bar, changed to foo==bar, DAR 11/23/05) with who did it and when can be extraordinarily useful when something that was working suddenly stops. Reviewing it later is also an excellent learning tool, you see how things evolved and learn ways to get there sooner next time. (Note that some CV systems do this for you)

This is how professional programmers are supposed to do it. Sadly, it's not always the case, but projects that do are often more successful. Learn it the right way, the discipline will serve you well for a lifetime.

Don
__________________

I am N2IRZ - What's your callsign?
  #6   Spotlight this post!  
Unread 22-11-2005, 19:42
lndnny's Avatar
lndnny lndnny is offline
Does a bit of everything!
None #0808 (Mechanical Mayhem)
Team Role: Programmer
 
Join Date: Jun 2005
Rookie Year: 2005
Location: alliance
Posts: 22
lndnny is an unknown quantity at this point
Re: Programming Organization

Quote:
Originally Posted by Mike
First off, I'd recommend setting up a CVS (Concurrent Versions System) server. Concurrent Version System - Wikipedia, the free encyclopedia

As head programmer (which I'm assuming you are), I would setup a set of standard header files. These would be included in the necessary source files, with each header file being completely independent and modular. Say you need to use PID control in a source file, you should just have to include pid.h and it should cover everything you need.

To be honest, I wouldn't worry too much about indent size/function names/etc. Have enough of a standard to make it readable, but not enough to hinder a persons programming time because they have to look up whether it's Function_Name or function_name.

With that being said, I admit to being a perfectionist. This is my current self-standard:
All brackets are placed on next line
Code:
// Good
if(foo == bar)
{
return;
}

// Bad
if(foo == bar){
return;
}
Constants are referred to in capitals, all others in lower case.
Code:
// Good
#define PI 3.14
unsigned int some_variable;

// Bad
#define pi 3.14
unsigned int SOME_vArIABLE;
Variables/Functions use underscores to replace spaces.
Code:
// Good
void Read_Encoder(void)

// Bad
void ReadEncoder(void)
Use short, clear and concise variable/function names.
Code:
// Good
unsigned int left_encoder_clicks = 0;
void Update_Encoder_Count(void)

// Bad
unsigned int amount_of_clicks_back_from_the_encoder = 0;
void Update(void)
Use double slash comments.
Code:
// Good
/* Bad */
Like I said, try to not have super-harsh standards. These are my own, and I realize that they probably are pretty strict... but they are for myself only. If I were to work with a programming team, they would be much more lax.

EDIT: I'd just like to add that I change my standards a lot... just because I'm a perfectionist like that.
The great thing about standards is there are so many to choose from.
-Anonymous

Code:
// Good
if(foo == bar)
{
     return;
}

// Bad
if(foo == bar){
     return;
}
you should indent stuff between brackets
  #7   Spotlight this post!  
Unread 22-11-2005, 19:55
Cuog's Avatar
Cuog Cuog is offline
Registered Linux User: 390661
AKA: Alex
FRC #0422
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Richmond, Virginia
Posts: 852
Cuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond repute
Send a message via AIM to Cuog
Re: Programming Organization

It will also depend on what people are anal retentive about, I for example dont really care what your variable names are as long as i can easiy figure out what they mean:

useless_person //good
p //bad

But I cannot stand bad spacing/indenting, When i did team projects in my programming class last year i would go through and fix all the spacing before starting

Also everyone in your team willing to program you should teach them OOP(at least the basics) so that they are not lost in all these crazy files and their interaction.

Our team also has a small programming base and we like it that way:
2 people now three that i Switched from JAVA and C# to PIC "C"
__________________
KK4KQO
http://voltair.us
Too many projects, too little time.
  #8   Spotlight this post!  
Unread 22-11-2005, 20:40
coastertux coastertux is offline
Penn State Class of 2010!
AKA: Steve
FRC #1640 (sab-BOT-age)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Downingtown, PA
Posts: 264
coastertux is just really nicecoastertux is just really nicecoastertux is just really nicecoastertux is just really nicecoastertux is just really nice
Send a message via AIM to coastertux
Re: Programming Organization

How would I set up a SVN/Subversion?
  #9   Spotlight this post!  
Unread 22-11-2005, 23:46
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: Programming Organization

8 people is quite alot for such a small project. What is the experience level of each member like?
__________________
1139 Alumni
  #10   Spotlight this post!  
Unread 29-11-2005, 19:29
Timothy D. Ginn's Avatar
Timothy D. Ginn Timothy D. Ginn is offline
I check here maybe once a year.
no team
 
Join Date: Apr 2003
Rookie Year: 2002
Location: Port Perry, ON. Canada
Posts: 247
Timothy D. Ginn is a name known to allTimothy D. Ginn is a name known to allTimothy D. Ginn is a name known to allTimothy D. Ginn is a name known to allTimothy D. Ginn is a name known to allTimothy D. Ginn is a name known to all
Send a message via ICQ to Timothy D. Ginn Send a message via AIM to Timothy D. Ginn Send a message via MSN to Timothy D. Ginn Send a message via Yahoo to Timothy D. Ginn
Re: Programming Organization

Quote:
Originally Posted by coastertux
How would I set up a SVN/Subversion?
A brief description of many free version control system is at http://producingoss.com/html-chunk/vc-systems.html (I just happened to stumble across that by chance when reading something else and figured you or others might be interested).

For how to setup a repository see http://subversion.tigris.org/faq.html#repository (how to make Eclipse use it has already been mentioned).
__________________
Alumni of FRC Team 1006
Former mentor of Full Lego Alchemist (FLL 5621) - Sempar School / Computing Students' Association of Queen's University
  #11   Spotlight this post!  
Unread 29-11-2005, 19:35
coastertux coastertux is offline
Penn State Class of 2010!
AKA: Steve
FRC #1640 (sab-BOT-age)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Downingtown, PA
Posts: 264
coastertux is just really nicecoastertux is just really nicecoastertux is just really nicecoastertux is just really nicecoastertux is just really nice
Send a message via AIM to coastertux
Re: Programming Organization

We are using CVS now as I could not find a free SVN server.
  #12   Spotlight this post!  
Unread 23-11-2005, 10:51
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: Programming Organization

Quote:
Originally Posted by Mike
Use double slash comments.
Code:
// Good
/* Bad */
Please not that C compilers are not required to support the double slash style comment. I would try to stay with the language specific comments for portability. If IFI were to change the RC and we needed a new compiler, there would be a chance that it wouldn't support the double slashes. In that case, you would be causing yourself to do extra work in porting the comments.

We actually just ran into this exact issue when teaching our software students. We designed labs and homework using the mcc18 compiler and mistakenly had double slash comments in some places. When we gave them the assignments, they were to use a gcc compiler. We found out quickly that gcc doesn't support the double slash and we had to go back and fix it.
  #13   Spotlight this post!  
Unread 23-11-2005, 13:35
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Programming Organization

Quote:
Originally Posted by Dave Scheck
We found out quickly that gcc doesn't support the double slash and we had to go back and fix it.
Hmm, that's weird... I use avr-gcc (a gcc port for the AVR line of microcontrollers) and it allows the double-slash style.

But like I said, that is my personal standard.
__________________
http://www.mikesorrenti.com/
  #14   Spotlight this post!  
Unread 23-11-2005, 15:53
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Programming Organization

Quote:
Originally Posted by Dave Scheck
We found out quickly that gcc doesn't support the double slash and we had to go back and fix it.
Really? Hm... works fine here.

And as a side note, while I agree with Dave, '//' is supported by the MCC18 compiler.
__________________

  #15   Spotlight this post!  
Unread 23-11-2005, 17:01
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: Programming Organization

Quote:
Originally Posted by Mike
Hmm, that's weird... I use avr-gcc (a gcc port for the AVR line of microcontrollers) and it allows the double-slash style.
Quote:
Originally Posted by Ryan M.
Really? Hm... works fine here.
The gcc that failed was version 3.4.2 for ming. I tried it with gcc 3.4.4 for Cygwin and it works fine.

I guess this proves my point that it's best to use the /**/ style for portability
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
Programming Vex w/ MPLab dababyjebus FIRST Tech Challenge 27 25-04-2008 09:11
Programming - Getting Started Mark McLeod Programming 80 16-04-2008 23:37
Organizing a programming team. scitobor 617 Programming 7 28-01-2005 19:18
Team 342 Training and Organization cbolin Team Organization 1 15-01-2005 10:37
Robot Programming Education phrontist Programming 11 03-05-2004 07:32


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

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