Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #6112 > unrolled thread
| Started by | ruben safir <ruben@mrbrklyn.com> |
|---|---|
| First post | 2011-06-02 21:53 -0400 |
| Last post | 2011-06-27 14:29 -0400 |
| Articles | 20 on this page of 55 — 15 participants |
Back to article view | Back to comp.lang.c++
Anonymous namespace ruben safir <ruben@mrbrklyn.com> - 2011-06-02 21:53 -0400
Re: Anonymous namespace Pete Becker <pete@versatilecoding.com> - 2011-06-02 16:00 -1000
Re: Anonymous namespace ruben safir <ruben@mrbrklyn.com> - 2011-06-02 22:40 -0400
Re: Anonymous namespace ruben safir <ruben@mrbrklyn.com> - 2011-06-03 02:29 -0400
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-03 20:12 +1200
Re: Anonymous namespace Ruben Safir <mrbrklyn@panix.com> - 2011-06-04 02:40 +0000
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 15:40 +1200
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 04:56 +0000
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:19 +1200
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:37 +0000
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:40 +1200
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:05 +0000
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:31 +1200
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:42 +0000
Re: Anonymous namespace Öö Tiib <ootiib@hot.ee> - 2011-06-03 06:08 -0700
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:09 +0000
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:32 +1200
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:39 +0000
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:45 +1200
Re: Anonymous namespace gwowen <gwowen@gmail.com> - 2011-06-03 01:08 -0700
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-03 20:17 +1200
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:08 +0000
Re: Anonymous namespace Victor Bazarov <v.bazarov@comcast.invalid> - 2011-06-03 09:44 -0400
Re: Anonymous namespace Ruben Safir <mrbrklyn@panix.com> - 2011-06-04 02:44 +0000
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 15:57 +1200
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:14 +0000
Re: Anonymous namespace "Bo Persson" <bop@gmb.dk> - 2011-06-04 11:33 +0200
Re: Anonymous namespace Michael Doubez <michael.doubez@free.fr> - 2011-06-03 03:10 -0700
Re: Anonymous namespace Ruben Safir <mrbrklyn@panix.com> - 2011-06-04 02:48 +0000
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 16:01 +1200
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:16 +0000
Re: Anonymous namespace Ian Collins <ian-news@hotmail.com> - 2011-06-04 17:34 +1200
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-04 05:01 +0000
Re: Anonymous namespace Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-09 11:26 +0000
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-10 04:12 +0000
Re: Anonymous namespace Michael Doubez <michael.doubez@free.fr> - 2011-06-10 01:49 -0700
Re: Anonymous namespace mrbrklyn <ceo.brooklyn@gmail.com> - 2011-06-10 10:34 -0700
Re: Anonymous namespace mrbrklyn <ceo.brooklyn@gmail.com> - 2011-06-10 10:45 -0700
Re: Anonymous namespace Michael Doubez <michael.doubez@free.fr> - 2011-06-12 00:01 -0700
Re: Anonymous namespace ruben safir <ruben@mrbrklyn.com> - 2011-06-13 04:08 +0000
Re: Anonymous namespace Michael Doubez <michael.doubez@free.fr> - 2011-06-13 08:43 -0700
Re: Anonymous namespace Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-10 18:27 +0000
Re: Anonymous namespace ruben safir <ruben@mrbrklyn.com> - 2011-06-13 05:02 +0000
Re: Anonymous namespace Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-13 07:58 +0000
Re: "namespaces were a mistake" (was: Anonymous namespace) Öö Tiib <ootiib@hot.ee> - 2011-06-13 09:56 -0700
Re: "namespaces were a mistake" (was: Anonymous namespace) Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-13 19:52 +0000
Re: "namespaces were a mistake" Miles Bader <miles@gnu.org> - 2011-06-14 13:43 +0900
Re: "namespaces were a mistake" Miles Bader <miles@gnu.org> - 2011-06-15 07:15 +0900
Re: "namespaces were a mistake" Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-15 12:01 +0000
Re: "namespaces were a mistake" (was: Anonymous namespace) drew@furrfu.invalid (Drew Lawson) - 2011-06-14 12:24 +0000
Re: "namespaces were a mistake" (was: Anonymous namespace) gwowen <gwowen@gmail.com> - 2011-06-14 06:00 -0700
Re: "namespaces were a mistake" (was: Anonymous namespace) Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-14 14:10 -0700
Re: "namespaces were a mistake" Miles Bader <miles@gnu.org> - 2011-06-15 06:30 +0900
Re: Anonymous namespace Ruben Safir <ruben@mrbrklyn.com> - 2011-06-27 16:34 +0000
Re: Anonymous namespace Victor Bazarov <v.bazarov@comcast.invalid> - 2011-06-27 14:29 -0400
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2011-06-03 20:17 +1200 |
| Message-ID | <94rjklFbjiU8@mid.individual.net> |
| In reply to | #6123 |
On 06/ 3/11 08:08 PM, gwowen wrote:
> On Jun 3, 3:54 am, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
>>> What is the point of the anonymous namespace.
>>
>> Names can be hidden from the linker (from other translation
>> units), even if they should have external linkage.
>
> Can someone give the benefits of external-but-unlinkable anon-
> namespace variables (or functions) against old-school internal linkage
> file-scope "static" variables and functions.
I guess the most common (at least in my case) use is to declare
different classes with a common name in multiple source files. I have
lots of instances of
namespace {
struct TestObject { .. };
}
in my unit test files.
--
Ian Collins
[toc] | [prev] | [next] | [standalone]
| From | Ruben Safir <ruben@mrbrklyn.com> |
|---|---|
| Date | 2011-06-04 05:08 +0000 |
| Message-ID | <iscejm$keo$4@reader1.panix.com> |
| In reply to | #6125 |
On Fri, 03 Jun 2011 20:17:24 +1200, Ian Collins wrote:
> On 06/ 3/11 08:08 PM, gwowen wrote:
>> On Jun 3, 3:54 am, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
>>>> What is the point of the anonymous namespace.
>>>
>>> Names can be hidden from the linker (from other translation units),
>>> even if they should have external linkage.
>>
>> Can someone give the benefits of external-but-unlinkable anon-
>> namespace variables (or functions) against old-school internal linkage
>> file-scope "static" variables and functions.
>
> I guess the most common (at least in my case) use is to declare
> different classes with a common name in multiple source files. I have
> lots of instances of
>
> namespace {
> struct TestObject { .. };
> }
>
> in my unit test files.
YES - I can understand that. Then you can have one in each transitional
unit. The problem arises when you #include two of them from different
files.
[toc] | [prev] | [next] | [standalone]
| From | Victor Bazarov <v.bazarov@comcast.invalid> |
|---|---|
| Date | 2011-06-03 09:44 -0400 |
| Message-ID | <isaofu$m4c$1@dont-email.me> |
| In reply to | #6123 |
On 6/3/2011 4:08 AM, gwowen wrote: > On Jun 3, 3:54 am, r...@zedat.fu-berlin.de (Stefan Ram) wrote: >>> What is the point of the anonymous namespace. >> >> Names can be hidden from the linker (from other translation >> units), even if they should have external linkage. > > Can someone give the benefits of external-but-unlinkable anon- > namespace variables (or functions) against old-school internal linkage > file-scope "static" variables and functions. The Standard prohibits the use of names with no linkage or names with internal linkage as template arguments. Only objects with external linkage are allowed. Hence you can't use a function declared 'static' or a local type as a predicate in 'std::sort', for instance, or as the functor in 'std::for_each', and so on. V -- I do not respond to top-posted replies, please don't ask
[toc] | [prev] | [next] | [standalone]
| From | Ruben Safir <mrbrklyn@panix.com> |
|---|---|
| Date | 2011-06-04 02:44 +0000 |
| Message-ID | <isc66d$b8n$2@reader1.panix.com> |
| In reply to | #6139 |
Victor Bazarov <v.bazarov@comcast.invalid> wrote: > On 6/3/2011 4:08 AM, gwowen wrote: >> On Jun 3, 3:54 am, r...@zedat.fu-berlin.de (Stefan Ram) wrote: >>>> What is the point of the anonymous namespace. >>> >>> Names can be hidden from the linker (from other translation >>> units), even if they should have external linkage. >> >> Can someone give the benefits of external-but-unlinkable anon- >> namespace variables (or functions) against old-school internal linkage >> file-scope "static" variables and functions. > > The Standard prohibits the use of names with no linkage or names with > internal linkage as template arguments. Thanks Victor, but I have limited understanding of internal linkage, and can't see how there can be no linkage to a name. Can you expand on that aspect of the conversation? Ruben > Only objects with external > linkage are allowed. Hence you can't use a function declared 'static' > or a local type as a predicate in 'std::sort', for instance, or as the > functor in 'std::for_each', and so on. > > V
[toc] | [prev] | [next] | [standalone]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2011-06-04 15:57 +1200 |
| Message-ID | <94toq5FivcU2@mid.individual.net> |
| In reply to | #6139 |
On 06/ 4/11 01:44 AM, Victor Bazarov wrote:
> On 6/3/2011 4:08 AM, gwowen wrote:
>> On Jun 3, 3:54 am, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
>>>> What is the point of the anonymous namespace.
>>>
>>> Names can be hidden from the linker (from other translation
>>> units), even if they should have external linkage.
>>
>> Can someone give the benefits of external-but-unlinkable anon-
>> namespace variables (or functions) against old-school internal linkage
>> file-scope "static" variables and functions.
>
> The Standard prohibits the use of names with no linkage or names with
> internal linkage as template arguments. Only objects with external
> linkage are allowed. Hence you can't use a function declared 'static'
> or a local type as a predicate in 'std::sort', for instance, or as the
> functor in 'std::for_each', and so on.
I was going to answer Ruben's last question with an example, but I
couldn't find one that failed to compile with a static function!
This compiles file on everything I tried:
#include <algorithm>
static void test( int ) {}
static bool test1( int, int ) { return true; }
int main()
{
int arr[4] = { 2,1,5,3 };
std::for_each( arr, arr+4, test );
std::sort( arr, arr+4, test1 );
}
--
Ian Collins
[toc] | [prev] | [next] | [standalone]
| From | Ruben Safir <ruben@mrbrklyn.com> |
|---|---|
| Date | 2011-06-04 05:14 +0000 |
| Message-ID | <iscf0i$keo$6@reader1.panix.com> |
| In reply to | #6139 |
On Fri, 03 Jun 2011 09:44:29 -0400, Victor Bazarov wrote: > The Standard prohibits the use of names with no linkage or names with > internal linkage as template arguments. Only objects with external > linkage are allowed. Victor, you must have written the Bloomberg employment examination. :) What does :Only objects with external linkage are allowed. specifically mean? If I create a class and a templated class in the same file, is that not internal and no linkage? Ruben
[toc] | [prev] | [next] | [standalone]
| From | "Bo Persson" <bop@gmb.dk> |
|---|---|
| Date | 2011-06-04 11:33 +0200 |
| Message-ID | <94ucfdFv9lU1@mid.individual.net> |
| In reply to | #6174 |
Ruben Safir wrote: > On Fri, 03 Jun 2011 09:44:29 -0400, Victor Bazarov wrote: > > >> The Standard prohibits the use of names with no linkage or names >> with internal linkage as template arguments. Only objects with >> external linkage are allowed. > > Victor, you must have written the Bloomberg employment examination. > :) > > What does :Only objects with external linkage are allowed. > specifically mean? If I create a class and a templated class in > the same file, is that not internal and no linkage? > The thing with the linkage is that other rules force you to have one defintion of a type with external linkage. You can't have several with different meaning. That will make things like vector<type> mean the same in the whole program. Types with internal or no linkage would break that and make things extremely difficult for the linker. Bo Persson
[toc] | [prev] | [next] | [standalone]
| From | Michael Doubez <michael.doubez@free.fr> |
|---|---|
| Date | 2011-06-03 03:10 -0700 |
| Message-ID | <b339824c-511d-4564-bd89-bf4f07ac3285@h9g2000yqk.googlegroups.com> |
| In reply to | #6112 |
On 3 juin, 03:53, ruben safir <ru...@mrbrklyn.com> wrote:
> what is the anonymous name space and how is it accessed?
In brief, the effect is the same as C 'static' for functions and
global variables.
// not in class of function scope
static int N; // N is only visible in file
static void foo(){ // foo can only be called in file
// ...
}
The interest is that it also work on type definition.
namespace {
// Bar can only be seen in file
class Bar
{
// ...
};
}
And it has also the same side effect that, when included in multiple
translation unit (through a header by example), each translation unit
will have its own definition of the class. This means that, by
example, class member variables are not shared.
--
Michael
[toc] | [prev] | [next] | [standalone]
| From | Ruben Safir <mrbrklyn@panix.com> |
|---|---|
| Date | 2011-06-04 02:48 +0000 |
| Message-ID | <isc6d4$b8n$3@reader1.panix.com> |
| In reply to | #6130 |
Michael Doubez <michael.doubez@free.fr> wrote:
> On 3 juin, 03:53, ruben safir <ru...@mrbrklyn.com> wrote:
>> what is the anonymous name space and how is it accessed?
>
> In brief, the effect is the same as C 'static' for functions and
> global variables.
>
I'm confused because i thought what static did was create a variable
which isn't destroyed between function calls and remembers its state.
How that was accomplished, I'm uncertain of.
> // not in class of function scope
> static int N; // N is only visible in file
>
> static void foo(){ // foo can only be called in file
> // ...
> }
>
> The interest is that it also work on type definition.
>
> namespace {
>
> // Bar can only be seen in file
> class Bar
> {
> // ...
> };
>
> }
>
> And it has also the same side effect that, when included in multiple
> translation unit (through a header by example), each translation unit
> will have its own definition of the class. This means that, by
> example, class member variables are not shared.
I thought class member variables are not shared by defauult?
Ruben
>
> --
> Michael
[toc] | [prev] | [next] | [standalone]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2011-06-04 16:01 +1200 |
| Message-ID | <94tp12FivcU3@mid.individual.net> |
| In reply to | #6165 |
On 06/ 4/11 02:48 PM, Ruben Safir wrote:
> Michael Doubez<michael.doubez@free.fr> wrote:
>> On 3 juin, 03:53, ruben safir<ru...@mrbrklyn.com> wrote:
>>> what is the anonymous name space and how is it accessed?
>>
>> In brief, the effect is the same as C 'static' for functions and
>> global variables.
>>
> I'm confused because i thought what static did was create a variable
> which isn't destroyed between function calls and remembers its state.
> How that was accomplished, I'm uncertain of.
The static keyword suffers from overload abuse. In the global scope, a
static variable has local linkage, at function scope it does as you say
above.
>> // not in class of function scope
>> static int N; // N is only visible in file
>>
>> static void foo(){ // foo can only be called in file
>> // ...
>> }
>>
>> The interest is that it also work on type definition.
>>
>> namespace {
>>
>> // Bar can only be seen in file
>> class Bar
>> {
>> // ...
>> };
>>
>> }
>>
>> And it has also the same side effect that, when included in multiple
>> translation unit (through a header by example), each translation unit
>> will have its own definition of the class. This means that, by
>> example, class member variables are not shared.
>
> I thought class member variables are not shared by defauult?
I assumed he was referring to the member variable declarations.
--
Ian Collins
[toc] | [prev] | [next] | [standalone]
| From | Ruben Safir <ruben@mrbrklyn.com> |
|---|---|
| Date | 2011-06-04 05:16 +0000 |
| Message-ID | <iscf2k$keo$7@reader1.panix.com> |
| In reply to | #6168 |
On Sat, 04 Jun 2011 16:01:38 +1200, Ian Collins wrote: > In the global scope, a > static variable has local linkage, I guess, if you don't mind, I need one more term defintion for "local linkage" Ruben
[toc] | [prev] | [next] | [standalone]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2011-06-04 17:34 +1200 |
| Message-ID | <94tuflFivcU6@mid.individual.net> |
| In reply to | #6175 |
On 06/ 4/11 05:16 PM, Ruben Safir wrote: > On Sat, 04 Jun 2011 16:01:38 +1200, Ian Collins wrote: > >> In the global scope, a >> static variable has local linkage, > > > I guess, if you don't mind, I need one more term defintion for "local > linkage" Not visible to the linker. -- Ian Collins
[toc] | [prev] | [next] | [standalone]
| From | Ruben Safir <ruben@mrbrklyn.com> |
|---|---|
| Date | 2011-06-04 05:01 +0000 |
| Message-ID | <isce6i$keo$2@reader1.panix.com> |
| In reply to | #6112 |
On Fri, 03 Jun 2011 02:07:16 +0000, Stefan Ram wrote:
> namespace unique {} using namespace unique; namespace unique { ... }
ugg - back to the namespace syntax chapter...
[toc] | [prev] | [next] | [standalone]
| From | Jorgen Grahn <grahn+nntp@snipabacken.se> |
|---|---|
| Date | 2011-06-09 11:26 +0000 |
| Message-ID | <slrniv1bef.gtj.grahn+nntp@frailea.sa.invalid> |
| In reply to | #6170 |
On Sat, 2011-06-04, Ruben Safir wrote:
> On Fri, 03 Jun 2011 02:07:16 +0000, Stefan Ram wrote:
>
>
>> namespace unique {} using namespace unique; namespace unique { ... }
>
> ugg - back to the namespace syntax chapter...
If you *do* have a book, it's better to read that rather than to ask
here. "What is a anonymous namespace?" is a pretty basic question, and
any half-decent book will tell you all you need to know.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
[toc] | [prev] | [next] | [standalone]
| From | Ruben Safir <ruben@mrbrklyn.com> |
|---|---|
| Date | 2011-06-10 04:12 +0000 |
| Message-ID | <iss5it$fjr$2@reader1.panix.com> |
| In reply to | #6480 |
On Thu, 09 Jun 2011 11:26:08 +0000, Jorgen Grahn wrote:
>>> namespace unique {} using namespace unique; namespace unique { ... }
>>
>> ugg - back to the namespace syntax chapter...
>
> If you *do* have a book,
Jorgen, do you think I have any C++ references and do you think I read
them. It's irrelevant since the namespace sections in Stroudtrup are
nearly incomprehensible and written more like a dissertation than a
learning tool, and Lippman's book is written just as incomprehensibly,
but like a cookbook, and Deitels is incomplete, although better
organized, and frankly, there isn't a decent C++ text on the market (as
of yet) which is why I have 5 of them opened around my workstation (that
is if you include the templates book). And that is before you get into
any discussion of compiler theory and practice.
Normally I wouldn't make any complaints to responses like this because
I'm grateful for any help I can get an nobody here is on my payroll, so i
appreciate it even more, but FWIW, there have been a number of times this
week where I've seen you post wrong information, so I don't know why your
being so terse as well.
Ruben
[toc] | [prev] | [next] | [standalone]
| From | Michael Doubez <michael.doubez@free.fr> |
|---|---|
| Date | 2011-06-10 01:49 -0700 |
| Message-ID | <e1c05603-ee60-4933-aeaa-c4c92cf5038e@gc3g2000vbb.googlegroups.com> |
| In reply to | #6527 |
On 10 juin, 06:12, Ruben Safir <ru...@mrbrklyn.com> wrote:
> On Thu, 09 Jun 2011 11:26:08 +0000, Jorgen Grahn wrote:
> >>> namespace unique {} using namespace unique; namespace unique { ... }
>
> >> ugg - back to the namespace syntax chapter...
>
> > If you *do* have a book,
>
> Jorgen, do you think I have any C++ references and do you think I read
> them. It's irrelevant since the namespace sections in Stroudtrup are
> nearly incomprehensible and written more like a dissertation than a
> learning tool,
Well, IMHO it is because he explains the namespace functionality in
perspective of the problem it is intended to solve.
> and Lippman's book is written just as incomprehensibly,
> but like a cookbook,
You must be talking about "Essential C++". I rather agree with you.
Some minds prefer a narrative approach.
> and Deitels is incomplete, although better
> organized, and frankly, there isn't a decent C++ text on the market (as
> of yet)
IMO "Accelerated C++" is the best for beginners.
Once you get a little background, the Effective serie of Scott Meyers
and Exceptional serie of Herb Sutter get you up to speed.
If you want to work on template "C++ templates" by Vandevoorde &
Josuttis is the clearer.
[snip]
--
Michael
[toc] | [prev] | [next] | [standalone]
| From | mrbrklyn <ceo.brooklyn@gmail.com> |
|---|---|
| Date | 2011-06-10 10:34 -0700 |
| Message-ID | <16386196-c4c2-4c68-bd37-2f521914eb39@u19g2000vbi.googlegroups.com> |
| In reply to | #6531 |
On Jun 10, 4:49 am, Michael Doubez <michael.dou...@free.fr> wrote:
> On 10 juin, 06:12, Ruben Safir <ru...@mrbrklyn.com> wrote:
>
> > On Thu, 09 Jun 2011 11:26:08 +0000, Jorgen Grahn wrote:
> > >>> namespace unique {} using namespace unique; namespace unique { ... }
>
> > >> ugg - back to the namespace syntax chapter...
>
> > > If you *do* have a book,
>
> > Jorgen, do you think I have any C++ references and do you think I read
> > them. It's irrelevant since the namespace sections in Stroudtrup are
> > nearly incomprehensible and written more like a dissertation than a
> > learning tool,
>
> Well, IMHO it is because he explains the namespace functionality in
> perspective of the problem it is intended to solve.
>
> > and Lippman's book is written just as incomprehensibly,
> > but like a cookbook,
>
> You must be talking about "Essential C++". I rather agree with you.
> Some minds prefer a narrative approach.
>
> > and Deitels is incomplete, although better
> > organized, and frankly, there isn't a decent C++ text on the market (as
> > of yet)
>
> IMO "Accelerated C++" is the best for beginners.
>
> Once you get a little background, the Effective serie of Scott Meyers
> and Exceptional serie of Herb Sutter get you up to speed.
>
> If you want to work on template "C++ templates" by Vandevoorde &
> Josuttis is the clearer.
>
> [snip]
>
> --
> Michael
I don't want to be critical of texts I haven't explored, but I've
spent a good deal of time
pouring over books at the Big College Barnes and Nobles on 5th avenue
and 17th street that
supplies nearly a
[toc] | [prev] | [next] | [standalone]
| From | mrbrklyn <ceo.brooklyn@gmail.com> |
|---|---|
| Date | 2011-06-10 10:45 -0700 |
| Message-ID | <cccdc871-38fa-4364-a28d-f588851def71@f11g2000vbx.googlegroups.com> |
| In reply to | #6531 |
On Jun 10, 4:49 am, Michael Doubez <michael.dou...@free.fr> wrote:
> On 10 juin, 06:12, Ruben Safir <ru...@mrbrklyn.com> wrote:
>
> > On Thu, 09 Jun 2011 11:26:08 +0000, Jorgen Grahn wrote:
> > >>> namespace unique {} using namespace unique; namespace unique { ... }
>
> > >> ugg - back to the namespace syntax chapter...
>
> > > If you *do* have a book,
>
> > Jorgen, do you think I have any C++ references and do you think I read
> > them. It's irrelevant since the namespace sections in Stroudtrup are
> > nearly incomprehensible and written more like a dissertation than a
> > learning tool,
>
> Well, IMHO it is because he explains the namespace functionality in
> perspective of the problem it is intended to solve.
>
> > and Lippman's book is written just as incomprehensibly,
> > but like a cookbook,
>
> You must be talking about "Essential C++". I rather agree with you.
> Some minds prefer a narrative approach.
>
> > and Deitels is incomplete, although better
> > organized, and frankly, there isn't a decent C++ text on the market (as
> > of yet)
>
> IMO "Accelerated C++" is the best for beginners.
>
> Once you get a little background, the Effective serie of Scott Meyers
> and Exceptional serie of Herb Sutter get you up to speed.
>
> If you want to work on template "C++ templates" by Vandevoorde &
> Josuttis is the clearer.
>
> [snip]
>
> --
> Micha
I don't want to be critical of texts I haven't explored, but I've
spent a good deal of time
pouring over books at the Big College Barnes and Nobles on 5th avenue
and 17th street that supplies nearly all the universities in Manhattan
and the
picking is slim. The Template book approaches usability.
Three things are wrong with the majority of texts:
A) They assume you are an experienced C programmer.
B) They lack a definitive appendix of all the standard libraries ...
precisely. The appendix in most of these books are endless jabbering
of semi-thought out expressions of complex ideas.
C) The utterly fail to teach fundamentals. Fundamentals...this is a
compiler. This is an editor.
D) They fail to teach theory.
I have a doctoral in Pharmaceutics and if my text on differential
equations were like that, I'd have difficult time graduating.
But I'll look at your suggestions although the idea, "get you up to
speed" would ordinary be exactly what I don't want. If I want to get
up to speed fast, one can drop back down to perl.
The gold standard for programming text books that I've seen so far is
Kings' C programming. Its an expensive little book that I've brought
three times now since it keeps disappearing from the NYLXS library.
If someone would essentially take that format and adopt it to C++,
life would be grand.
http://knking.com/books/c/
Ruben
[toc] | [prev] | [next] | [standalone]
| From | Michael Doubez <michael.doubez@free.fr> |
|---|---|
| Date | 2011-06-12 00:01 -0700 |
| Message-ID | <360bf0e1-6faf-4b52-bb08-cffcf08253d5@g12g2000yqd.googlegroups.com> |
| In reply to | #6572 |
On 10 juin, 19:45, mrbrklyn <ceo.brook...@gmail.com> wrote:
> On Jun 10, 4:49 am, Michael Doubez <michael.dou...@free.fr> wrote:
>
>
>
>
>
>
>
>
>
> > On 10 juin, 06:12, Ruben Safir <ru...@mrbrklyn.com> wrote:
>
> > > On Thu, 09 Jun 2011 11:26:08 +0000, Jorgen Grahn wrote:
> > > >>> namespace unique {} using namespace unique; namespace unique { ... }
>
> > > >> ugg - back to the namespace syntax chapter...
>
> > > > If you *do* have a book,
>
> > > Jorgen, do you think I have any C++ references and do you think I read
> > > them. It's irrelevant since the namespace sections in Stroudtrup are
> > > nearly incomprehensible and written more like a dissertation than a
> > > learning tool,
>
> > Well, IMHO it is because he explains the namespace functionality in
> > perspective of the problem it is intended to solve.
>
> > > and Lippman's book is written just as incomprehensibly,
> > > but like a cookbook,
>
> > You must be talking about "Essential C++". I rather agree with you.
> > Some minds prefer a narrative approach.
>
> > > and Deitels is incomplete, although better
> > > organized, and frankly, there isn't a decent C++ text on the market (as
> > > of yet)
>
> > IMO "Accelerated C++" is the best for beginners.
>
> > Once you get a little background, the Effective serie of Scott Meyers
> > and Exceptional serie of Herb Sutter get you up to speed.
>
> > If you want to work on template "C++ templates" by Vandevoorde &
> > Josuttis is the clearer.
>
> > [snip]
>
> > --
> > Micha
>
> I don't want to be critical of texts I haven't explored, but I've
> spent a good deal of time
> pouring over books at the Big College Barnes and Nobles on 5th avenue
> and 17th street that supplies nearly all the universities in Manhattan
> and the
> picking is slim. The Template book approaches usability.
>
> Three things are wrong with the majority of texts:
>
> A) They assume you are an experienced C programmer.
Well, that is exactly the point of Accelerated C++. It takes C++ as a
new language, not as an outcrop of C.
> B) They lack a definitive appendix of all the standard libraries ...
> precisely. The appendix in most of these books are endless jabbering
> of semi-thought out expressions of complex ideas.
I don't know exactly what libraries you expect but Josuttis bokk "The C
++ Standard Library" is kind of a reference.
> C) The utterly fail to teach fundamentals. Fundamentals...this is a
> compiler. This is an editor.
Well. I guess an internet tutorial is best suited for this kid of
demand.
> D) They fail to teach theory.
Theory of what ?
If you are thinking theory of design, there is the pattern movement.
There are also some books like Alexander stephanov's Elements of
programming.
http://www.elementsofprogramming.com/
> I have a doctoral in Pharmaceutics and if my text on differential
> equations were like that, I'd have difficult time graduating.
But that was science with a rather limited scope.
> But I'll look at your suggestions although the idea, "get you up to
> speed" would ordinary be exactly what I don't want. If I want to get
> up to speed fast, one can drop back down to perl.
I mean up to speed concerning C++'s usage and idioms.
--
Michael
[toc] | [prev] | [next] | [standalone]
| From | ruben safir <ruben@mrbrklyn.com> |
|---|---|
| Date | 2011-06-13 04:08 +0000 |
| Message-ID | <it42gm$ioc$2@reader1.panix.com> |
| In reply to | #6645 |
On Sun, 12 Jun 2011 00:01:17 -0700, Michael Doubez wrote:
> On 10 juin, 19:45, mrbrklyn <ceo.brook...@gmail.com> wrote:
>> On Jun 10, 4:49 am, Michael Doubez <michael.dou...@free.fr> wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > On 10 juin, 06:12, Ruben Safir <ru...@mrbrklyn.com> wrote:
>>
>> > > On Thu, 09 Jun 2011 11:26:08 +0000, Jorgen Grahn wrote:
>> > > >>> namespace unique {} using namespace unique; namespace unique {
>> > > >>> ... }
>>
>> > > >> ugg - back to the namespace syntax chapter...
>>
>> > > > If you *do* have a book,
>>
>> > > Jorgen, do you think I have any C++ references and do you think I
>> > > read them. It's irrelevant since the namespace sections in
>> > > Stroudtrup are nearly incomprehensible and written more like a
>> > > dissertation than a learning tool,
>>
>> > Well, IMHO it is because he explains the namespace functionality in
>> > perspective of the problem it is intended to solve.
>>
>> > > and Lippman's book is written just as incomprehensibly, but like a
>> > > cookbook,
>>
>> > You must be talking about "Essential C++". I rather agree with you.
>> > Some minds prefer a narrative approach.
>>
>> > > and Deitels is incomplete, although better organized, and frankly,
>> > > there isn't a decent C++ text on the market (as of yet)
>>
>> > IMO "Accelerated C++" is the best for beginners.
>>
>> > Once you get a little background, the Effective serie of Scott Meyers
>> > and Exceptional serie of Herb Sutter get you up to speed.
>>
>> > If you want to work on template "C++ templates" by Vandevoorde &
>> > Josuttis is the clearer.
>>
>> > [snip]
>>
>> > --
>> > Micha
>>
>> I don't want to be critical of texts I haven't explored, but I've spent
>> a good deal of time
>> pouring over books at the Big College Barnes and Nobles on 5th avenue
>> and 17th street that supplies nearly all the universities in Manhattan
>> and the
>> picking is slim. The Template book approaches usability.
>>
>> Three things are wrong with the majority of texts:
>>
>> A) They assume you are an experienced C programmer.
>
> Well, that is exactly the point of Accelerated C++. It takes C++ as a
> new language, not as an outcrop of C.
>
>> B) They lack a definitive appendix of all the standard libraries ...
>> precisely. The appendix in most of these books are endless jabbering
>> of semi-thought out expressions of complex ideas.
>
> I don't know exactly what libraries you expect but Josuttis bokk "The C
> ++ Standard Library" is kind of a reference.
>
Thanks Michael. First chance I get i will look both these up.
I appreciate your information and effort.
>> C) The utterly fail to teach fundamentals. Fundamentals...this is a
>> compiler. This is an editor.
>
> Well. I guess an internet tutorial is best suited for this kid of
> demand.
>
This really needs to be integrated in every section of a language book.
Compilers, linkers and stacks need to be a constant subject. It frankly
boggles my mind that templates are taught without compiler discussion,
and the standards could be annotated from time to time.
>> D) They fail to teach theory.
>
> Theory of what ?
memory, compilers, stacks, binary representation (which might be taught
before pointers), esied optimization, scope theory and practice,
structure red programming theory, sorting theory, algorithms, lamda's
just to name a few things.
When i taught at the New School, it took me 2 weeks to understand that
students really didn't understand what a variable was, or the
relationship between their keyboard, output device to the computer.
>
> If you are thinking theory of design, there is the pattern movement.
>
> There are also some books like Alexander stephanov's Elements of
> programming.
> http://www.elementsofprogramming.com/
>
>> I have a doctoral in Pharmaceutics and if my text on differential
>> equations were like that, I'd have difficult time graduating.
>
> But that was science with a rather limited scope.
>
The physical chemistry and math wasn't.
>> But I'll look at your suggestions although the idea, "get you up to
>> speed" would ordinary be exactly what I don't want. If I want to get
>> up to speed fast, one can drop back down to perl.
>
> I mean up to speed concerning C++'s usage and idioms.
Learning idioms is very important. But learning how and why they work is
what is necessary to truly be a master of any language.
Ruben
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | comp.lang.c++
csiph-web