Re: Organisation of C programs
From: Rowland (banksr0_at_hotmail.com)
Date: 07/28/04
- Next message: Arthur J. O'Dwyer: "Re: An interview question."
- Previous message: Thomas Matthews: "Re: An interview question."
- In reply to: Thomas Matthews: "Re: Organisation of C programs"
- Next in thread: Christopher Benson-Manica: "Re: Organisation of C programs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Jul 2004 14:40:07 +0000 (UTC)
"Thomas Matthews" <Thomas_MatthewsSpitsOnSpamBots@sbcglobal.net> wrote in
message news:htONc.1120$uC7.1051@newssvr19.news.prodigy.com...
> Richard Evans wrote:
>
<snip>
> > So now I am looking for resources describing how to layout and
> > organize the parts of a program into subdirectories, how to
> > include exported library headers, local headers and the overall
> > collection of common includes, include guards, and preprocessor
> > statements.
> >
<snip>
> This becomes a religious issue: everybody has their own
> belief as to what is correct.
>
> A common layout is:
> Project
> |
> +-------
> | |
> docs source
> |
> ----- include
> Where the source contains all the ".c" files and the
> include contains all the ".h" or header files.
>
> I favor grouping by theme:
>
> |
> +-------------+---+----+--------+------------->
> | | | |
> utilities Flash UART Containers
>
> In my opinion, this allows for better reuse of code.
> Just point the search path to the correct directories.
> I believe that processor specific code should be in
> sub-directories under the themes (such as utilities
> using processor specific features or assembly language).
>
> I've only had one shop agree to to this. Most prefer to
> dump all the files into one directory per project. That
> way all the files can be easily duplicated for another
> project (that is their definition of code reuse).
>
> --
> Thomas Matthews
>
I really like that, and think I might start doing it that way in future.
I've always tended to do it on a per-project basis, like you first
described. I would store all my projects in their own subdirectories of
\dev\null, but, as you say, code-reuse was impossible...
- Next message: Arthur J. O'Dwyer: "Re: An interview question."
- Previous message: Thomas Matthews: "Re: An interview question."
- In reply to: Thomas Matthews: "Re: Organisation of C programs"
- Next in thread: Christopher Benson-Manica: "Re: Organisation of C programs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|