Skip site navigation (1)Skip section navigation (2)
Date:      24 Apr 2003 12:37:24 -0700
From:      swear@attbi.com (Gary W. Swearingen)
To:        David Cuthbert <dacut@kanga.org>
Cc:        chat@freebsd.org
Subject:   Re: Code layout and debugging time
Message-ID:  <7rr87radqj.87r@localhost.localdomain>
In-Reply-To: <3EA7441F.9080903@kanga.org>
References:  <5.0.2.1.1.20030422171035.01c5e258@popserver.sfu.ca> <5.0.2.1.1.20030422205617.0387b378@popserver.sfu.ca> <3EA5A53F.3016395C@mindspring.com> <3EA7441F.9080903@kanga.org>

next in thread | previous in thread | raw e-mail | index | archive | help
David Cuthbert <dacut@kanga.org> writes:

> inline template <class T, class Compare> T * MyContainer::foo() const
> 
> Uh, yeah.  Where's that function/method name again? :-)

That's a big peeve of mine.  Languages should have all declarations
begin with the name of the thing being declared, so hunting for
declarations is easier, especially in black & white.

I haven't thought it through, but I'm guessing that an object-oriented
lanugage like Python could be easily modified to simply have
declarations look like assignments, my_fun = function(a,b,c), my_var =
integer(32), etc.

I wrote a couple of small programs using this macro

    #define __(x,y) y x

so I could keep the non-name junk at the end.  IIRC, it worked best
(esthetically) to use "__()" around most non-control statements whether
or not it was a declaration, but I didn't do enough programming to know
if the improved readability was worth the trouble of using the macro.
Unlikely, and it's no good for code to be shared with others, of course.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7rr87radqj.87r>