On Mon, Jul 07, 2003 at 10:37:36AM +0200, Lars Gullik Bjønnes wrote:
> | lyx::InsetCode would do for me personally.
> 
> with lyx::insets::Code you could use just Code in a lot of places.

I know.

But even if I am a big fan of short names in the short range, I find them
confusing on a long distance, so long range names better be descriptive.

In fact this  lyx::insets::Code  illustrates nicely the cognitive problem
of deeply nested namespaces:

We'd basically end up with two new words to learn: short distance 'Code'
and long distance 'inset::Code'. Moreover, most of the uses will be just
'Code', so _I_ lose the connection between 'Code' and 'inset'. When I need
it from a long distance, I don't remember the connection or I have actively
think about it. This slows me down.

I am also a bit wary as I did exactly the same thing about three years
ago (I could check CVS for specific dates) in my day time job project - and
undid it shortly afterwards. So this was a complete waste of time.

A specific reason (but not the only one) was that there is no way to put
a single function inside another namespace. So the code was something like

namespace ge {
        namespace comp {
                namespace algo {
                        struct index {};
                }
        }

        namespace io {
                void out(ge::comp::index const &) {...}
                void in(ge::comp::index &) {...}
        }

        namespace comp {
                namespace algo {

                        void implementation_using_index_and_io() {..>}

                }
        }
}

So this is 20 lines just to declare three functions and a struct. No good.

[I think I would try again if the language allowed me to write 

namespace ge::comp::algo {

        struct index {};

        void ::ge::io::out(index const &) {...}
        void ::ge::io::in(index &) {...}

        void implementation_using_index_and_io() {..>}

}

but it doesn't]

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)

Reply via email to