|
Boost : |
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2005-07-15 16:34:52
> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Rob Stewart
> > As a sidenote I kind of doubt that making there usage looking
> > syntactically diffferent from function calls will educate
> users about
> > the way they work. To me doing away with the usual "macros are evil"
> > attitude" sounds like a lot more promising approach to me.
>
> I was thinking similarly.
>
> First, Paul contends you can fix code indenters, but how?
> Really, when an editor sees a line that has no statement
> ending token, it has to assume it continues the previous
> line.
Any kind of tool that does analysis on C or C++ code, even if only at a
syntactic level, has to be able to see through macro expansion. This is a
result of the syntax not being static. I.e. the syntax is not represented by
the source code, but is derived from the source code by a preprocessor.
> After all, whitespace can appear throughout C++ code.
> I see no way for an indenter to "Do the Right Thing(TM)" in this case.
It has to be able to do macro expansion, it's that simple. Whether or not that
easy to integrate is another story, but it isn't impossible. Anything less just
means it is an robust, but generic, editor, rather than a robust C++ editor.
> Second, adding or omitting a semicolon will *not* change a
> programmer's understanding of the preprocessor. I know many
> programmers who will simply add a semicolon or not as the
> compiler and indenter dicate. They won't give it any more
> thought than that.
I have a serious problem catering to people that don't care also. I don't have
a problem with making them work a little as a result of the apathy.
Regards,
Paul Mensonides
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk