Coding Guidelines.... 
Author Message
 Coding Guidelines....

Hello,

Please indicate if there any  C Coding Guidelines available on net.

- Bhanu



Sat, 17 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

Quote:

> Please indicate if there any  C Coding Guidelines available on net.

Hi bhanu,

Normally this is something that each company or programming group
defines for itself. The main general guidelines are that it should
support readability and maintainability by giving the code a
certain fixed form. One widely used form is the style used by
K&R in their book:
  The C Programming Language 2e.
  Kernigan & Ritchie.
  Prentice Hall, 1988.
  ISBN 0-13-110362-8

So you might have a look at this. But be careful major "religious"
international and inter-company wars have been fought over coding
guidelines. Setting them up is a very ungrateful task. I know
because I was condemmed to do it a few years ago. Make it easy
to read, easy to use and as mandatory as possible.

Stephan
(initiator of the campaign against grumpiness in c.l.c)



Sat, 17 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

Quote:

> Hello,

> Please indicate if there any  C Coding Guidelines available on net.

> - Bhanu

There are several, all different.  What's best??  Nobody and everybody
know!!

Best advise:
Code for yourself.  Figure that in 6 months all the code will look
foreign to you and you will need to have it clear enough to understand
it as if it were "new".  If you can't understand the code at "first
sight", what chance do others!!

If  you have some "old" code that you haven't looked at for a while,
look at it and explain it to yourself.  The results can be
enlightening.  If it is "clear" now, it was probably clear then.

As for indenting and the like, again several "styles" abound.  Again,
look at examples of the "style" and see if YOU understand them.  Chances
are that if some manager/idiot decided that removal of unnecessary
blanks made things "faster" you will find that it is harder to
understand.  As an experiment, convert a simple program to "minimum
white space" and make an attempt to understand it.  Then you will
understand.

This is "general" advise.  Others might be more specific.
--
Tom Watson             I'm at work now (Generic short signature)



Sat, 17 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

Quote:

> Check out GNU's coding standard.

You forgot the second step: 'and then burn it.'

--
(cfgwgid)



Mon, 19 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

Quote:


> > Check out GNU's coding standard.

> You forgot the second step: 'and then burn it.'

Ahhhh, a flame, finally ... at first it looked like nobody would
bite :-) Major flame wars have been fought on this subject. A lot
of them here in c.l.c, some in the company I work for, the rest all
around the world.

Maybe you will be able to substantiate your simple flame with
some solid proof ?

Stephan
(initiator of the campaign against grumpiness in c.l.c)



Mon, 19 Feb 2001 03:00:00 GMT  
 Coding Guidelines....


   >

   >
   > > Check out GNU's coding standard.
   >
   > You forgot the second step: 'and then burn it.'

   Ahhhh, a flame, finally ... at first it looked like nobody would
   bite :-) Major flame wars have been fought on this subject. A lot
   of them here in c.l.c, some in the company I work for, the rest all
   around the world.

   Maybe you will be able to substantiate your simple flame with
   some solid proof ?

I thought the point of a flame was that there wasn't any available
solid proof, which was why you had to flame?

Anyway, it's an obvious reference to Linus Torvalds' comment on the
same subject.  What do I win, as we would say on a.s.r?
--
(supporter of the campaign for grumpiness where grumpiness is due in c.l.c)

Please: do not email me copies of your posts to comp.lang.c
        do not ask me C questions via email; post them instead



Mon, 19 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

Quote:




>   > > Check out GNU's coding standard.

>   > You forgot the second step: 'and then burn it.'

>   Ahhhh, a flame, finally ... at first it looked like nobody would
>   bite :-) Major flame wars have been fought on this subject. A lot
>   of them here in c.l.c, some in the company I work for, the rest all
>   around the world.

>I thought the point of a flame was that there wasn't any available
>solid proof, which was why you had to flame?

>Anyway, it's an obvious reference to Linus Torvalds' comment on the
>same subject.  What do I win, as we would say on a.s.r?

Forgive my ignorance, but what are the some of the problems people have with
the GNU coding standard?  I found it to be a pretty reasonable guideline,
containing quite a few helpful tips.

--
Please remove the no.spam from my email address if relpying by email.
Any opinions stated above are MINE and not my employer's.



Mon, 19 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

   Forgive my ignorance, but what are the some of the problems people have with
   the GNU coding standard?  I found it to be a pretty reasonable guideline,
   containing quite a few helpful tips.

I think that the main beef people have with them is the suggested C
indention style, which strikes many people as strange.
--
(supporter of the campaign for grumpiness where grumpiness is due in c.l.c)

Please: do not email me copies of your posts to comp.lang.c
        do not ask me C questions via email; post them instead



Mon, 19 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

Quote:




>    > > Check out GNU's coding standard.

>    > You forgot the second step: 'and then burn it.'

>    Ahhhh, a flame, finally ... at first it looked like nobody would
>    bite :-) Major flame wars have been fought on this subject. A lot
>    of them here in c.l.c, some in the company I work for, the rest all
>    around the world.

