Code layout and debugging time

Gary W. Swearingen swear at attbi.com
Thu Apr 24 12:37:21 PDT 2003


David Cuthbert <dacut at 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.


More information about the freebsd-chat mailing list