Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #14135 > unrolled thread

The way to read STL source code

Started byStanley Rice <heconghui@gmail.com>
First post2012-02-16 23:18 -0800
Last post2012-02-27 03:02 -0800
Articles 10 on this page of 90 — 23 participants

Back to article view | Back to comp.lang.c++


Contents

  The way to read STL source code Stanley Rice <heconghui@gmail.com> - 2012-02-16 23:18 -0800
    Re: The way to read STL source code Juha Nieminen <nospam@thanks.invalid> - 2012-02-17 07:29 +0000
      Re: The way to read STL source code Stanley Rice <heconghui@gmail.com> - 2012-02-17 00:56 -0800
        Re: The way to read STL source code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-17 01:11 -0800
        Re: The way to read STL source code Juha Nieminen <nospam@thanks.invalid> - 2012-02-17 12:31 +0000
          Re: The way to read STL source code Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-02-17 16:35 +0000
            Re: The way to read STL source code Juha Nieminen <nospam@thanks.invalid> - 2012-02-17 20:38 +0000
              Re: The way to read STL source code Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-02-21 21:17 +0000
          Re: The way to read STL source code Stanley Rice <heconghui@gmail.com> - 2012-02-17 16:55 -0800
            Re: The way to read STL source code Ian Collins <ian-news@hotmail.com> - 2012-02-18 14:13 +1300
            Re: Learning to code by reading code (was: The way to read STL source code) "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-18 19:00 -0500
              Re: Learning to code by reading code "MikeWhy" <boat042-nospam@yahoo.com> - 2012-02-18 22:34 -0600
              Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-19 03:54 -0500
                Re: Learning to code by reading code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-02-19 10:42 +0100
                Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-20 03:39 -0500
              Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-19 03:54 -0500
                Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-19 08:40 -0800
                  Re: Learning to code by reading code "MikeWhy" <boat042-nospam@yahoo.com> - 2012-02-19 13:17 -0600
                    Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 02:32 -0800
                      Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-20 13:02 +0100
                        Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 05:09 -0800
                          Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-20 15:11 +0100
                            Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 07:39 -0800
                  Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-20 04:14 -0500
                    Re: Learning to code by reading code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-02-20 11:14 +0100
                    Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 02:49 -0800
                      Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-20 13:02 +0100
                        Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-20 05:18 -0800
                          Re: Learning to code by reading code "BartC" <bc@freeuk.com> - 2012-02-20 13:53 +0000
                            Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-21 01:32 -0800
                              Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-21 16:16 +0100
                                Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-21 08:40 -0800
                      Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-20 17:36 -0500
                        Re: Learning to code by reading code Mike McCarty <mcmccarty@gmail.com> - 2012-02-20 15:27 -0800
                        Re: Learning to code by reading code Dombo <dombo@disposable.invalid> - 2012-02-21 00:45 +0100
                          Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-21 04:35 -0500
                            Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-21 08:48 -0800
                              Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-22 00:12 -0800
                              Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-22 06:12 -0500
                                Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-22 04:30 -0800
                                  Re: Learning to code by reading code Geoff <geoff@invalid.invalid> - 2012-02-22 10:45 -0800
                                    Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-23 01:12 -0800
                                  Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-23 07:34 -0500
                                    Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-23 05:46 -0800
                                      Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-24 08:38 +0100
                                        Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-24 08:40 +0100
                                        Re: Learning to code by reading code "io_x" <a@b.c.invalid> - 2012-02-24 09:38 +0100
                                      Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-25 05:25 -0500
                                        Re: Learning to code by reading code Dombo <dombo@disposable.invalid> - 2012-02-25 12:50 +0100
                                        Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-25 06:13 -0800
                                          Re: Learning to code by reading code Gareth Owen <gwowen@gmail.com> - 2012-02-26 07:20 +0000
                        Re: Learning to code by reading code Juha Nieminen <nospam@thanks.invalid> - 2012-02-21 08:23 +0000
                          Re: Learning to code by reading code Juha Nieminen <nospam@thanks.invalid> - 2012-02-21 08:43 +0000
                            Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-21 04:47 -0500
                              Re: Learning to code by reading code Juha Nieminen <nospam@thanks.invalid> - 2012-02-21 10:09 +0000
                                Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-22 05:38 -0500
                          Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-21 04:31 -0500
                            Re: Learning to code by reading code Juha Nieminen <nospam@thanks.invalid> - 2012-02-21 10:05 +0000
                              Re: Learning to code by reading code "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-02-21 12:21 +0100
                              Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-22 06:04 -0500
                            Re: Learning to code by reading code "BartC" <bc@freeuk.com> - 2012-02-21 11:01 +0000
                              Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-22 05:59 -0500
                        Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-21 01:27 -0800
                    Re: Learning to code by reading code Peter Remmers <p.remmers@expires-2011-04-30.arcornews.de> - 2012-02-20 22:25 +0100
                      Re: Learning to code by reading code Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-02-26 08:47 +0000
                        Re: Learning to code by reading code "BartC" <bc@freeuk.com> - 2012-02-26 10:55 +0000
                    Re: Learning to code by reading code Nomen Nescio <nobody@dizum.com> - 2012-02-22 08:59 +0100
                      Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-22 05:59 -0500
                        Re: Learning to code by reading code Nomen Nescio <nobody@dizum.com> - 2012-02-22 13:47 +0100
                          Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-23 06:21 -0500
                    Re: Learning to code by reading code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-22 00:08 -0800
              Re: Learning to code by reading code "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-02-19 03:54 -0500
                Re: Learning to code by reading code Stanley Rice <heconghui@gmail.com> - 2012-02-19 05:24 -0800
              Re: Learning to code by reading code Marco van de Voort <marcov@toad.stack.nl> - 2012-02-19 11:27 +0000
            Re: Learning to code by reading code (was: The way to read STL source code) Ebenezer <woodbrian77@gmail.com> - 2012-02-18 20:02 -0800
              Re: Learning to code by reading code (was: The way to read STL source code) 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-18 21:51 -0800
              Re: Learning to code by reading code (was: The way to read STL source code) "Bo Persson" <bop@gmb.dk> - 2012-02-19 16:10 +0100
            Re: The way to read STL source code Mark Elston <m.elston@advantest-ard.com> - 2012-02-21 16:40 -0800
      Re: The way to read STL source code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-17 01:06 -0800
    Re: The way to read STL source code Goran <goran.pusic@gmail.com> - 2012-02-16 23:36 -0800
      Re: The way to read STL source code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-17 01:12 -0800
        Re: The way to read STL source code Goran <goran.pusic@gmail.com> - 2012-02-17 03:57 -0800
          Re: The way to read STL source code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-17 05:15 -0800
            Re: The way to read STL source code Goran <goran.pusic@gmail.com> - 2012-02-17 06:02 -0800
            Re: The way to read STL source code Stanley Rice <heconghui@gmail.com> - 2012-02-17 17:08 -0800
              Re: The way to read STL source code Dombo <dombo@disposable.invalid> - 2012-02-19 16:52 +0100
    Re: The way to read STL source code Krice <paulkp@mbnet.fi> - 2012-02-24 00:38 -0800
    Re: The way to read STL source code 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-25 10:46 -0800
      Re: The way to read STL source code 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-26 14:57 -0800
      Re: The way to read STL source code Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-02-27 03:02 -0800

