From mboxrd@z Thu Jan 1 00:00:00 1970 Mime-Version: 1.0 (Apple Message framework v623) In-Reply-To: <536d93713f9b4b3342371dc409ee1545@9netics.com> References: <536d93713f9b4b3342371dc409ee1545@9netics.com> Content-Type: text/plain; charset=US-ASCII; format=fixed Message-Id: <3b9009a1d7e95196538ff9a7b2e8e7fe@gmail.com> Content-Transfer-Encoding: 7bit From: Don Bailey Subject: Re: [9fans] Function args not checked Date: Mon, 17 Apr 2006 14:43:13 -0600 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Topicbox-Message-UUID: 3899b5da-ead1-11e9-9d60-3106f5b1d025 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > variable naming conventions are not enforced by the compiler; they > could be misleading. why not use an ide - e.g. eclipse is available > for many platforms - or just document the code. using cweb will > exhibit your STRONG commitment to good documentation :) > I used to have a problem deciding how to keep track of IN and OUT arguments in functions. Rather than bothering to clutter up prototypes with names, I came up with this simple technique: for anyfunction(IN * A, IN * B, IN * C, OUT * A) Variables used as input to the given function will be sent first, in alphabetical order by type. Output variables will be sent next, alphabetically by type. Thus, str->dup(char *, char ** ); Even without the second indirection giving us an obvious clue, we know that the first variable is input and the second is output. Because I stick to this as a strict part of my API, I never have to check the source to remind myself what I'm doing. Just thought I'd give my two cents. Don "north" Bailey -----BEGIN PGP SIGNATURE----- Version: PGP Desktop 9.0.6 (Build 6060) iQA/AwUBREP94V/Ie1ANMtLuEQIVtQCfVWiWpqI6Tm0/mhhGFYGw82vPdJMAn24k t6Kdoj1SWPR9iuSEGOc1/NGd =6JoQ -----END PGP SIGNATURE-----