texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Refcounting, namespaces, const qualification


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] Refcounting, namespaces, const qualification
Date: Tue, 15 Oct 2002 11:41:26 +0200 (MET DST)

> > > Generally, C++ loves locality: namespaces, member functions, etc...
> > > I think that TeXmacs relies too much on the global namespace.
> > 
> > Right again. During the reorganization, I plan to put virtually all
> > global variables into a few dedicated classes.
> 
> There is a C++ proverb which says "do not use a class when you need a
> namespace". It would be probably easier and cleaner to just put all
> those global variables in a 'TeXmacs' namespace, and maybe some nested
> namespaces (e.g. edit, typeset, gui).
> 
> By the way... enums are namespace savyy, cpp symbols are not.

I just heard from a g++ developer that namespaces can cause severe
problems when porting to Windows. Even though they are standard by now,
we should temporarily be reluctant to use them...

> > > Our point (steph's and I) here is that reference conting must not be
> > > abused, and especially that passing by value of counted pointers is
> > > horrendous. What is importand is PASSING CONTED POINTERS BY REFERENCE.
> > 
> > Yes, but putting const's everywhere in the code makes the code less 
> > readable.
> > I am very much attached to high readability, which does not withstand that
> > I understand your technical arguments.
> 
> We already had this discussion.
> 
> If you think 'const' readuces readability, you may use nested types.
> For example 'in' for const reference (input parameter) and 'io' for
> reference (inout parameter).

I do not want the names of types to get *any* longer,
either by putting a "const" prefix or an ":in" suffix.

> > > Using const-qualification in order to provide more semantically rich
> > > source code is another issue. It is much deeper that just passing
> > > some parameters as const-references, and may require the use of
> > > several new C++ idioms.
> > 
> > Yes, and I want to delay this.
> 
> That is no problem. We all agree there are other priorities, like
> reproducing and fixing those 'random segfaults' problems.

Absolutely, as well as many other things...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]