Page 5 of 5 — ← Prev page 1 2 3 4 [5]


#14144

FromNick Keighley <nick_keighley_nospam@hotmail.com>
Date2012-02-17 01:12 -0800
Message-ID<30be8669-7047-446f-9cc9-9c57f9009c92@f2g2000yqh.googlegroups.com>
In reply to#14142
On Feb 17, 7:36 am, Goran <goran.pu...@gmail.com> wrote:
> On Feb 17, 8:18 am, Stanley Rice <hecong...@gmail.com> wrote:
>
> > I am familiar with using STL, including the algorithm and the
> > containers,
> > however, how they are implemented. Some of my friends recommend me to
> > read
> > the source code of STL directly.
>
> Reading is too dry.

nonsense!

> Try debugging through it.

yuck!

> Start with the simplest
> of things, like for_each, vector::push_back, list::push_front. Just
> make simplest of programs, e.g.
>
> int main()
> {
>   std::vector<char> v;
>   v.push_back('a');
>
> }
>
> and go through with the debugger.
>
> In the beginning, it will be difficult, because you will need to learn
> to see through the cruft that's inside. Typically, you'll see a lot of
> code whose sole purpose is to aid debugging. You'll need to learn to
> ignore that. You will also see bizarre variable naming. Live with it.
> Variable naming in STL is subject to different considerations than
> your or mine code ;-).

