Re: Naming convention for variable holding an eventual reference
Toby Murray <[email protected]>
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 2008-05-16 at 15:21 -0700, Tyler Close wrote: > On Fri, May 16, 2008 at 3:07 PM, Raoul Duke <[email protected]> wrote: > >> Q.post(drum, 'bang', [ 1 ]) > > > > From the perspective of a newbie looking at code which uses that > > style, it sure uses an awful lot of "Q.fn(" everywhere which looks to > > make the code less readable > Ya, that bothers me too. It can be made a little better by adding the > following preamble to your Javascript file > > var page = Q.connect(window.location.toString()) > var drum = post(page, 'subject', []) > var hits = get(drum, 'hits') > > post(drum, 'bang', [ 1 ]) > > when(get(drum, 'hits'), function (value) { > print(value); > }, function (reason) { > print('rejected: ' + reason); > }) > This still looks worse (to me) than the original. Can someone elaborate on the problem with _ in Caja? Could one use "_r" (remote, or "ref") as a suffix instead? I presume this sort of thing has been dismissed for reasons unknown.