To STL or not to STL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WW

    #16
    Re: To STL or not to STL

    Mike Wahler wrote:[color=blue]
    > MFC? Ten-foot-pole, and all that. :-)[/color]

    What does that mean?

    --
    WW aka Attila he Englishly challenged :-)


    Comment

    • WW

      #17
      Re: To STL or not to STL

      Karl Heinz Buchegger wrote:[color=blue]
      > Aaahhhh. You mean the white "PED XING" painted on the street :-)
      > I had quite a funny time figuring out what that could mean when
      > visiting the US the first time.[/color]

      Cross your legs? ;-)

      --
      WW aka Attila


      Comment

      • Mike Wahler

        #18
        Re: [OT] To STL or not to STL

        "Karl Heinz Buchegger" <kbuchegg@gasca d.at> wrote in message
        news:3F8EE708.B AF9DD32@gascad. at...[color=blue]
        >
        > Mike Wahler wrote:[color=green]
        > >
        > > Also IMO equally important, not only is the code portable to
        > > other platforms without all the 'hand rolled' baggage, but it's
        > > also 'comprehension portable'. Any good C++ programmer recognizes
        > > e.g. std::vector<std ::string> as quickly and readily as he does
        > > e.g. a 'for' loop.
        > >
        > > One might compare this concept with e.g. the consistent sizes,
        > > shapes, and colors of various types of road signs as in the
        > > U.S., IMO a Good Thing(tm). "Everybody knows what they mean."[/color]
        >
        > Aaahhhh. You mean the white "PED XING" painted on the street :-)[/color]

        As I'm sure you've figured out by now, that's "Pedestrian
        Crossing." But those are usually only found in the more
        urban or suburban areas. "Stop signs" appear at any intersection
        without electric light signals, urban area or not (with some
        exceptions, e.g. "Yield" signs on lower traffic roads, again
        with a standard color and shape -- yellow triangle.) Both
        those types of sign, and many others, also often appear on
        the bedroom doors or walls of juvenile delinquents. :-)

        [End of driving lesson.] :-)
        [color=blue]
        > I had quite a funny time figuring out what that could mean when
        > visiting the US the first time. (Keep in mind: I am not a native
        > english speaker)[/color]

        It means "Don't Zing the Peds" :-)

        My mother recounted many such comprehension 'adventures'
        during her six-month stay in Paris. (And she had taken
        two years of French lessons in preparation for the trip. :-))

        -Mike


        Comment

        • Moonlit

          #19
          Re: To STL or not to STL

          Hi,

          STL. It's fast to code, it is fast code.

          A few reasons and examples from real life:

          Even today just 1.5 hour before I would left work, a colleage came over he
          had to figure out what records had been sent to another system. Now I'm
          talking about millions of records. After figuring out that the first 30
          characters for the where unique. I created a program with a set (this sorted
          automatically so it can do a binary search), corrected headers and footers
          in the file. I was finished with testing the program actually in 1.5 hours
          (including the little research for uniqueness, creating the numbers file
          etc.) Debugging time was nearly zero (ok, I forget about the headers at one
          time). I was surprised about the speed myself since it had to do a lookup in
          about 40 megabyte of data loaded in the set.

          I have programmed in pure C and this would have taken a lot longer than
          this.

          I have never encountered a bug in the STL (and I use it all the time).

          Sure, it does take a while before you get used to using it. But once you do
          you will program faster than anyone in plain C. Not only that, I at
          sometime, compared 20 lines of code almost entirely of STL stuff (with the
          SGI hash_map) with someone else highly optimized C code of three pages long
          (it performed the same function). I talked to him how much microseconds his
          lookups took because I was very curious about that. The answer he gave was
          nearly the same as I had (I believe it was something like 45 and 47), but I
          am quite sure that coding 20 lines take less time than 3 pages of code not
          to mention the latter takes more time to read and to debug.

          At some time I had to maintain a program without manuals but with a lot of
          code. I wondered how to get it up in case it would crash (management decided
          no backups since the data was expendible). I read through the code, since
          they used the STL a lot, this was reasonably to do. It would have been much
          more difficult if I would have to dig through three times the code necessary
          to acomplish the same without the STL.

          Therefore I would say use and or learn STL, you will do yourself and others
          a favor (and you look up to date with your C++ knowledge).




          Regards, Ron AF Greve


          "Allan Bruce" <allanmb@TAKEAW AYf2s.com> wrote in message
          news:bmlqta$4gb $1@news.freedom 2surf.net...[color=blue]
          > Hi there,
          >
          > I am interested to know if there are any C++ programmers who do not use[/color]
          STL.[color=blue]
          > I have been coding in C++ for a year or so now, although only recently[/color]
          have[color=blue]
          > I started a large(ish)-scale project. I do not use any STL, and I was
          > wondering if there are any others out there that program in C++ without
          > using STL? (Just to see if I am being stupid by not using it)
          >
          > Thanks
          > Allan
          >
          > --
          > Allan Bruce
          > Dept. of Computing Science
          > University of Aberdeen
          > Aberdeen AB24 3UE
          > Scotland, UK
          >
          >[/color]


          Comment

          • Mike Wahler

            #20
            Re: To STL or not to STL

            "WW" <wolof@freemail .hu> wrote in message
            news:bmmsmr$nrn $1@phys-news1.kolumbus. fi...[color=blue]
            > Mike Wahler wrote:[color=green]
            > > MFC? Ten-foot-pole, and all that. :-)[/color]
            >
            > What does that mean?[/color]

            A colloquialism (I don't know the origin). Referring to
            something or someone considered undesirable, "I wouln't
            touch that with a ten-foot-pole." Meaning essentially
            "I would not touch that, or even go within ten feet of it."
            (about three metres to you. :-))

            -Mike


            Comment

            • WW

              #21
              Re: To STL or not to STL

              Mike Wahler wrote:[color=blue]
              > "WW" <wolof@freemail .hu> wrote in message
              > news:bmmsmr$nrn $1@phys-news1.kolumbus. fi...[color=green]
              >> Mike Wahler wrote:[color=darkred]
              >>> MFC? Ten-foot-pole, and all that. :-)[/color]
              >>
              >> What does that mean?[/color]
              >
              > A colloquialism (I don't know the origin). Referring to
              > something or someone considered undesirable, "I wouln't
              > touch that with a ten-foot-pole." Meaning essentially
              > "I would not touch that, or even go within ten feet of it."
              > (about three metres to you. :-))[/color]

              Ah, OK. It is like the bone on the neck thing, then. :-)

              --
              WW aka Attila


              Comment

              • Christopher Benson-Manica

                #22
                Re: To STL or not to STL

                WW <wolof@freemail .hu> spoke thus:
                [color=blue]
                > Mike Wahler wrote:[color=green]
                >> MFC? Ten-foot-pole, and all that. :-)[/color][/color]
                [color=blue]
                > What does that mean?[/color]

                Heh... in English, there is a phrase "I wouldn't touch ____ with a ten-foot
                pole," meaning one wishes to stay as far away from ___ (whether ___ is a
                particularly nasty person, situation, a grizzly bear, or MFC). FWIW, if I had
                a ten-foot pole, I'd probably use it to bludgeon Bill Gates ;)

                --
                Christopher Benson-Manica | I *should* know what I'm talking about - if I
                ataru(at)cybers pace.org | don't, I need to know. Flames welcome.

                Comment

                • jeffc

                  #23
                  Re: To STL or not to STL


                  "Allan Bruce" <allanmb@TAKEAW AYf2s.com> wrote in message
                  news:bmlqta$4gb $1@news.freedom 2surf.net...[color=blue]
                  > Hi there,
                  >
                  > I am interested to know if there are any C++ programmers who do not use[/color]
                  STL.[color=blue]
                  > I have been coding in C++ for a year or so now, although only recently[/color]
                  have[color=blue]
                  > I started a large(ish)-scale project. I do not use any STL, and I was
                  > wondering if there are any others out there that program in C++ without
                  > using STL? (Just to see if I am being stupid by not using it)[/color]

                  Well, I think I'd get pretty tired of constantly reinventing the wheel.
                  Depending on the project I've used Microsoft MFC, or Rogue Wave library, or
                  STL, etc. So if you don't use STL, I hope you're at *least* using *some*
                  library that at *least* gives you a string :-)


                  Comment

                  • jeffc

                    #24
                    Re: To STL or not to STL


                    "Moonlit" <alt.spam@jupit er.universe> wrote in message
                    news:3f8ef7f6$0 $58713$e4fe514c @news.xs4all.nl ...[color=blue]
                    >
                    > I have never encountered a bug in the STL (and I use it all the time).[/color]

                    Isn't that kind of like saying you've never encountered a bug in the C++
                    language?


                    Comment

                    • Moonlit

                      #25
                      Re: To STL or not to STL

                      Hi,

                      "jeffc" <nobody@nowhere .com> wrote in message
                      news:3f8f1e3d_2 @news1.prserv.n et...[color=blue]
                      >
                      > "Moonlit" <alt.spam@jupit er.universe> wrote in message
                      > news:3f8ef7f6$0 $58713$e4fe514c @news.xs4all.nl ...[color=green]
                      > >
                      > > I have never encountered a bug in the STL (and I use it all the time).[/color]
                      >
                      > Isn't that kind of like saying you've never encountered a bug in the C++
                      > language?[/color]


                      Nope!

                      That's kind of saying I never encountered a bug in the STL (as I said).

                      Still, I didn't say there isn't any bug in the STL, I just say I haven't
                      encountered any, despite I have used it for many years.

                      Ok, at some time hash_map's didn't seem to be supported by the g++ compiler,
                      you can still download the files from sgi


                      Regards, Ron AF Greve.[color=blue]
                      >
                      >[/color]


                      Comment

                      • Samuel Barber

                        #26
                        Re: To STL or not to STL

                        "Ron Natalie" <ron@sensor.com > wrote in message news:<3f8ec298$ 0$69369$9a6e19e a@news.newshost ing.com>...[color=blue]
                        > Yes you are. If there is a feature supported by the library, you're better
                        > off using it than rolling your own. They make things much simpler. For
                        > example, vector and string both have reasonable copy/assignment/destruction
                        > behavior which means you don't have to sit there managing memory with new and
                        > delete.[/color]

                        Read up on "move constructors" and you might change your opinion of
                        what is reasonable behavior.

                        Sam

                        Comment

                        • Ron Natalie

                          #27
                          Re: To STL or not to STL


                          "Moonlit" <alt.spam@jupit er.universe> wrote in message news:3f8f20c9$0 $58715$e4fe514c @news.xs4all.nl ...
                          [color=blue]
                          > Ok, at some time hash_map's didn't seem to be supported by the g++ compiler,
                          > you can still download the files from sgi
                          >[/color]
                          hash-maps are NOT part of the C++ standard library.

                          I've encountered bugs in the STL, but as of late, I've been able to live with them.


                          Comment

                          • Ron Natalie

                            #28
                            Re: To STL or not to STL


                            "Samuel Barber" <opendtv@yahoo. com> wrote in message news:37991aef.0 310161457.37f35 adf@posting.goo gle.com...[color=blue]
                            > "Ron Natalie" <ron@sensor.com > wrote in message news:<3f8ec298$ 0$69369$9a6e19e a@news.newshost ing.com>...[color=green]
                            > > Yes you are. If there is a feature supported by the library, you're better
                            > > off using it than rolling your own. They make things much simpler. For
                            > > example, vector and string both have reasonable copy/assignment/destruction
                            > > behavior which means you don't have to sit there managing memory with new and
                            > > delete.[/color]
                            >
                            > Read up on "move constructors" and you might change your opinion of
                            > what is reasonable behavior.[/color]

                            That's a different issue. I'm talking about the copying and destruction of the
                            container itself (rather than the contained object).


                            Comment

                            • Moonlit

                              #29
                              Re: To STL or not to STL


                              "Ron Natalie" <ron@sensor.com > wrote in message
                              news:3f8f2519$0 $161$9a6e19ea@n ews.newshosting .com...[color=blue]
                              >
                              > "Moonlit" <alt.spam@jupit er.universe> wrote in message[/color]
                              news:3f8f20c9$0 $58715$e4fe514c @news.xs4all.nl ...[color=blue]
                              >[color=green]
                              > > Ok, at some time hash_map's didn't seem to be supported by the g++[/color][/color]
                              compiler,[color=blue][color=green]
                              > > you can still download the files from sgi
                              > >[/color]
                              > hash-maps are NOT part of the C++ standard library.[/color]

                              100% percent correct. That's why I said you can still download them from
                              SGI.

                              At one time they where supported by the g++ compiler. If you think you are
                              not able to compile your old code you can still download them from the SGI
                              site.

                              Apart from that there really is no reason to NOT use the STL. The code is
                              faster than you write it yourself (if you have something even faster post it
                              here, please!) not to mention it takes very little effort to write. Just
                              follow the postings in this newsgroup and you know that if you would like to
                              use C++ you sure want to use the STL.


                              Regards, Ron AF Greve


                              Comment

                              • JB

                                #30
                                Re: To STL or not to STL

                                "WW" <wolof@freemail .hu> wrote in message news:<bmmtn4$ra q$1@phys-news1.kolumbus. fi>...[color=blue]
                                > Mike Wahler wrote:[color=green]
                                > > "WW" <wolof@freemail .hu> wrote in message
                                > > news:bmmsmr$nrn $1@phys-news1.kolumbus. fi...[color=darkred]
                                > >> Mike Wahler wrote:
                                > >>> MFC? Ten-foot-pole, and all that. :-)
                                > >>
                                > >> What does that mean?[/color]
                                > >
                                > > A colloquialism (I don't know the origin). Referring to
                                > > something or someone considered undesirable, "I wouln't
                                > > touch that with a ten-foot-pole." Meaning essentially
                                > > "I would not touch that, or even go within ten feet of it."
                                > > (about three metres to you. :-))[/color]
                                >
                                > Ah, OK. It is like the bone on the neck thing, then. :-)[/color]

                                Bone on the neck?

                                --
                                JB, the Magyar-challenged ;-)

                                Comment

                                Working...