or you could try poking your own eyes out

[toc] | [prev] | [next] | [standalone]


#14158

FromGoran <goran.pusic@gmail.com>
Date2012-02-17 03:57 -0800
Message-ID<37e90e3c-d9eb-4b51-acff-f93cc4efdc8b@p12g2000yqe.googlegroups.com>
In reply to#14144
On Feb 17, 10:12 am, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:
> On Feb 17, 7:36 am, Goran <goran.pu...@gmail.com> wrote:
>
> > On Feb 17, 8:18 am, Stanley Rice <hecong...@gmail.com> wrote:
>
> > > I am familiar with using STL, including the algorithm and the
> > > containers,
> > > however, how they are implemented. Some of my friends recommend me to
> > > read
> > > the source code of STL directly.
>
> > Reading is too dry.
>
> nonsense!
>
> > Try debugging through it.
>
> yuck!
>
>
>
>
>
>
>
>
>
> > Start with the simplest
> > of things, like for_each, vector::push_back, list::push_front. Just
> > make simplest of programs, e.g.
>
> > int main()
> > {
> >   std::vector<char> v;
> >   v.push_back('a');
>
> > }
>
> > and go through with the debugger.
>
> > In the beginning, it will be difficult, because you will need to learn
> > to see through the cruft that's inside. Typically, you'll see a lot of
> > code whose sole purpose is to aid debugging. You'll need to learn to
> > ignore that. You will also see bizarre variable naming. Live with it.
> > Variable naming in STL is subject to different considerations than
> > your or mine code ;-).
>
> or you could try poking your own eyes out

I find that watching code unroll in the debugger is a great way of
learning what code does. Even more so when it's about usual STL
implementations code.

I don't get your excitement. It's not very elaborate either ;-).

Goran.

[toc] | [prev] | [next] | [standalone]


#14164

FromNick Keighley <nick_keighley_nospam@hotmail.com>
Date2012-02-17 05:15 -0800
Message-ID<316e6cce-4c7b-4e27-a7b8-13030e10df4f@q12g2000yqg.googlegroups.com>
In reply to#14158
On Feb 17, 11:57 am, Goran <goran.pu...@gmail.com> wrote:
> On Feb 17, 10:12 am, Nick Keighley <nick_keighley_nos...@hotmail.com>
> > On Feb 17, 7:36 am, Goran <goran.pu...@gmail.com> wrote:
> > > On Feb 17, 8:18 am, Stanley Rice <hecong...@gmail.com> wrote:


> > > > I am familiar with using STL, including the algorithm and the
> > > > containers, however, how they are implemented. Some of my friends
> > > > recommend me to read the source code of STL directly.
>
> > > Reading is too dry.
>
> > nonsense!

I misunderstood here. Since I think reading the STL code is so
obviously mad I assumed you were saying "reading a book was too dry".
But I see not. If I want to know what the STL does I read Jossutis. or
use an online source.

> > > Try debugging through it.
>
> > yuck!
>
> > > Start with the simplest
> > > of things, like for_each, vector::push_back, list::push_front. Just
> > > make simplest of programs, e.g.
>
> > > int main()
> > > {
> > >   std::vector<char> v;
> > >   v.push_back('a');
>
> > > }
>
> > > and go through with the debugger.
>
> > > In the beginning, it will be difficult, because you will need to learn
> > > to see through the cruft that's inside. Typically, you'll see a lot of
> > > code whose sole purpose is to aid debugging. You'll need to learn to
> > > ignore that. You will also see bizarre variable naming. Live with it.
> > > Variable naming in STL is subject to different considerations than
> > > your or mine code ;-).
>
> > or you could try poking your own eyes out

