|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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
|
|||||
|
|||||
|
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;
}
Code:
// Good #define PI 3.14 unsigned int some_variable; // Bad #define pi 3.14 unsigned int SOME_vArIABLE; Code:
// Good void Read_Encoder(void) // Bad void ReadEncoder(void) 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) Code:
// Good /* Bad */ 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 Last edited by Mike : 22-11-2005 at 16:23. |
|
#3
|
||||
|
||||
|
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 Last edited by Rickertsen2 : 22-11-2005 at 17:11. |
|
#4
|
|||||
|
|||||
|
Re: Programming Organization
Quote:
![]() |
|
#5
|
|||||
|
|||||
|
Re: Programming Organization
Quote:
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 |
|
#6
|
||||
|
||||
|
Re: Programming Organization
Quote:
Code:
// Good
if(foo == bar)
{
return;
}
// Bad
if(foo == bar){
return;
}
|
|
#7
|
|||||
|
|||||
|
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" |
|
#8
|
|||
|
|||
|
Re: Programming Organization
How would I set up a SVN/Subversion?
|
|
#9
|
||||
|
||||
|
Re: Programming Organization
8 people is quite alot for such a small project. What is the experience level of each member like?
|
|
#10
|
|||||
|
|||||
|
Re: Programming Organization
Quote:
For how to setup a repository see http://subversion.tigris.org/faq.html#repository (how to make Eclipse use it has already been mentioned). |
|
#11
|
|||
|
|||
|
Re: Programming Organization
We are using CVS now as I could not find a free SVN server.
|
|
#12
|
||||
|
||||
|
Re: Programming Organization
Quote:
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
|
|||||
|
|||||
|
Re: Programming Organization
Quote:
But like I said, that is my personal standard. |
|
#14
|
||||
|
||||
|
Re: Programming Organization
Quote:
And as a side note, while I agree with Dave, '//' is supported by the MCC18 compiler. |
|
#15
|
||||
|
||||
|
Re: Programming Organization
Quote:
Quote:
I guess this proves my point that it's best to use the /**/ style for portability ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |