Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 25572 invoked from network); 30 Dec 2008 00:12:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Dec 2008 00:12:06 -0000 Received: (qmail 52743 invoked by uid 500); 30 Dec 2008 00:12:05 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 52702 invoked by uid 500); 30 Dec 2008 00:12:05 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 52691 invoked by uid 99); 30 Dec 2008 00:12:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Dec 2008 16:12:05 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of antony.blakey@gmail.com designates 209.85.198.234 as permitted sender) Received: from [209.85.198.234] (HELO rv-out-0506.google.com) (209.85.198.234) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Dec 2008 00:11:57 +0000 Received: by rv-out-0506.google.com with SMTP id g37so4730511rvb.35 for ; Mon, 29 Dec 2008 16:11:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=f8AuaFqWXdt2einjpY3eZmVGwGYn5MJV8HqDqQroRnk=; b=ipeHrq8y9tPDYipQXfzrodHO9uVq8PUq7liE1+iOashhYAGwNWHQfsPn14zjCoZMv+ 7BBBbodDdzHmy0N0bijss/PMyNBjd6SwcLTa/3firn9i9l4gO6Iv9d51hRcK7rx9NS/g gjaBn+rxAK625YfwyUbe26PEt/4JYIlgYoSqM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=Hj6GtO7PHuivA/qlUm/n22m+kQeLo2r08BW/BIkQWwJIBYTOcFlyq8vcSRsmR2rGBb xZAZiicF/EKuo+gcKRLiSj4jXRas1sKGZKx97C6MIYguT31DgIP4I8dNVd57SMRC34I6 AFH9BYqmF2lS9Ord4fBBDjANPguMzGA1wsqxw= Received: by 10.140.139.6 with SMTP id m6mr6972920rvd.234.1230595897418; Mon, 29 Dec 2008 16:11:37 -0800 (PST) Received: from ?192.168.0.16? (ppp121-45-96-203.lns10.adl6.internode.on.net [121.45.96.203]) by mx.google.com with ESMTPS id f21sm36434385rvb.7.2008.12.29.16.11.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 29 Dec 2008 16:11:37 -0800 (PST) Message-Id: <518EA584-E39C-4362-A73E-39D95784028D@gmail.com> From: Antony Blakey To: user@couchdb.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: Changing rev to _rev in view results (Was: Re: newbie question #1) Date: Tue, 30 Dec 2008 10:41:32 +1030 References: <98979283-BB61-4D15-AF05-196979FA42BC@pobox.com> <49C5583B-254D-4D4D-A4F7-AD7306E758F1@gmail.com> <8A2A146E-F011-4502-9DD9-336300392CDC@apache.org> <0743DF91-9015-43DD-9A0F-7E79D6DF4632@gmail.com> <0DE02009-32CB-4A88-8C39-7942E00BF8D6@apache.org> <15C26192-DBC1-4256-85C4-E9C005BFE3E3@gmail.com> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org On 30/12/2008, at 10:21 AM, Chris Anderson wrote: > On Mon, Dec 29, 2008 at 3:38 PM, Antony Blakey > wrote: > >> How is it 'easier to work with'? How does using _id and _rev >> everywhere make >> it not easy? Surely it's not the difficulty of writing code? > > I argued in IM with Jan, that having _id and _rev only appear with > prefixes in the context of a document, makes for a primitive type > system. Any JSON object with _id and _rev fields is a CouchDB > document. Where those same values appear elsewhere they are not > prefixed, and it's not a document. > > I think it's nice that code which is designed to process documents > will hit a speed bump if it is passed view rows. Duck typing is a > fundamental advantage of JSON, and CouchDB's makes good use of it. > It's nice to know by looking if you have a document on hand. A similar argument could be applied to having _id and _rev everywhere, on the basis that it types the atom - wherever you see _id you know you have a document id, and similarly with _rev. And it makes it easier to write generic code that deals with ids and revs, because such code doesn't have to be aware of the context of either it's input or output. Antony Blakey -------------------------- CTO, Linkuistics Pty Ltd Ph: 0438 840 787 Isn't it enough to see that a garden is beautiful without having to believe that there are fairies at the bottom of it too? -- Douglas Adams