it just seems a lot of pain ...cruft...bizzare variable naming... for
very little gain.

> I find that watching code unroll in the debugger is a great way of
> learning what code does.

I'm less enthusiastic. Very unenthusiastic in fact. And it doesn't
help you learn what the STL /should/ be doing. Without reading some
sort of documentation I don't see how you'd even know certain features
existed.

> Even more so when it's about usual STL
> implementations code.

even less is my thought. The STL is particularly ugly lookign code.
Why do you care how it's implemented? Do you single shot through the C
libraries? You probably do I suppose...

> I don't get your excitement.

what excitement?

> It's not very elaborate either ;-).

the STL? It's pretty subtle.

[toc] | [prev] | [next] | [standalone]


#14166

FromGoran <goran.pusic@gmail.com>
Date2012-02-17 06:02 -0800
Message-ID<e1584042-43de-43ed-845e-456dae537aac@m5g2000yqk.googlegroups.com>
In reply to#14164
On Feb 17, 2:15 pm, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:
> On Feb 17, 11:57 am, Goran <goran.pu...@gmail.com> wrote:
>
> > On Feb 17, 10:12 am, Nick Keighley <nick_keighley_nos...@hotmail.com>
> > > On Feb 17, 7:36 am, Goran <goran.pu...@gmail.com> wrote:
> > > > On Feb 17, 8:18 am, Stanley Rice <hecong...@gmail.com> wrote:
> > > > > I am familiar with using STL, including the algorithm and the
> > > > > containers, however, how they are implemented. Some of my friends
> > > > > recommend me to read the source code of STL directly.
>
> > > > Reading is too dry.
>
> > > nonsense!
>
> I misunderstood here. Since I think reading the STL code is so
> obviously mad I assumed you were saying "reading a book was too dry".
> But I see not. If I want to know what the STL does I read Jossutis. or
> use an online source.
>
>
>
>
>
>
>
>
>
> > > > Try debugging through it.
>
> > > yuck!
>
> > > > Start with the simplest
> > > > of things, like for_each, vector::push_back, list::push_front. Just
> > > > make simplest of programs, e.g.
>
> > > > int main()
> > > > {
> > > >   std::vector<char> v;
> > > >   v.push_back('a');
>
> > > > }
>
> > > > and go through with the debugger.
>
> > > > In the beginning, it will be difficult, because you will need to learn
> > > > to see through the cruft that's inside. Typically, you'll see a lot of
> > > > code whose sole purpose is to aid debugging. You'll need to learn to
> > > > ignore that. You will also see bizarre variable naming. Live with it.
> > > > Variable naming in STL is subject to different considerations than
> > > > your or mine code ;-).
>
> > > or you could try poking your own eyes out
>
> it just seems a lot of pain ...cruft...bizzare variable naming... for
> very little gain.
>
> > I find that watching code unroll in the debugger is a great way of
> > learning what code does.
>
> I'm less enthusiastic. Very unenthusiastic in fact. And it doesn't
> help you learn what the STL /should/ be doing. Without reading some
> sort of documentation I don't see how you'd even know certain features
> existed.

From "how they are implemented" words of the OP, I took he wants to
see how STL is implemented. Doc normally says nothing about that.

>
> > Even more so when it's about usual STL
> > implementations code.
>
> even less is my thought. The STL is particularly ugly lookign code.
> Why do you care how it's implemented? Do you single shot through the C
> libraries? You probably do I suppose...

Occasionally, yes. E.g. when I hit the problem I don't understand.

>
> > I don't get your excitement.
>
> what excitement?

I interpreted e.g. "or you could try poking your own eyes out" as you
being agitated about my post. "Excitement" was the wrong word.