>    Maybe you will be able to substantiate your simple flame with
>    some solid proof ?

> I thought the point of a flame was that there wasn't any available
> solid proof, which was why you had to flame?

> Anyway, it's an obvious reference to Linus Torvalds' comment on the
> same subject.  What do I win, as we would say on a.s.r?
> --
> (supporter of the campaign for grumpiness where grumpiness is due in c.l.c)

> Please: do not email me copies of your posts to comp.lang.c
>         do not ask me C questions via email; post them instead

ahh yes.. Linus torvalds coding styles document is a fine document. It is well
written and makes alot of sense. he promotes 8 tabs too :)

Later,
    Raj

--

===============================================================
|'IE brings the web to Unix... isn't that like Ronald McDonald|
|             brings religion to the Pope?' - Seen on Usenet  |
===============================================================
   L I N U X - Fast, Free, Stable. http://www.linux.org.uk



Thu, 22 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

Quote:





>>    > > Check out GNU's coding standard.

>>    > You forgot the second step: 'and then burn it.'

>>    Ahhhh, a flame, finally ... at first it looked like nobody would
>>    bite :-) Major flame wars have been fought on this subject. A lot
>>    of them here in c.l.c, some in the company I work for, the rest all
>>    around the world.

>>    Maybe you will be able to substantiate your simple flame with
>>    some solid proof ?

>> I thought the point of a flame was that there wasn't any available
>> solid proof, which was why you had to flame?

>> Anyway, it's an obvious reference to Linus Torvalds' comment on the
>> same subject.  What do I win, as we would say on a.s.r?
>> --
>> (supporter of the campaign for grumpiness where grumpiness is due in c.l.c)

>> Please: do not email me copies of your posts to comp.lang.c
>>         do not ask me C questions via email; post them instead

>ahh yes.. Linus torvalds coding styles document is a fine document. It is well
>written and makes alot of sense. he promotes 8 tabs too :)

Yes, I like Torvalds coding style too (how the boss wants you to write
kernel ;-). He also states that you shouldn't use that lame c++
hungarian notation (coz the compiler *knows* what type it is ;-)


Thu, 22 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

Quote:


> Yes, I like Torvalds coding style too (how the boss wants you to write
> kernel ;-). He also states that you shouldn't use that lame c++
> hungarian notation (coz the compiler *knows* what type it is ;-)

The C++ language is not responsible for that ugliness. Charles Simonyi
fathered that disease and Microsoft cultivated it into an epidemic.

While C++ certainly has its warts, this isn't one of them.

--
========================================================================

              http://www.geocities.com/ResearchTriangle/6375
        If gcc has ``-Wall'', shouldn't perl have ``-Stallman''?



Thu, 22 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

Quote:

> ahh yes.. Linus torvalds coding styles document is a fine document. It is well
> written and makes alot of sense. he promotes 8 tabs too :)

Can anyone tell me where this document is available?

Thanx
/urs

--
Time is a great teacher, but unfortunately it kills all its pupils.
(H.Berlioz)
----------------------------------------------------------------------------
To reply by e-mail remove REMOVE. and .NOSPAM from my mail address



Sun, 25 Feb 2001 03:00:00 GMT  
 Coding Guidelines....

Quote:

>> ahh yes.. Linus torvalds coding styles document is a fine document. It is well
>> written and makes alot of sense. he promotes 8 tabs too :)

>Can anyone tell me where this document is available?

As it happens to be my favorite Codeing Style doc too...
It is in the Linux Kernel Source code as:
        Documentation/CodeingStyle
If you don't have a copy of the Linux Kernel source...and don't feel
like a 6 MB download,
you can browse the source (albeit a slightly old version) at:
        http://sunsite.unc.edu/linux-source/
-Steve

--

E-mail "Bumper Stickers":
"A FREE America or a Drug-Free America: You can't have both!"
"honk if you Love Linux"



Tue, 27 Feb 2001 03:00:00 GMT  
 Coding Guidelines....
I recommend the book "Writing Solid Code" by Steve Maguire.  Adopting
his pointers will go a long way toward preventing bugs, or finding
them automatically.

As for code layout, tastes differ.  However, please look for a text
editor that will make the style easy to maintain.  Emacs makes the
funky GNU style much easier to live with.  (However, like every other
aspect of emacs, you can probably persuade it to generate your
favorite style instead.)

                        - Jim Van Zandt



Tue, 06 Mar 2001 03:00:00 GMT  
 
 [ 24 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Coding guidelines (was: Please, exchange experience on this

2. C coding guidelines

3. Pointer to Coding Guidelines/Standards

4. C Coding GuideLines

5. ANSI Coding Guidelines

6. C Code Guidelines

7. C Coding Guidelines for education

8. C# coding guidelines

9. naming/coding guidelines?

10. Coding Guideline for C#

11. Guidelines for Good C code

12. Any Guidelines on Source Code Documenting?

 

 
Powered by phpBB® Forum Software