From: Jameson Graef Rollins Date: Thu, 17 May 2012 16:45:01 +0000 (+1700) Subject: Re: [PATCH 4/6] cli: intialize crypto structure in show and reply X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=fbf374cefb0a190809948ee76fd57baba2d2cb26;p=notmuch-archives.git Re: [PATCH 4/6] cli: intialize crypto structure in show and reply --- diff --git a/2d/ea15ce5771f765cc6f41ce590826c921608c8d b/2d/ea15ce5771f765cc6f41ce590826c921608c8d new file mode 100644 index 000000000..c2890550e --- /dev/null +++ b/2d/ea15ce5771f765cc6f41ce590826c921608c8d @@ -0,0 +1,114 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id A080A431FAF + for ; Thu, 17 May 2012 09:45:17 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.29 +X-Spam-Level: +X-Spam-Status: No, score=-2.29 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3, T_MIME_NO_TEXT=0.01] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id GchX7x2KvnRx for ; + Thu, 17 May 2012 09:45:15 -0700 (PDT) +Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu + [131.215.239.19]) + by olra.theworths.org (Postfix) with ESMTP id C0B73431FAE + for ; Thu, 17 May 2012 09:45:15 -0700 (PDT) +Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1]) + by earth-doxen-postvirus (Postfix) with ESMTP id A411B66E01D3; + Thu, 17 May 2012 09:45:08 -0700 (PDT) +X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new +Received: from finestructure.net (rrcs-24-103-26-131.nyc.biz.rr.com + [24.103.26.131]) (Authenticated sender: jrollins) + by earth-doxen-submit (Postfix) with ESMTP id 927D866E018C; + Thu, 17 May 2012 09:45:05 -0700 (PDT) +Received: by finestructure.net (Postfix, from userid 1000) + id B1120340; Thu, 17 May 2012 09:45:03 -0700 (PDT) +From: Jameson Graef Rollins +To: Jani Nikula +Subject: Re: [PATCH 4/6] cli: intialize crypto structure in show and reply +In-Reply-To: + +References: <1337205359-2444-1-git-send-email-jrollins@finestructure.net> + <1337205359-2444-2-git-send-email-jrollins@finestructure.net> + <1337205359-2444-3-git-send-email-jrollins@finestructure.net> + <1337205359-2444-4-git-send-email-jrollins@finestructure.net> + <1337205359-2444-5-git-send-email-jrollins@finestructure.net> + <8762bvi70k.fsf@nikula.org> + <877gwaeve1.fsf@servo.finestructure.net> + +User-Agent: Notmuch/0.12+183~g9d5ff3c (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Thu, 17 May 2012 09:45:01 -0700 +Message-ID: <87aa16daeq.fsf@servo.finestructure.net> +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + micalg=pgp-sha256; protocol="application/pgp-signature" +Cc: Notmuch Mail +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 17 May 2012 16:45:17 -0000 + +--=-=-= + +On Thu, May 17 2012, Jani Nikula wrote: +> The values are not undefined, they are properly initialized, and we can +> count on it. For sure, not maybe. If you want to explicitly set them for +> clarity, it's a matter of taste. Personally I find it too verbose, but then +> again notmuch code is generally fairly verbose. + +I want them explicitly set for clarity, as well as safety. Code is +meant to be read by humans, not computers. Brevity is not always a +virtue if it sacrifices clarity. It's much nicer to have the defaults +clearly stated in the initialization, than to force the reader to +understand how the initialization works and to interpret what that means +for the current case. I also don't think it's safe to assume that the +variables will be always be "properly" initialized in your favor in +perpetuity. It's much safer to explicitly set them to what you want +them to be rather than just assume they'll be set correctly. + +> If you insist on it, please at least drop the extra temp crypto +> variable, and initialize the struct in one initializer. + +I don't see why this matters either. Again, I think this is just a +matter of taste. I would rather the code be verbose where clarity +requires it, rather than always trying to make the code as terse as +possible. + +jamie. + +--=-=-= +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.12 (GNU/Linux) + +iQIcBAEBCAAGBQJPtSsNAAoJEO00zqvie6q8EUAQAJnXcl3gyfVqUNY0c6BCOn1f +EIk+M5rz0gXAhJLo/k2yUuk4SuGiF0K20ZeUyy9Vf59y5LnazJsgsirzM4LqdZ0B +UxlBmlNz7K7MbIB3X3qOAc/PA2V2zRbSNMuO7yhr8l2Q7/E82tEL+2cIBNpplWVM +zAXPp2UI+j7fgHuYjwYt4Rr5qaqb5VR4Ix6qQP5ErjEQFDDm/Q3RAU9no+mP6XHQ +8yWHvYBaOaMdPOCAuPIl5UmFfuDsQ1wxBB5sLH9omkzzIQn1VynTqq7Is2PLYwm8 +0RR/NbblYKJmHpnny3Seabzv+6J3DD7ZmeW7K3fHEBHs582VwaojS+GRvZJrzDJ+ +UbDDxRDyMvKxr4Q1QH13doqcJ8p4en3HpFanY2mGIR4je/b295b9nUZnuFh2e5Un +FoPim91THuUhFabIw6nNWZN7j2qCdcMwalTYql++Xi4Pb3fAWZNSgrXnN+nojxWy +9dTsKLFD3Xv/Ae7/CinebSQUV7oBngvfRvmtTR8E3F39zLl9ZN0XD576Y3GwMFT7 +w6wj1hLP1dTjIvlhaLynwsUcYDK4Veq9nGGe4RKYhEXQAHaNOeAHdBVPIR2JX3+Z +Y/rU817v3mU7dR7ddB4b7/K5j8J/65DDQK4FX3XEqacdJpgsbRM806mtjx/CvAG5 +mRST4o7lxkZoe0UbWUk9 +=mD9j +-----END PGP SIGNATURE----- +--=-=-=--