Goran.

[toc] | [prev] | [next] | [standalone]


#14212

FromStanley Rice <heconghui@gmail.com>
Date2012-02-17 17:08 -0800
Message-ID<12732426.20.1329527297064.JavaMail.geo-discussion-forums@pbie8>
In reply to#14164
On Friday, February 17, 2012 9:15:55 PM UTC+8, Nick Keighley wrote:
> On Feb 17, 11:57 am, Goran <goran.pu...@gmail.com> wrote:
> > On Feb 17, 10:12 am, Nick Keighley <nick_keighley_nos...@hotmail.com>
> > > On Feb 17, 7:36 am, Goran <goran.pu...@gmail.com> wrote:
> > > > On Feb 17, 8:18 am, Stanley Rice <hecong...@gmail.com> wrote:
> 
> 
> > > > > I am familiar with using STL, including the algorithm and the
> > > > > containers, however, how they are implemented. Some of my friends
> > > > > recommend me to read the source code of STL directly.
> >
> > > > Reading is too dry.
> >
> > > nonsense!
> 
> I misunderstood here. Since I think reading the STL code is so
> obviously mad I assumed you were saying "reading a book was too dry".
> But I see not. If I want to know what the STL does I read Jossutis. or
> use an online source.
> 
> > > > Try debugging through it.
> >
> > > yuck!
> >
> > > > Start with the simplest
> > > > of things, like for_each, vector::push_back, list::push_front. Just
> > > > make simplest of programs, e.g.
> >
> > > > int main()
> > > > {
> > > >   std::vector<char> v;
> > > >   v.push_back('a');
> >
> > > > }
> >
> > > > and go through with the debugger.
> >
> > > > In the beginning, it will be difficult, because you will need to learn
> > > > to see through the cruft that's inside. Typically, you'll see a lot of
> > > > code whose sole purpose is to aid debugging. You'll need to learn to
> > > > ignore that. You will also see bizarre variable naming. Live with it.
> > > > Variable naming in STL is subject to different considerations than
> > > > your or mine code ;-).
> >
> > > or you could try poking your own eyes out
> 
> it just seems a lot of pain ...cruft...bizzare variable naming... for
> very little gain.
> 
> > I find that watching code unroll in the debugger is a great way of
> > learning what code does.
> 
> I'm less enthusiastic. Very unenthusiastic in fact. And it doesn't
> help you learn what the STL /should/ be doing. Without reading some
> sort of documentation I don't see how you'd even know certain features
> existed.
> 
> > Even more so when it's about usual STL
> > implementations code.
> 
> even less is my thought. The STL is particularly ugly lookign code.
> Why do you care how it's implemented? Do you single shot through the C
> libraries? You probably do I suppose...
Another reason that I want to read the source code is that I want to improve my understanding of data structure and algorithm in the same time. STL covers nearly all the basic data structure and algorithms.
> 
> > I don't get your excitement.
> 
> what excitement?
> 
> > It's not very elaborate either ;-).
> 
> the STL? It's pretty subtle.

[toc] | [prev] | [next] | [standalone]


#14283

FromDombo <dombo@disposable.invalid>
Date2012-02-19 16:52 +0100
Message-ID<4f411a71$0$14709$5fc3050@news.tiscali.nl>
In reply to#14212
Op 18-Feb-12 2:08, Stanley Rice schreef:
> Another reason that I want to read the source code is that I want
> to improve my understanding of data structure and algorithm in the
> same time. STL covers nearly all the basic data structure and algorithms.

Doing that by reading or single stepping through the STL code is about 
the most convoluted way to accomplish that. For a variety of reasons the 
code you will find in a typical standard library implementation is far 
from straightforward, there is way too much stuff in it that will 
distract you from what you really want to learn.

Studying code is not a good way to learn the fundamentals; you are 
better of with a good book about data structures and algorithms, and as 
a exercise try to implement some by yourself to see if you really grasp 
them. After that you might be in a better position to actually 
understand the STL code, if the need ever arises.

