|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#2
|
||||||
|
||||||
|
Re: Coding / Style Standards for sharing C code
Quote:
...so, I suppose we will have to have several license levels based on some combination of the author's wishes and the license that the software was developed from (some maybe license free, some maybe gpl, some with other licenses). BOTTOM LINE: I don't really want to hash all these details out here in public on the CD forum without some strong leadership. I am BEGGING for someone (or group of someones) who really have their arms around all these issues to do some serious noodling on this topic and then come back with a workable solution (perhaps with open comment periods, etc.). Will some of you bit heads grab the reins on this one? Please? Joe J. |
|
#3
|
|||||
|
|||||
|
Re: Coding / Style Standards for sharing C code
I also am a "free software" proponent. I like a community produced final product.
I don't mind producing a draft coding standard for community review. In my experience however, only a dedicated few will actually spend the time to read through such a thing. Unless maybe it fits on a single page. At work coding standards get enforced because they have teeth and are verified through peer or QA code reviews. Only after a while does it become habit or second-nature. I don't believe that's a model that will take root in FIRST, although, it would give students a nice exposure to "standard" business practices. It's more a Team enforceable thing because the Teams changeover so much every year. I don't know who would reject a really sweet piece of code because it didn't comply with the coding standard. -The easiest document to agree on will probably be generic coding conventions. -A second standard could address FIRST robotic specific standards. For example, one of the most common issues this past season was the pwm definition dichotomy of (0 to 254) or (-127 to 127). My Teams switched to standard math (-127 to 127), but whenever I helped students with questions on CD I'd have to convert the code back (0 to 254) and I introduced silly mistakes sometimes. However, both these "standards" are defined and demonstrated by the default code released by Innovation FIRST. The IFI default code will always define the de facto coding standard. The active CD community is somewhat smaller since the season has ended, so if we decide to do something like this we will have to contact the most active experienced programmers directly for their input. Last edited by Mark McLeod : 29-04-2004 at 12:52. |
|
#4
|
|||||
|
|||||
|
Re: Coding / Style Standards for sharing C code
Quote:
I know I would follow it when I contribute to the library and use it at the stadard when teaching the students I mentor. EDIT: Quote:
Last edited by MikeDubreuil : 29-04-2004 at 12:50. |
|
#5
|
||||||
|
||||||
|
Re: Coding / Style Standards for sharing C code
Okay, Mark is one. How about some more folks? Dave Flowerday? Kevin Watson? How about someone from IFI -- that would be nice? Mike Betts, are you listening? Jason Morella & Dave Lavery, you were advocating a pretty strongly for some code sharing, perhaps you folks are not the right people, but you can find a body fill the seat and start rowing can't you?
I am hoping for a group of 5 or so folks to make this happen. I am thinking that Brandon can make you folks a special (private or moderated -- your choice) forum to allow you to get some things hashed out quickly. Perhaps I will host some conference calls at the start and as needed after that, but others are going to have to carry the ball down the field. Volunteer now! Joe J. |
|
#6
|
||||
|
||||
|
Re: Coding / Style Standards for sharing C code
Quote:
Also, I've mentioned it before I think, but there's a wonderful little tool available for Unix/Linux and Cygwin that could be useful here - it's called "Artistic Style" and it will reformat code to a certain standard - it lets you specify tabs versus spaces, indent levels, whether to attach braces or put them on the next line, etc. I use it at work quite a bit to easily bring outside code at least that much closer to the rest of ours. |
|
#7
|
|||||
|
|||||
|
Re: Coding / Style Standards for sharing C code
I too would be willing to contribute to this effort. I like the idea of using a program to "beautify" the code before submitting it. I also believe that we should have some kind of rating system so that it is easier to identify the value of contributions to the community. It would make it easier to maintain the repository over the long haul. Anyone that downloads the code would be asked to rate it on several metrics like quality of code, clarity of documentation, value of functionality, etc.
I too, like Dave, do this kind of thing for a living. |
|
#8
|
||||
|
||||
|
Re: Coding / Style Standards for sharing C code
If you give the teams a reason to use the "CD Standard" then they will use it.
For instance, we create a code depository with every single line of code following the "CD Standard." We also get IFI, or someone who can work closely with IFI to set the default code up in the "CD Standard." Furthermore, make sure that teams can "drag and drop" code from the depository into the default code with little to no effort at all, so that teams can quickly get a working program. When you set things up, and, well, force the teams to use the "CD Standard," most teams will follow suite and use it. Also, perhaps make a rule that any true C code (not pseudo-code, for obvious reasons) must be in the "CD Standard" for us to quickly give help and answers. Another forum I frequent (Gentoo Linux Forums, http://forums.gentoo.org), the forum members usually ask for posters to remove comments from their configuration files so they don't waste everyones' time by making them re-read all the comments in XF86Config again. It's a simple request, and yes, it's not the nicest thing to do, but it enforces the standard, which in the end, should make it easier for everyone. The thing about a standard is, everyone has to use it, or else it's not really a standard, and you've just basically wasted your time, and we all know that from January to late February, we don't have any time to waste . |
|
#9
|
||||
|
||||
|
Re: Coding / Style Standards for sharing C code
Quote:
-Kevin |
|
#10
|
|||||
|
|||||
|
Re: Coding / Style Standards for sharing C code
Quote:
I also agree with employing a "Pretty Print" style clean-up program as Dave suggested to make it easier to be sure new code adheres to the CD standard. And Gene's rating system is interesting. I think the coding standard itself will be fairly easy to define. For general consumption I think we'll need to be able to condense the major points to one or two sheets of bullets that is then backed by the in-depth standard definition and reasoning. [edit] We'll need to think hardest about platform (PIC) specific and IFI specific standards. Last edited by Mark McLeod : 29-04-2004 at 18:52. |
|
#11
|
||||
|
||||
|
Re: Coding / Style Standards for sharing C code
Quote:
Quote:
|
|
#12
|
|||||
|
|||||
|
Re: Coding / Style Standards for sharing C code
Quote:
|
|
#13
|
|||||
|
|||||
|
Re: Coding / Style Standards for sharing C code
We probably should address repository, software licenses, the rating system, and other side-issues in either the original thread or in new threads and keep this one focused purely on coding standards. Since the original thread was co-opted we might want to start a new thread with a title like "Code Repository."
Okay, let's think about this.
-Utilities like "Artistic Style" and lint. -Design standards (now some of these might be overkill for FIRST) like:
If we can get through some initial brainstorming we can start to divide and conquer the problem. Last edited by Mark McLeod : 29-04-2004 at 20:05. |
|
#14
|
||||||
|
||||||
|
Re: Coding / Style Standards for sharing C code
Okay, here is what I think I hear so far:
Marc McLeod is in. gwross is in. Dave Flowerday is in. Kevin Watson has not declared himself as "IN" but is at least making suggestions. Many others are also interested at least in terms of comments and suggestions. I am still waiting to hear from the Jason Morella/Dave Lavery collective to see if they have a rep they want on. I am going to see if I can get on of the C guys from my team to "volunteer" I also need to get in contact with Innovation First -- Perhaps we can get Bob and Tony to volunteer Mark Lambert or one of there other coders to the project. There have been a lot of discussion/suggestions on this thread, but as I have said many times, I don't really want to solve the problem here. I think the purpose of this thread should be to firm up the group of people that are going to take ownership of this thing and propose a big picture solution. Joe J. |
|
#15
|
|||||
|
|||||
|
Re: Coding / Style Standards for sharing C code
It's hard to restrain myself from start to throwing ideas around as I think of them. I'll restrain myself. I'm camping this weekend anyway, so I'll be out-of-touch until Monday.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| heres the code. y this not working | omega | Programming | 16 | 31-03-2004 15:18 |
| Inserting Naviagation code into Default code? | actorindp | Programming | 3 | 28-01-2004 18:12 |
| Help On Coding 2K1 Controller | GregTheGreat | Programming | 9 | 05-12-2003 18:35 |
| style | srawls | Programming | 19 | 23-05-2002 17:02 |