couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@apache.org>
Subject Re: code style
Date Thu, 20 Jan 2011 14:18:34 GMT
Btw, related, the new replicator adds two new header files:
couch_replicator.hrl and couch_api_wrap.hrl. This is to avoid having
every single record in couch_db.hrl.

On Thu, Jan 20, 2011 at 1:57 PM, Adam Kocoloski <kocolosk@apache.org> wrote:
> I'd go a little further.  I think CouchDB should have two include files:
>
> include/couch_db.hrl (I'd prefer couch.hrl but I think we might be stuck w/ this)
> src/couch_int.hrl (name is not important)
>
> The first one would contain all record definitions needed to interact with CouchDB from
Erlang.  The second would contain macro definitions and records that are not supposed to
be exported.  Moving couch_db.hrl to include/ would eventually allow other applications to
point to couch_db.hrl using the -include_lib directive instead of specifying the absolute
path to the header.  Regards,
>
> Adam
>
> On Jan 20, 2011, at 8:29 AM, Benoit Chesneau wrote:
>
>> Actually we are using ?b2l/?l2b and some other macros to make the code
>> shorter and ease our development. All these macros are in the main
>> include file couch_db.hrl used everywhere in the code.
>>
>> Since this include will be likely used in CouchDB plugins created by
>> users, I would like to have these kind of macros separated in their
>> own include file. Something common in C world. The main reason is to
>> not pollute namesspacing in external plugins and let them import only
>> what they need, ie couchdb types/records.
>>
>> What do you think about it? Also, not related but maybe it could be a
>> good practice to enforce the use of these macros in all the couchdb
>> codebase like suggest filippe.
>>
>> Any thoughts ?
>>
>> - benoît
>
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Mime
View raw message