[toc] | [prev] | [next] | [standalone]


#14475

FromKrice <paulkp@mbnet.fi>
Date2012-02-24 00:38 -0800
Message-ID<968383a3-724d-4880-971d-61167dd9b938@k29g2000yqc.googlegroups.com>
In reply to#14135
On 17 helmi, 09:18, Stanley Rice <hecong...@gmail.com> wrote:
> I have no ideas where to begin to start with, and what to do

I think the best way to learn programming is by learning
concepts. After all source code is just an implementation
of concepts. C++ is a "difficult" language and often there
is limited time to create programs which has resulted to
poor quality source code.
That is why learning by reading source code can be a bad idea.
Of course there is some good source code as well, but it's
rare and you still have to learn the concepts to understand it.

[toc] | [prev] | [next] | [standalone]


#14497

From88888 Dihedral <dihedral88888@googlemail.com>
Date2012-02-25 10:46 -0800
Message-ID<20101148.984.1330195619401.JavaMail.geo-discussion-forums@pbcqw3>
In reply to#14135
在 2012年2月17日星期五UTC+8下午3时18分39秒,Stanley Rice写道:
> I am familiar with using STL, including the algorithm and the
> containers,
> however, how they are implemented. Some of my friends recommend me to
> read
> the source code of STL directly.
> 
> I download the SGI STL source code, which contains nearly 40 thousand
> lines. As far as I am concerned, it is a big project. And like other
> big
> projects, I have no ideas where to begin to start with, and what to do
> with
> it during the learning process.
> 
> I am a ungraduate student, hoping some of you could give me some
> advice,
> and I will keep it up.
> 
> Thanks in advance.



在 2012年2月17日星期五UTC+8下午3时18分39秒,Stanley Rice写道:
> I am familiar with using STL, including the algorithm and the
> containers,
> however, how they are implemented. Some of my friends recommend me to
> read
> the source code of STL directly.
> 
> I download the SGI STL source code, which contains nearly 40 thousand
> lines. As far as I am concerned, it is a big project. And like other
> big
> projects, I have no ideas where to begin to start with, and what to do
> with
> it during the learning process.
> 
> I am a ungraduate student, hoping some of you could give me some
> advice,
> and I will keep it up.
> 
> Thanks in advance.


I suggest you should play with data structure related functions or objects
in some higher level languages, such as perl, python, or smalltalk.

I use only the vector of void * pointers in the heap most of the time,
and the faster hash map for at least 8K of entries.

The set, tree and graph parts  can be replaced.

[toc] | [prev] | [next] | [standalone]


#14524

From88888 Dihedral <dihedral88888@googlemail.com>
Date2012-02-26 14:57 -0800
Message-ID<22768104.2234.1330297037592.JavaMail.geo-discussion-forums@pbcwj5>
In reply to#14497
在 2012年2月26日星期日UTC+8上午2时46分59秒,88888 Dihedral写道:
> 在 2012年2月17日星期五UTC+8下午3时18分39秒,Stanley Rice写道:
> > I am familiar with using STL, including the algorithm and the
> > containers,
> > however, how they are implemented. Some of my friends recommend me to
> > read
> > the source code of STL directly.
> > 
> > I download the SGI STL source code, which contains nearly 40 thousand
> > lines. As far as I am concerned, it is a big project. And like other
> > big
> > projects, I have no ideas where to begin to start with, and what to do
> > with
> > it during the learning process.
> > 
> > I am a ungraduate student, hoping some of you could give me some
> > advice,
> > and I will keep it up.
> > 
> > Thanks in advance.
> 
> 
> 
> 在 2012年2月17日星期五UTC+8下午3时18分39秒,Stanley Rice写道:
> > I am familiar with using STL, including the algorithm and the
> > containers,
> > however, how they are implemented. Some of my friends recommend me to
> > read
> > the source code of STL directly.
> > 
> > I download the SGI STL source code, which contains nearly 40 thousand
> > lines. As far as I am concerned, it is a big project. And like other
> > big
> > projects, I have no ideas where to begin to start with, and what to do
> > with
> > it during the learning process.
> > 
> > I am a ungraduate student, hoping some of you could give me some
> > advice,
> > and I will keep it up.
> > 
> > Thanks in advance.
> 
> 
> I suggest you should play with data structure related functions or objects
> in some higher level languages, such as perl, python, or smalltalk.
> 
> I use only the vector of void * pointers in the heap most of the time,
> and the faster hash map for at least 8K of entries.
> 
> The set, tree and graph parts  can be replaced.



