C++ Logo

sg20

Advanced search

Re: [isocpp-ext] namespace composition

From: Bjarne Stroustrup <bjarne_at_[hidden]>
Date: Mon, 1 May 2023 20:39:21 -0400
Unfortunately, I'm not in a position to try out this approach on real
students. My experience is that namespaces are seen as mysterious and
scary, but I don't know if that would be so if they were used in simple
ways from day #1. Also, in a large mixed group. there will be many who
come with some experience and some preconceived ideas.

On 5/1/2023 6:35 PM, Ville Voutilainen via SG20 wrote:
>> Namespaces are one of those things. Bjarne’s approach is to remove them for introductory treatment while I treat “std::” as just part of the name of things in C++.
> I love this approach. At least for some things, I've found it much
> more productive in software houses to say, when people ask
> e.g. "how to make std::foo and boost::bar shorter?", "just don't, it's
> much less trouble that way". That doesn't apply universally
> to deeply nested namespaces, but it sure works great for those two
> examples and more. It's unfortunate when one has to
> unteach a desire to shorten as far as possible, because at some point
> it's actually less readable.
>

Received on 2023-05-02 00:39:23