在 2012年2月26日星期日UTC+8上午2时46分59秒,88888 Dihedral写道:
> 在 2012年2月17日星期五UTC+8下午3时18分39秒,Stanley Rice写道:
> > I am familiar with using STL, including the algorithm and the
> > containers,
> > however, how they are implemented. Some of my friends recommend me to
> > read
> > the source code of STL directly.
> > 
> > I download the SGI STL source code, which contains nearly 40 thousand
> > lines. As far as I am concerned, it is a big project. And like other
> > big
> > projects, I have no ideas where to begin to start with, and what to do
> > with
> > it during the learning process.
> > 
> > I am a ungraduate student, hoping some of you could give me some
> > advice,
> > and I will keep it up.
> > 
> > Thanks in advance.
> 
> 
> 
> 在 2012年2月17日星期五UTC+8下午3时18分39秒,Stanley Rice写道:
> > I am familiar with using STL, including the algorithm and the
> > containers,
> > however, how they are implemented. Some of my friends recommend me to
> > read
> > the source code of STL directly.
> > 
> > I download the SGI STL source code, which contains nearly 40 thousand
> > lines. As far as I am concerned, it is a big project. And like other
> > big
> > projects, I have no ideas where to begin to start with, and what to do
> > with
> > it during the learning process.
> > 
> > I am a ungraduate student, hoping some of you could give me some
> > advice,
> > and I will keep it up.
> > 
> > Thanks in advance.
> 
> 
> I suggest you should play with data structure related functions or objects
> in some higher level languages, such as perl, python, or smalltalk.
> 
> I use only the vector of void * pointers in the heap most of the time,
> and the faster hash map for at least 8K of entries.
> 
> The set, tree and graph parts  can be replaced.

By the way , one hash or dictionary designed well can replace any set 
of finite number of elements and also any binary tree or n-ary tree of 
finite number of nodes whenever not out of the heap space.

It needs two dictionaries to represent a connected directed graph.


[toc] | [prev] | [next] | [standalone]


#14537

FromNick Keighley <nick_keighley_nospam@hotmail.com>
Date2012-02-27 03:02 -0800
Message-ID<ae038463-d9d2-412c-bab1-8dd731d48de0@9g2000vbq.googlegroups.com>
In reply to#14497
On Feb 25, 6:46 pm, 88888 Dihedral <dihedral88...@googlemail.com>
wrote:
> 在 2012年2月17日星期五UTC+8下午3时18分39秒,Stanley Rice写道:

> > I am familiar with using STL, including the algorithm and the
> > containers,
> > however, how they are implemented. Some of my friends recommend me to
> > read the source code of STL directly.
> > [...] hoping some of you could give me some
> > advice,
> > and I will keep it up.

<snip>

> I suggest you should play with data structure related functions or objects
> in some higher level languages, such as perl, python, or smalltalk.

not sure how this will help with C++

> I use only the vector of void * pointers in the heap most of the time,
> and the faster hash map for at least 8K of entries.

note to original poster, Dihedral has some odd opinions on a few
topics (notably on the utility of assembly code) and this way of using
data structures may be one of them. Most high level C++ avoids void*

> The set, tree and graph parts  can be replaced.

if this made any sense I'd probaly disagree with it.

[toc] | [prev] | [standalone]


Page 5 of 5 — ← Prev page 1 2 3 4 [5]

Back to top | Article view | comp.lang.c++


csiph-web